SHA256
1
0
forked from pool/hare
hare/hare.spec
Soc Virnyl Estela b376fae8b9 - Move SRCDIR and HAREPATHs to /usr/src instead from /usr/lib
or `/usr/lib64`. Respect defaults if possible.
- Update to version 1702417101.ce67adb5:
  * +libc: Avoid overriding the default linker script on other platforms
  * FreeBSD: Fix build with +libc
  * os fs.ha: s/errors::errno/fs_to_errno/
  * OpenBSD: implement os::mkfifo and os::mkfile
  * math: Accept types::signed instead of integer in absi
  * cmd/{hare,haredoc}: remove unused imports
  * cmd/{hare,haredoc}: Don't allocate tags
  * haretype: use system architecture
  * os: add arch type and functions
  * cmd/haredoc: replace split with rtokenize
  * io: improve seek and whence docs
  * test: display special msg when no tests are run
  * hare deps: print more intuitive msg when no deps
  * os+linux: add mkfile
  * os+linux: s/Unix/Unix-like/
  * haredoc: submodules newline fixes
  * hare build: fix order of flags
  * getopt: improve docs
  * all: always use tabs for indentation
  * hare::parse::doc: add docs
  * haredoc: error out when more than one arg supplied
  * docs: rename hare-doc(5) to haredoc(5)
  * os+openbsd: remove extra License: header
  * rt+linux: fix some types
  * hare::parse: improve assign expr error message
  * strings: use type assertion in iter tests
  * strings: test contains with no variadic arguments

OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/hare?expand=0&rev=25
2023-12-16 01:08:08 +00:00

143 lines
3.2 KiB
RPMSpec

#
# spec file for package hare
#
# Copyright (c) 2023 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: 1702417101.ce67adb5
Summary: Hare system programming language
Group: Development/Tools/Building
License: MPL-2.0
URL: https://harelang.org
Source0: %{name}-%{version}.tar.zst
Source1: %{name}-rpmlintrc
Source2: README-suse-maint.md
BuildRequires: binutils
BuildRequires: gcc
BuildRequires: harec
BuildRequires: make
BuildRequires: qbe
BuildRequires: scdoc
BuildRequires: timezone
BuildRequires: zstd
Requires: harec
Requires: qbe
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
%setup -q
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