2022-01-31 20:12:54 +00:00
|
|
|
# https://ziglang.org/download/%{version}/release-notes.html#Support-Table
|
2021-06-07 20:21:10 +00:00
|
|
|
# 32 bit builds currently run out of memory https://github.com/ziglang/zig/issues/6485
|
|
|
|
%global zig_arches x86_64 aarch64 riscv64 %{mips64}
|
2021-06-07 20:01:14 +00:00
|
|
|
|
2021-11-02 19:40:40 +00:00
|
|
|
# note here at which Fedora release we need to deal with LLVM and glibc differences
|
2022-04-10 19:49:21 +00:00
|
|
|
%global fedora_llvm 36
|
|
|
|
# TODO check if this is still relevant
|
|
|
|
%global fedora_glibc 38
|
2021-11-02 19:40:40 +00:00
|
|
|
|
|
|
|
%global llvm_version 13.0.0
|
2021-09-12 16:52:57 +00:00
|
|
|
|
2022-04-10 19:49:21 +00:00
|
|
|
%if %{fedora} >= %{fedora_llvm}
|
|
|
|
%define llvm_compat 13
|
|
|
|
%endif
|
|
|
|
|
2021-11-02 19:40:40 +00:00
|
|
|
%if %{fedora} >= %{fedora_glibc}
|
2021-06-24 09:25:08 +00:00
|
|
|
# documentation and tests do not build due to an unsupported glibc version
|
2021-09-12 16:52:57 +00:00
|
|
|
%bcond_with test
|
|
|
|
%bcond_with docs
|
|
|
|
%else
|
|
|
|
%bcond_without test
|
|
|
|
%bcond_without docs
|
|
|
|
%endif
|
2021-11-02 19:40:40 +00:00
|
|
|
|
2021-09-12 16:52:57 +00:00
|
|
|
%bcond_without macro
|
|
|
|
|
2021-06-24 09:25:08 +00:00
|
|
|
|
2021-06-07 20:01:14 +00:00
|
|
|
Name: zig
|
2022-02-18 10:48:20 +00:00
|
|
|
Version: 0.9.1
|
|
|
|
Release: 1%{?dist}
|
2021-06-07 20:01:14 +00:00
|
|
|
Summary: Programming language for maintaining robust, optimal, and reusable software
|
|
|
|
|
|
|
|
License: MIT and NCSA and LGPLv2+ and LGPLv2+ with exceptions and GPLv2+ and GPLv2+ with exceptions and BSD and Inner-Net and ISC and Public Domain and GFDL and ZPLv2.1
|
|
|
|
URL: https://ziglang.org
|
|
|
|
Source0: https://github.com/ziglang/zig/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz
|
|
|
|
Source1: macros.%{name}
|
2022-04-10 19:49:21 +00:00
|
|
|
# prevent native directories from polluting the rpath
|
2022-01-31 20:12:54 +00:00
|
|
|
# https://github.com/ziglang/zig/pull/10621
|
|
|
|
Patch0: 0001-ignore-target-lib-dirs-when-invoked-with-feach-lib-r.patch
|
2021-06-07 20:01:14 +00:00
|
|
|
|
|
|
|
BuildRequires: gcc
|
|
|
|
BuildRequires: gcc-c++
|
|
|
|
BuildRequires: cmake
|
2022-04-10 19:49:21 +00:00
|
|
|
BuildRequires: llvm%{?llvm_compat}-devel
|
|
|
|
BuildRequires: clang%{?llvm_compat}-devel
|
|
|
|
BuildRequires: lld%{?llvm_compat}-devel
|
2021-06-07 20:01:14 +00:00
|
|
|
# for man page generation
|
|
|
|
BuildRequires: help2man
|
2021-09-12 16:52:57 +00:00
|
|
|
|
2022-04-10 19:49:21 +00:00
|
|
|
%if %{with macro} || 0%{?llvm_compat}
|
2021-06-14 19:42:15 +00:00
|
|
|
BuildRequires: sed
|
2021-09-12 16:52:57 +00:00
|
|
|
%endif
|
|
|
|
|
|
|
|
%if %{with test}
|
2021-06-07 20:01:14 +00:00
|
|
|
# for testing
|
2021-09-12 16:52:57 +00:00
|
|
|
BuildRequires: elfutils-libelf-devel
|
|
|
|
BuildRequires: libstdc++-static
|
|
|
|
%endif
|
2021-06-07 20:01:14 +00:00
|
|
|
|
|
|
|
Requires: %{name}-libs = %{version}
|
|
|
|
|
|
|
|
# These packages are bundled as source
|
|
|
|
|
|
|
|
# NCSA
|
2021-09-12 16:52:57 +00:00
|
|
|
Provides: bundled(compiler-rt) = %{llvm_version}
|
2021-06-07 20:01:14 +00:00
|
|
|
# LGPLv2+, LGPLv2+ with exceptions, GPLv2+, GPLv2+ with exceptions, BSD, Inner-Net, ISC, Public Domain and GFDL
|
2022-04-10 19:49:21 +00:00
|
|
|
Provides: bundled(glibc) = 2.34
|
2021-06-07 20:01:14 +00:00
|
|
|
# NCSA
|
2021-09-12 16:52:57 +00:00
|
|
|
Provides: bundled(libcxx) = %{llvm_version}
|
2021-06-07 20:01:14 +00:00
|
|
|
# NCSA
|
2021-09-12 16:52:57 +00:00
|
|
|
Provides: bundled(libcxxabi) = %{llvm_version}
|
2021-06-07 20:01:14 +00:00
|
|
|
# NCSA
|
2021-09-12 16:52:57 +00:00
|
|
|
Provides: bundled(libunwind) = %{llvm_version}
|
2021-06-07 20:01:14 +00:00
|
|
|
# BSD, LGPG, ZPL
|
2021-09-12 16:52:57 +00:00
|
|
|
Provides: bundled(mingw) = 9.0.0
|
2021-06-07 20:01:14 +00:00
|
|
|
# MIT
|
|
|
|
Provides: bundled(musl) = 1.2.2
|
2021-09-12 16:52:57 +00:00
|
|
|
# CC0, BSD, MIT, Apache2, Apache2 with exceptions
|
|
|
|
Provides: bundled(wasi-libc) = 82fc2c4f449e56319112f6f2583195c7f4e714b1
|
2021-06-07 20:01:14 +00:00
|
|
|
|
|
|
|
ExclusiveArch: %{zig_arches}
|
|
|
|
|
|
|
|
%description
|
|
|
|
Zig is an open-source programming language designed for robustness, optimality,
|
|
|
|
and clarity. This package provides the zig compiler and the associated runtime.
|
|
|
|
|
|
|
|
# the standard library contains only plain text
|
|
|
|
%package libs
|
2022-01-31 20:12:54 +00:00
|
|
|
Summary: %{name} Standard Library
|
2021-06-07 20:01:14 +00:00
|
|
|
BuildArch: noarch
|
|
|
|
|
|
|
|
%description libs
|
2022-01-31 20:12:54 +00:00
|
|
|
%{name} Standard Library
|
2021-06-07 20:01:14 +00:00
|
|
|
|
2021-09-12 16:52:57 +00:00
|
|
|
%if %{with docs}
|
2021-06-07 20:01:14 +00:00
|
|
|
%package doc
|
|
|
|
Summary: Documentation for %{name}
|
|
|
|
BuildArch: noarch
|
|
|
|
Requires: %{name} = %{version}
|
|
|
|
|
|
|
|
%description doc
|
|
|
|
Documentation for %{name}. For more information, visit %{url}
|
2021-09-12 16:52:57 +00:00
|
|
|
%endif
|
2021-06-07 20:01:14 +00:00
|
|
|
|
2021-09-12 16:52:57 +00:00
|
|
|
%if %{with macro}
|
2021-06-07 20:01:14 +00:00
|
|
|
%package rpm-macros
|
|
|
|
Summary: Common RPM macros for %{name}
|
|
|
|
Requires: rpm
|
|
|
|
BuildArch: noarch
|
|
|
|
|
|
|
|
%description rpm-macros
|
|
|
|
This package contains common RPM macros for %{name}.
|
2021-09-12 16:52:57 +00:00
|
|
|
%endif
|
2021-06-07 20:01:14 +00:00
|
|
|
|
|
|
|
%prep
|
2022-01-31 20:12:54 +00:00
|
|
|
%autosetup -p1
|
2021-09-12 16:52:57 +00:00
|
|
|
|
2022-04-10 19:49:21 +00:00
|
|
|
%if 0%{?llvm_compat}
|
|
|
|
sed -i "s|/usr/lib/llvm-13|%{_libdir}/llvm%{llvm_compat}|g" cmake/Find{clang,lld,llvm}.cmake
|
|
|
|
%endif
|
|
|
|
|
2021-06-07 20:01:14 +00:00
|
|
|
%build
|
|
|
|
|
|
|
|
%cmake \
|
|
|
|
-DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo \
|
|
|
|
-DZIG_PREFER_CLANG_CPP_DYLIB=true \
|
|
|
|
-DZIG_VERSION:STRING="%{version}"
|
|
|
|
%cmake_build
|
|
|
|
|
|
|
|
# Zig has no official manpage
|
|
|
|
# https://github.com/ziglang/zig/issues/715
|
|
|
|
help2man --no-discard-stderr "%{__cmake_builddir}/zig" --version-option=version --output=%{name}.1
|
|
|
|
|
|
|
|
ln -s lib "%{__cmake_builddir}/"
|
|
|
|
|
2021-09-12 16:52:57 +00:00
|
|
|
%if %{with docs}
|
2021-06-24 09:25:08 +00:00
|
|
|
%{__cmake_builddir}/zig build docs -Dversion-string="%{version}"
|
|
|
|
%endif
|
2021-06-24 10:17:24 +00:00
|
|
|
mkdir -p zig-cache
|
2021-06-07 20:01:14 +00:00
|
|
|
touch zig-cache/langref.html
|
|
|
|
|
|
|
|
%install
|
|
|
|
%cmake_install
|
|
|
|
|
|
|
|
mkdir -p %{buildroot}/%{_mandir}/man1
|
|
|
|
install -m 0644 %{name}.1 %{buildroot}%{_mandir}/man1/
|
|
|
|
|
|
|
|
mkdir -p %{buildroot}%{_rpmconfigdir}/macros.d/
|
|
|
|
|
|
|
|
install -p -m644 %{SOURCE1} %{buildroot}%{_rpmconfigdir}/macros.d/
|
|
|
|
sed -i -e "s|@@ZIG_VERSION@@|%{version}|" %{buildroot}%{_rpmconfigdir}/macros.d/macros.%{name}
|
|
|
|
|
|
|
|
%check
|
|
|
|
|
2021-09-12 16:52:57 +00:00
|
|
|
%if %{with test}
|
|
|
|
# Issues with tests stop them from completing successfully
|
|
|
|
# https://github.com/ziglang/zig/issues/9738
|
|
|
|
#%%{__cmake_builddir}/zig build test
|
2021-06-24 09:25:08 +00:00
|
|
|
%endif
|
2021-06-07 20:01:14 +00:00
|
|
|
|
|
|
|
%files
|
|
|
|
%license LICENSE
|
|
|
|
%{_bindir}/zig
|
|
|
|
%{_mandir}/man1/%{name}.1.*
|
|
|
|
|
|
|
|
%files libs
|
|
|
|
%{_prefix}/lib/%{name}
|
|
|
|
|
2021-09-12 16:52:57 +00:00
|
|
|
%if %{with docs}
|
2021-06-07 20:01:14 +00:00
|
|
|
%files doc
|
|
|
|
%doc README.md
|
|
|
|
%doc zig-cache/langref.html
|
2021-09-12 16:52:57 +00:00
|
|
|
%endif
|
|
|
|
|
|
|
|
%if %{with macro}
|
2021-06-07 20:01:14 +00:00
|
|
|
%files rpm-macros
|
|
|
|
%{_rpmconfigdir}/macros.d/macros.%{name}
|
2021-09-12 16:52:57 +00:00
|
|
|
%endif
|
2021-06-07 20:01:14 +00:00
|
|
|
|
|
|
|
%changelog
|
2022-02-18 10:48:20 +00:00
|
|
|
* Fri Feb 18 2022 Jan Drögehoff <sentrycraft123@gmail.com> - 0.9.1-1
|
|
|
|
- Update to 0.9.1
|
|
|
|
|
2022-01-31 20:12:54 +00:00
|
|
|
* Thu Jan 27 2022 Jan Drögehoff <sentrycraft123@gmail.com> - 0.9.0-3
|
|
|
|
- Jan: add rpath patch
|
|
|
|
- Aleksei Bavshin: rpm macros: set default build flags
|
|
|
|
|
2022-01-22 05:51:23 +00:00
|
|
|
* Sat Jan 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.0-2
|
|
|
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
|
|
|
|
|
2022-01-31 20:12:54 +00:00
|
|
|
|
2021-12-20 23:16:37 +00:00
|
|
|
* Mon Dec 20 2021 Jan Drögehoff <sentrycraft123@gmail.com> - 0.9.0-1
|
|
|
|
- Update to 0.9.0
|
|
|
|
|
2021-11-17 20:40:46 +00:00
|
|
|
* Wed Nov 17 2021 Jan Drögehoff <sentrycraft123@gmail.com> - 0.8.1-5
|
|
|
|
- Enable documentation on Fedora 35
|
|
|
|
|
2021-11-09 17:43:54 +00:00
|
|
|
* Tue Nov 09 2021 Tom Stellard <tstellar@redhat.com> - 0.8.1-4
|
|
|
|
- Rebuild for llvm-13.0.0
|
|
|
|
|
2021-10-30 21:56:27 +00:00
|
|
|
* Sat Oct 30 2021 Jan Drögehoff <sentrycraft123@gmail.com> - 0.8.1-3
|
|
|
|
- Update LLVM13 Patch
|
|
|
|
|
2021-10-07 23:28:39 +00:00
|
|
|
* Thu Oct 07 2021 Tom Stellard <tstellar@redhat.com> - 0.8.1-2
|
|
|
|
- Rebuild for llvm-13.0.0
|
|
|
|
|
2021-09-12 16:52:57 +00:00
|
|
|
* Sun Sep 12 2021 Jan Drögehoff <sentrycraft123@gmail.com> - 0.8.1-1
|
|
|
|
- Update to Zig 0.8.1, add LLVM 13 patch
|
|
|
|
|
2021-08-18 16:26:01 +00:00
|
|
|
* Wed Aug 18 2021 Jan Drögehoff <sentrycraft123@gmail.com> - 0.8.0-8
|
|
|
|
- Rebuilt for lld soname bump
|
|
|
|
|
2021-07-23 22:17:45 +00:00
|
|
|
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.0-7
|
|
|
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
|
|
|
|
|
2021-07-19 20:38:11 +00:00
|
|
|
* Mon Jul 19 2021 Jan Drögehoff <sentrycraft123@gmail.com> - 0.8.0-6
|
|
|
|
- add native libc detection patch
|
|
|
|
|
2021-07-04 20:52:27 +00:00
|
|
|
* Sun Jul 04 2021 Jan Drögehoff <sentrycraft123@gmail.com> - 0.8.0-5
|
|
|
|
- correct newline in macro that caused DESTDIR to be ignored
|
|
|
|
|
2021-06-28 18:35:35 +00:00
|
|
|
* Mon Jun 28 2021 Jan Drögehoff <sentrycraft123@gmail.com> - 0.8.0-4
|
|
|
|
- correct macro once again to allow for proper packaging
|
|
|
|
|
2021-06-24 10:21:02 +00:00
|
|
|
* Thu Jun 24 2021 Jan Drögehoff <sentrycraft123@gmail.com> - 0.8.0-3
|
|
|
|
- improve macro for using the zig binary
|
|
|
|
|
2021-06-24 09:25:08 +00:00
|
|
|
* Thu Jun 24 2021 Jan Drögehoff <sentrycraft123@gmail.com> - 0.8.0-2
|
|
|
|
- Update patches, correct rpm macro
|
|
|
|
|
2021-06-07 20:01:14 +00:00
|
|
|
* Sat Jun 05 2021 Jan Drögehoff <sentrycraft123@gmail.com> - 0.8.0-1
|
|
|
|
- Update to Zig 0.8.0
|
|
|
|
|
|
|
|
* Sun Dec 13 23:18:24 CET 2020 Jan Drögehoff <sentrycraft123@gmail.com> - 0.7.1-1
|
|
|
|
- Update to Zig 0.7.1
|
|
|
|
|
|
|
|
* Wed Nov 11 17:18:27 CET 2020 Jan Drögehoff <sentrycraft123@gmail.com> - 0.7.0-1
|
|
|
|
- Update to Zig 0.7.0
|
|
|
|
|
|
|
|
* Tue Aug 18 2020 Jan Drögehoff <sentrycraft123@gmail.com> - 0.6.0-1
|
|
|
|
- Initial zig spec
|
|
|
|
|