## START: Set by rpmautospec ## (rpmautospec version 0.3.5) ## RPMAUTOSPEC: autochangelog ## END: Set by rpmautospec # Hare executables (including the compiler) do not seem to support debugsymbols # for the time being, although DWARF support is planned in the future: # https://harelang.org/blog/2022-11-04-making-hare-debuggable/ %global debug_package %{nil} # Upstream does not provide versioned releases for the time being. When asked # on IRC, they said to follow the master branch of the hare repository. %define date 20230610 %define commit 8cfe393 Name: hare Version: 0 Release: %{date}.%{commit} Summary: The Hare programming language License: MPL-2.0 URL: https://harelang.org Source0: https://git.sr.ht/~sircmpwn/%{name}/archive/%{commit}.tar.gz#/%{name}-%{release}.tar.gz BuildRequires: harec BuildRequires: make BuildRequires: qbe BuildRequires: scdoc ExclusiveArch: x86_64 aarch64 %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 -n %{name}-%{commit} cp config.example.mk config.mk sed -iE 's!PREFIX = /usr/local!PREFIX = %{_prefix}!' config.mk sed -iE 's!ARCH = x86_64!ARCH = %{_arch}!' config.mk # We always build our RPM on native environments - we don't need extra tools to # cross-compile. for arch in aarch64 riscv64; do for binary in as ar cc ld; do arch_up=$(echo $arch | tr '[:lower:]' '[:upper:]') binary_up=$(echo $binary | tr '[:lower:]' '[:upper:]') sed -iE "s!${arch_up}_${binary_up}=${arch}-${binary}!${arch_up}_${binary_up}=${binary}!" config.mk done done %build # We strip down our default LDFLAGS, as it is directly passed to 'ld' and not # through gcc or so (e.g. '-Wl,' prefixes must be removed, '-spec' doesn't fit # in there, etc.). # Note: --build-id is removed since hare's linker script does not support build # IDs for the time being ('--build-id=sha1' has no effect, which I believe is # due to the custom linker script specified by '-T', and located at # rt/hare.sc - I'm no expert on those things, though). # Our default LDFLAGS: # -Wl,-z,relro is ignored ('ignored' warning on usage). # -Wl,--as-needed - I'm not sure if it had any effect here. # -Wl,-z,now ('ignored' warning on usage). # -specs=/usr/lib/rpm/redhat/redhat-hardened-ld could be manually fed to ld # - would it be ignored? # -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 is not something that LD can eat. # -Wl,--build-id=sha1 # -specs=/usr/lib/rpm/redhat/redhat-package-notes' could be manually fed to ld # - would it be ignored? export LDFLAGS="--as-needed" make %{?_smp_mflags} %install %make_install PREFIX=%{_prefix} %check make check %files %doc README.md %license COPYING %{_bindir}/%{name}* %{_mandir}/man1/%{name}*.1.gz %{_usrsrc}/%{name}/stdlib/* %changelog * Sat Jun 10 2023 John Doe - 0-1 - Uncommitted changes