Something went wrong. Try again.
Something went wrong. Try again.
12 kB · 372 lines
at 43
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373# https://ziglang.org/download/VERSION/release-notes.html#Support-Table%global zig_arches x86_64 aarch64 riscv64 %{mips64}# Signing key from https://ziglang.org/download/%global public_key RWSGOq2NVecA2UPNdBUZykf1CCb147pkmdtYxgb3Ti+JO/wCYvhbAb/U
# note here at which Fedora or EL release we need to use compat LLVM packages%if 0%{?fedora} >= 43 || 0%{?rhel} >= 9%define llvm_compat 20%endif
%global llvm_version 21.1.4
%bcond bootstrap 1%bcond docs %{without bootstrap}%bcond macro %{without bootstrap}%bcond test 1
%global zig_cache_dir %{builddir}/zig-cache
%global zig_build_options %{shrink: \ --verbose \ --release=fast \ --summary all \ \ -Dtarget=native \ -Dcpu=baseline \ --zig-lib-dir lib \ --build-id=sha1 \ \ --cache-dir "%{zig_cache_dir}" \ --global-cache-dir "%{zig_cache_dir}" \ \ -Dversion-string="%{version}" \ -Dstatic-llvm=false \ -Denable-llvm=true \ -Dno-langref=true \ -Dstd-docs=false \ -Dpie \ -Dconfig_h="%{__cmake_builddir}/config.h" \}%global zig_install_options %zig_build_options %{shrink: \ --prefix "%{_prefix}" \}
Name: zigVersion: 0.15.2Release: 1%{?dist}Summary: Programming language for maintaining robust, optimal, and reusable software
License: MIT AND NCSA AND LGPL-2.1-or-later AND LGPL-2.1-or-later WITH GCC-exception-2.0 AND GPL-2.0-or-later AND GPL-2.0-or-later WITH GCC-exception-2.0 AND BSD-3-Clause AND Inner-Net-2.0 AND ISC AND LicenseRef-Fedora-Public-Domain AND GFDL-1.1-or-later AND ZPL-2.1URL: https://ziglang.orgSource0: %{url}/download/%{version}/%{name}-%{version}.tar.xzSource1: %{url}/download/%{version}/%{name}-%{version}.tar.xz.minisigSource2: macros.%{name}# Remove native lib directories from rpath# this is unlikely to be upstreamed in its current state because upstream# wants to work around the shortcomings of NixOSPatch: 0001-remove-native-lib-directories-from-rpath.patch# Adds a build option for setting the build-id# some projects are not programmed to handle a build-id's# by having it as a flag we can make sure no developer runs into# any trouble because of packaging demands# https://github.com/ziglang/zig/pull/22516
BuildRequires: gccBuildRequires: gcc-c++BuildRequires: cmakeBuildRequires: llvm%{?llvm_compat}-develBuildRequires: clang%{?llvm_compat}-develBuildRequires: lld%{?llvm_compat}-develBuildRequires: zlib-develBuildRequires: libxml2-devel# for man page generationBuildRequires: help2man# for signature verificationBuildRequires: minisign
%if %{without bootstrap}BuildRequires: (zig >= 0.14 with zig < 0.15)%endif
%if %{with test}# for testingBuildRequires: elfutils-libelf-develBuildRequires: libstdc++-static%endif
Requires: %{name}-libs = %{version}
# These packages are bundled as source
# Apache-2.0 WITH LLVM-exception OR NCSA OR MITProvides: bundled(compiler-rt) = %{llvm_version}# LGPL-2.1-or-later AND SunPro AND LGPL-2.1-or-later WITH GCC-exception-2.0 AND BSD-3-Clause AND GPL-2.0-or-later AND LGPL-2.1-or-later WITH GNU-compiler-exception AND GPL-2.0-only AND ISC AND LicenseRef-Fedora-Public-Domain AND HPND AND CMU-Mach AND LGPL-2.0-or-later AND Unicode-3.0 AND GFDL-1.1-or-later AND GPL-1.0-or-later AND FSFUL AND MIT AND Inner-Net-2.0 AND X11 AND GPL-2.0-or-later WITH GCC-exception-2.0 AND GFDL-1.3-only AND GFDL-1.1-onlyProvides: bundled(glibc) = 2.41# Apache-2.0 WITH LLVM-exception OR MIT OR NCSAProvides: bundled(libcxx) = %{llvm_version}# Apache-2.0 WITH LLVM-exception OR MIT OR NCSAProvides: bundled(libcxxabi) = %{llvm_version}# NCSAProvides: bundled(libunwind) = %{llvm_version}# BSD, LGPG, ZPLProvides: bundled(mingw) = 3839e21b08807479a31d5a9764666f82ae2f0356# MITProvides: bundled(musl) = 1.2.5# Apache-2.0 WITH LLVM-exception AND Apache-2.0 AND MIT AND BSD-2-ClauseProvides: bundled(wasi-libc) = d03829489904d38c624f6de9983190f1e5e7c9c5
ExclusiveArch: %{zig_arches}
%descriptionZig is an open-source programming language designed for robustness, optimality,and clarity. This package provides the zig compiler and the associated runtime.
# The Zig stdlib only contains uncompiled code%package libsSummary: %{name} Standard LibraryBuildArch: noarch
%description libs%{name} Standard Library
%if %{with docs}%package docSummary: Documentation for %{name}BuildArch: noarchRequires: %{name} = %{version}
%description docDocumentation for %{name}. For more information, visit %{url}%endif
%if %{with macro}%package rpm-macrosSummary: Common RPM macros for %{name}Requires: rpmBuildArch: noarch
%description rpm-macrosThis package contains common RPM macros for %{name}.%endif
%prep/usr/bin/minisign -V -m %{SOURCE0} -x %{SOURCE1} -P %{public_key}
%autosetup -p1%if %{without bootstrap}# Ensure that the pre-build stage1 binary is not usedrm -f stage1/zig1.wasm%endif
%build
# zig doesn't know how to dynamically link llvm on its own so we need cmake to generate a header ahead of time# if we provide the header we need to also build zigcpp
# C_FLAGS: wasm2c output generates a lot of noise with -Wunused.# EXTRA_BUILD_ARGS: explicitly specify a build-id%cmake \ -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo \ -DCMAKE_C_FLAGS_RELWITHDEBINFO:STRING="-DNDEBUG -Wno-unused" \ -DCMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING="-DNDEBUG -Wno-unused" \ \ -DZIG_EXTRA_BUILD_ARGS:STRING="--verbose;--build-id=sha1" \ -DZIG_SHARED_LLVM:BOOL=true \ -DZIG_PIE:BOOL=true \ \ -DZIG_TARGET_MCPU:STRING=baseline \ -DZIG_TARGET_TRIPLE:STRING=native \ \ -DZIG_VERSION:STRING="%{version}"
%if %{with bootstrap}%cmake_build --target stage3%else%cmake_build --target zigcppzig build %{zig_build_options}
# Zig has no official manpage# https://github.com/ziglang/zig/issues/715help2man --no-discard-stderr --no-info "./zig-out/bin/zig" --version-option=version --output=zig.1%endif
%if %{with docs}# Use the newly made stage 3 compiler to generate docs ./zig-out/bin/zig build docs %{zig_build_options}%endif
%install%if %{with bootstrap}%cmake_install%elseDESTDIR="%{buildroot}" zig build install %{zig_install_options}
install -D -pv -m 0644 -t %{buildroot}%{_mandir}/man1/ zig.1%endif
%if %{with macro}install -D -pv -m 0644 %{SOURCE2} %{buildroot}%{_rpmmacrodir}/macros.%{name}%endif
%if %{with test}%check# Run reduced set of tests, based on the Zig CI"%{buildroot}%{_bindir}/zig" test test/behavior.zig -Itest%endif
%files%license LICENSE%{_bindir}/zig%if %{without bootstrap}%{_mandir}/man1/%{name}.1.*%endif
%files libs%{_prefix}/lib/%{name}
%if %{with docs}%files doc%doc README.md%doc zig-out/doc/langref.html%doc zig-out/doc/std%endif
%if %{with macro}%files rpm-macros%{_rpmmacrodir}/macros.%{name}%endif
%changelog* Fri Jul 25 2025 Fedora Release Engineering <releng@fedoraproject.org> - 0.14.1-2- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild
* Mon Jun 09 2025 Jan200101 <sentrycraft123@gmail.com> - 0.14.1-1- Update to 0.14.1
* Tue May 27 2025 Jan200101 <sentrycraft123@gmail.com> - 0.14.0-4- add patch to add library directories
* Fri May 09 2025 Jan200101 <sentrycraft123@gmail.com> - 0.14.0-3- add gcc to runtime dependencies
* Thu Apr 24 2025 Jan200101 <sentrycraft123@gmail.com> - 0.14.0-2- fix and re-enable documentation
* Thu Mar 06 2025 Jan200101 <sentrycraft123@gmail.com> - 0.14.0-1- Update to 0.14.0
* Mon Jan 27 2025 Jan200101 <sentrycraft123@gmail.com> - 0.13.0-8- specify to build against local zig stdlib directory to ensure we are building against the newest stdlib- use release fast instead of release safe to fix aarch64 builds from running out of memory- enable position independent executable for the zig build
* Mon Jan 27 2025 Jan200101 <sentrycraft123@gmail.com> - 0.13.0-7- build stage 3 using zig build system- add user provided options to the end of the build and install options
* Thu Jan 23 2025 Jan200101 <sentrycraft123@gmail.com> - 0.13.0-6- rebuild against fixed llvm
* Sun Jan 19 2025 Fedora Release Engineering <releng@fedoraproject.org> - 0.13.0-5- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild
* Sun Dec 29 2024 Jan200101 <sentrycraft123@gmail.com> - 0.13.0-4- correct macro variables- set llvm_compat for F41- update callaway licenses to follow SPDX
* Wed Sep 04 2024 Miroslav Suchý <msuchy@redhat.com> - 0.13.0-3- convert license to SPDX
* Sat Jul 20 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.13.0-2- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild
* Tue Jun 11 2024 Jan200101 <sentrycraft123@gmail.com> - 0.13.0-1- Update to 0.13.0
* Sat Jun 08 2024 Jan200101 <sentrycraft123@gmail.com> - 0.12.1-1- Update to 0.12.1
* Sat May 25 2024 Jan200101 <sentrycraft123@gmail.com> - 0.12.0-1- Update to 0.12.0
* Wed Feb 21 2024 Jan Drögehoff <sentrycraft123@gmail.com> - 0.11.0-2- Rebuilt for bootstrapping
* Sat Jan 27 2024 Aleksei Bavshin <alebastr@fedoraproject.org> - 0.11.0-1- Update to 0.11.0
* Sat Jan 27 2024 Aleksei Bavshin <alebastr@fedoraproject.org> - 0.9.1-6- Fix build with `--without macro`- Skip %%check and test dependencies when tests are disabled- Drop %%_zig_version macro
* Sat Jan 27 2024 Benson Muite <benson_muite@emailplus.org> - 0.9.1-6- Verify source signature
* Sat Jan 27 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.1-5- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Sat Jul 22 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.1-4- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Sat Jan 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.1-3- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Sat Jul 23 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.1-2- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Fri Feb 18 2022 Jan Drögehoff <sentrycraft123@gmail.com> - 0.9.1-1- Update to 0.9.1
* 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
* Sat Jan 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.0-2- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Mon Dec 20 2021 Jan Drögehoff <sentrycraft123@gmail.com> - 0.9.0-1- Update to 0.9.0
* Wed Nov 17 2021 Jan Drögehoff <sentrycraft123@gmail.com> - 0.8.1-5- Enable documentation on Fedora 35
* Tue Nov 09 2021 Tom Stellard <tstellar@redhat.com> - 0.8.1-4- Rebuild for llvm-13.0.0
* Sat Oct 30 2021 Jan Drögehoff <sentrycraft123@gmail.com> - 0.8.1-3- Update LLVM13 Patch
* Thu Oct 07 2021 Tom Stellard <tstellar@redhat.com> - 0.8.1-2- Rebuild for llvm-13.0.0
* Sun Sep 12 2021 Jan Drögehoff <sentrycraft123@gmail.com> - 0.8.1-1- Update to Zig 0.8.1, add LLVM 13 patch
* Wed Aug 18 2021 Jan Drögehoff <sentrycraft123@gmail.com> - 0.8.0-8- Rebuilt for lld soname bump
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.8.0-7- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Mon Jul 19 2021 Jan Drögehoff <sentrycraft123@gmail.com> - 0.8.0-6- add native libc detection patch
* Sun Jul 04 2021 Jan Drögehoff <sentrycraft123@gmail.com> - 0.8.0-5- correct newline in macro that caused DESTDIR to be ignored
* Mon Jun 28 2021 Jan Drögehoff <sentrycraft123@gmail.com> - 0.8.0-4- correct macro once again to allow for proper packaging
* Thu Jun 24 2021 Jan Drögehoff <sentrycraft123@gmail.com> - 0.8.0-3- improve macro for using the zig binary
* Thu Jun 24 2021 Jan Drögehoff <sentrycraft123@gmail.com> - 0.8.0-2- Update patches, correct rpm macro
* 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