SHA256
1
0
forked from pool/hare
hare/hare.spec

145 lines
3.4 KiB
RPMSpec
Raw Normal View History

- Remove riscv64-correct-comments.patch - Update to version 0.24.2: This release introduces a lot of breaking changes * time::date now accepts a zone offset (zoff) parameter in time::date::reckon and time::date::truncate. * time::date::calculus has been renamed to time::date::rflag. * time::date::realize requires .vloc to be set, and no longer defaults to UTC. * time::date::now() is renamed to time::date::localnow() and time::date::nowutc() is renamed to time::date::now() * time::date::EPOCHAL_JULIAN and EPOCHAL_GREGORIAN have been renamed to EPOCHDAY_JULIAN and EPOCHDAY_GREGORIAN respectively * time::chrono::eq has been removed and replaced with time::chrono::simultaneous and time::chrono::coincident * time::chrono::mzone has been renamed to time::chrono::ozone * The type of time::date::parsefail has been chnaged from rune (storing the offending format specifier) to (size, rune), which adds the index of the position where the parsing failure occured. * Several constants for format layouts in time::date have been renamed: [[EMAILZ]] => [[EMAILZONE]] [[STAMP_NANO]] => [[STAMPNANO]] [[STAMP_ZOFF]] => [[STAMPZOFF]] [[STAMP_ZONE]] => [[STAMPZONE]] [[STAMP_NOZL]] => [[STAMPLOC]] * unix::hosts * unix::passwd * "done" is now a reserved word and cannot be used in user-defined names * The following standard library symbols have been updated to use done types in their API: * bytes::next_token/bytes::prev_token * encoding::utf8 * fs::next * glob::next * io::EOF * mime * path::nextiter * strings::next/strings::prev * strings::next_token/strings::prev_token * In short, if your program matches on a function using the iterator pattern with "void" and this causes an error from 0.24.2, the correct solution is likely to rewrite it to use a for-each loop, or replace "void" with "done" in the relevant match case. * for-each loops and the "done" type * Optional parameters for functions * Support for shared memory and memfds on supported platforms * Revised and improved APIs for unix::* * Improved performance for bufio and related APIs * regex:: now supports multiple alternation (i.e. (x|y|z)) * New cryptography APIs: * crypto::ec * crypto::ecdh * crypto::ecdsa OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/hare?expand=0&rev=38
2024-07-17 08:49:34 +02:00
#
# spec file for package hare
#
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%bcond_without test
Name: hare
Release: 0
Version: 0.24.2
Summary: Hare system programming language
Group: Development/Tools/Building
License: MPL-2.0
URL: https://harelang.org
Source0: https://git.sr.ht/~sircmpwn/hare/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz
Source1: %{name}-rpmlintrc
Source2: README-suse-maint.md
BuildRequires: binutils
BuildRequires: gcc
# Hare and the HareC compiler should have the same version
BuildRequires: harec = %{version}
BuildRequires: make
BuildRequires: qbe
BuildRequires: scdoc
BuildRequires: timezone
BuildRequires: zstd
Requires: harec = %{version}
# Hare requires QBE 1.2 like HareC does
Requires: qbe = 1.2
Requires: timezone
%description
Hare is a systems programming language designed
to be simple, stable, and robust. Hare uses a
static type system, manual memory management,
and a minimal runtime. It is well-suited to
writing operating systems, system tools, compilers,
networking software, and other low-level, high
performance tasks
%prep
%autosetup -p1
cat > config.mk <<-SH
## Install configuration
PREFIX = %{_prefix}
BINDIR = %{_bindir}
MANDIR = %{_mandir}
SRCDIR = %{_prefix}/src
STDLIB = %{_prefix}/src/%{name}/stdlib
## Build configuration
# variables used during the build
PLATFORM = linux
ARCH = %{_arch}
HAREFLAGS =
HARECFLAGS =
QBEFLAGS =
ASFLAGS =
LDLINKFLAGS = --gc-sections -z noexecstack
# commands used by the build script
HAREC = harec
HAREFLAGS =
QBE = qbe
AS = as
LD = ld
AR = ar
SCDOC = scdoc
# build locations
HARECACHE = .cache
BINOUT = .bin
# variables that will be embedded in the binary with the -D definitions
HAREPATH = %{_prefix}/src/%{name}/stdlib:%{_prefix}/src/%{name}/third-party
VERSION = %{version}
# Cross-compiler toolchains
AARCH64_AS=as
AARCH64_AR=ar
AARCH64_CC=cc
AARCH64_LD=ld
RISCV64_AS=as
RISCV64_AR=ar
RISCV64_CC=cc
RISCV64_LD=ld
X86_64_AS=as
X86_64_AR=ar
X86_64_CC=cc
X86_64_LD=ld
SH
%build
export CFLAGS="%optflags -fPIE -Wl,-z,noexecstack"
export PLATFORM="linux"
export ARCH="%{_arch}"
make %{?_smp_mflags}
%install
export CFLAGS="%optflags -fPIE -Wl,-z,noexecstack"
export PLATFORM="linux"
export ARCH="%{_arch}"
make %{?_smp_mflags} DESTDIR="%{buildroot}" install
%if %{with test}
%check
# Enable only for tumbleweed/factory since
# Timezone package seems to fail this :D
%if 0%{?suse_version} > 1600
export CFLAGS="%optflags"
export PLATFORM="linux"
export ARCH="%{_arch}"
make %{?_smp_mflags} check
%endif
%endif
%files
%defattr(-,root,root)
%license COPYING
%doc README.md
%{_bindir}/%{name}
%{_bindir}/%{name}doc
%{_mandir}/man1/*
%{_mandir}/man5/*
%dir %{_prefix}/src/hare
%{_prefix}/src/hare/*
%changelog