SHA256
1
0
forked from pool/hare
hare/hare.spec
Soc Virnyl Estela b5a19d9994 - Update to version 1705636831.933763ed:
* OpenBSD: rt add kqueue(2) wrappers
  * OpenBSD: rt fix termios structures
  * .builds/freebsd.yml drop CC=cc workaround again
  * Fix typo in crypto::chachapoly
  * strings: Simplify fromutf8
  * Makefile: more quoting
  * remove harec2 from the makefile all target
  * cmd/haredoc: close read end of pipe after passing it to command
  * cmd/hare: fix cross-compiling qbe arch
  * Advance after zero-length regex matches
  * .builds/*: exit on non-master builds
  * make bootstrap
  * strings: rename pad functions per convention
  * strings: improve docs and params for pad functions
  * strings: readd pad functions
  * time: change signature of *_to_timespec funcs
  * notify hare-dev on ci failure
  * encoding::utf8: Return invalid from utf8sz on invalid starting byte
  * *BSD: fsflags_to_bsd return unsupported instead of abort()
  * rt: BPF socket structs & option levels for Linux
  * configs/*.mk: don't always assume cross-compilation
  * fmt: Fix fmt::mods documentation
  * unix::signal: fix typo in docs
  * encoding::utf8: Rename valid() to validate() and change return type
  * update ci for harec config.mk

OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/hare?expand=0&rev=31
2024-01-20 07:27:42 +00:00

144 lines
3.2 KiB
RPMSpec

#
# 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: 1703745713.f01c8eed
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
# Always be specific on harec version
BuildRequires: harec = 1702179030.9d51b36
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