Compare commits
No commits in common. "rawhide" and "f40" have entirely different histories.
11 changed files with 349 additions and 581 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -1,3 +1,2 @@
|
|||
/*-build
|
||||
/zig-*.tar.xz
|
||||
/zig-*.tar.xz.minisig
|
||||
|
|
|
|||
59
0001-Fedora-bootstrap-and-extra-build-flags-support.patch
Normal file
59
0001-Fedora-bootstrap-and-extra-build-flags-support.patch
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Aleksei Bavshin <alebastr89@gmail.org>
|
||||
Date: Fri, 20 Oct 2023 04:49:46 +0000
|
||||
Subject: [PATCH] Fedora: bootstrap and extra build flags support
|
||||
|
||||
- Allow passing ZIG_EXTRA_BUILD_FLAGS for stage3 build.
|
||||
- Allow redefining ZIG_EXECUTABLE and short-circuiting to stage3 build
|
||||
when using a prebuilt compiler from bootstrap package.
|
||||
- Bump required CMake version to 3.14 to enable generator expression
|
||||
expansion in `install(CODE ...)`.
|
||||
|
||||
Signed-off-by: Jan200101 <sentrycraft123@gmail.com>
|
||||
---
|
||||
CMakeLists.txt | 14 +++++++-------
|
||||
1 file changed, 7 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 22051f1902..06df068919 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -922,6 +922,9 @@ if(MSVC OR MINGW)
|
||||
target_link_libraries(zig2 LINK_PUBLIC version)
|
||||
endif()
|
||||
|
||||
+# Fedora customizations
|
||||
+set(ZIG_EXTRA_BUILD_ARGS "" CACHE STRING "Extra flags for stage3 build")
|
||||
+set(ZIG_EXECUTABLE "$<TARGET_FILE:zig2>" CACHE STRING "Compiler command to use for stage3 build")
|
||||
|
||||
# "-Dno-langref" and "-Dstd-docs=false" are hardcoded because they take too long to build.
|
||||
# To obtain these two forms of documentation, run zig build against stage3 rather than stage2.
|
||||
@@ -937,6 +940,8 @@ set(ZIG_BUILD_ARGS
|
||||
|
||||
-Dno-langref
|
||||
-Dstd-docs=false
|
||||
+
|
||||
+ ${ZIG_EXTRA_BUILD_ARGS}
|
||||
)
|
||||
|
||||
if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
|
||||
@@ -976,17 +981,12 @@ set(ZIG2_WORKING_DIR "${PROJECT_SOURCE_DIR}")
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT "${PROJECT_BINARY_DIR}/stage3/bin/zig"
|
||||
- COMMAND zig2 build --prefix "${PROJECT_BINARY_DIR}/stage3" ${ZIG_BUILD_ARGS}
|
||||
+ COMMAND ${ZIG_EXECUTABLE} build --prefix "${PROJECT_BINARY_DIR}/stage3" ${ZIG_BUILD_ARGS}
|
||||
COMMENT STATUS "Building stage3"
|
||||
+ DEPENDS zigcpp
|
||||
WORKING_DIRECTORY "${ZIG2_WORKING_DIR}"
|
||||
)
|
||||
|
||||
-if(WIN32)
|
||||
- set(ZIG_EXECUTABLE "${PROJECT_BINARY_DIR}/zig2.exe")
|
||||
-else()
|
||||
- set(ZIG_EXECUTABLE "${PROJECT_BINARY_DIR}/zig2")
|
||||
-endif()
|
||||
-
|
||||
install(CODE "set(ZIG_EXECUTABLE \"${ZIG_EXECUTABLE}\")")
|
||||
install(CODE "set(ZIG_BUILD_ARGS \"${ZIG_BUILD_ARGS}\")")
|
||||
install(CODE "set(ZIG2_WORKING_DIR \"${ZIG2_WORKING_DIR}\")")
|
||||
23
0002-Enable-build-id-by-default.patch
Normal file
23
0002-Enable-build-id-by-default.patch
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Aleksei Bavshin <alebastr89@gmail.org>
|
||||
Date: Fri, 20 Oct 2023 04:49:54 +0000
|
||||
Subject: [PATCH] Enable build-id by default
|
||||
|
||||
Signed-off-by: Jan200101 <sentrycraft123@gmail.com>
|
||||
---
|
||||
src/Compilation.zig | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/Compilation.zig b/src/Compilation.zig
|
||||
index 507cbfc6d5..d946956b05 100644
|
||||
--- a/src/Compilation.zig
|
||||
+++ b/src/Compilation.zig
|
||||
@@ -1230,7 +1230,7 @@ pub fn create(gpa: Allocator, arena: Allocator, options: CreateOptions) !*Compil
|
||||
const any_sanitize_thread = options.config.any_sanitize_thread or options.root_mod.sanitize_thread;
|
||||
|
||||
const link_eh_frame_hdr = options.link_eh_frame_hdr or any_unwind_tables;
|
||||
- const build_id = options.build_id orelse .none;
|
||||
+ const build_id = options.build_id orelse .sha1;
|
||||
|
||||
const link_libc = options.config.link_libc;
|
||||
|
||||
|
|
@ -1,254 +0,0 @@
|
|||
From 803935baf6a4730426afbb746adfd00c0ffc0f39 Mon Sep 17 00:00:00 2001
|
||||
From: Jan200101 <sentrycraft123@gmail.com>
|
||||
Date: Tue, 14 Apr 2026 19:20:26 +0200
|
||||
Subject: [PATCH 2/2] Remove unsupported LLVM targets for RHEL
|
||||
|
||||
LLVM for RHEL is only build with a subset of targets
|
||||
this blocks zig at the configuration stage.
|
||||
This commit simply swaps them out with the one from
|
||||
https://src.fedoraproject.org/rpms/llvm/blob/rawhide/f/llvm.spec
|
||||
|
||||
Signed-off-by: Jan200101 <sentrycraft123@gmail.com>
|
||||
---
|
||||
cmake/Findllvm.cmake | 2 +-
|
||||
src/codegen/llvm.zig | 97 ++++++++++----------------------------------
|
||||
src/target.zig | 43 +++++++++++---------
|
||||
3 files changed, 45 insertions(+), 97 deletions(-)
|
||||
|
||||
diff --git a/cmake/Findllvm.cmake b/cmake/Findllvm.cmake
|
||||
index 0c08d4f0ac..ed4da12044 100644
|
||||
--- a/cmake/Findllvm.cmake
|
||||
+++ b/cmake/Findllvm.cmake
|
||||
@@ -83,7 +83,7 @@ if(ZIG_USE_LLVM_CONFIG)
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
string(REPLACE " " ";" LLVM_TARGETS_BUILT "${LLVM_TARGETS_BUILT_SPACES}")
|
||||
|
||||
- set(ZIG_LLVM_REQUIRED_TARGETS "AArch64;AMDGPU;ARM;AVR;BPF;Hexagon;Lanai;LoongArch;Mips;MSP430;NVPTX;PowerPC;RISCV;SPIRV;Sparc;SystemZ;VE;WebAssembly;X86;XCore")
|
||||
+ set(ZIG_LLVM_REQUIRED_TARGETS "X86;AMDGPU;PowerPC;NVPTX;SystemZ;AArch64;BPF;WebAssembly;RISCV")
|
||||
|
||||
set(ZIG_LLVM_REQUIRED_TARGETS_ENABLED TRUE)
|
||||
foreach(TARGET_NAME IN LISTS ZIG_LLVM_REQUIRED_TARGETS)
|
||||
diff --git a/src/codegen/llvm.zig b/src/codegen/llvm.zig
|
||||
index 1ba3b272da..1ac1f6adc8 100644
|
||||
--- a/src/codegen/llvm.zig
|
||||
+++ b/src/codegen/llvm.zig
|
||||
@@ -4736,20 +4736,6 @@ pub fn initializeLLVMTarget(arch: std.Target.Cpu.Arch) void {
|
||||
bindings.LLVMInitializeAMDGPUAsmPrinter();
|
||||
bindings.LLVMInitializeAMDGPUAsmParser();
|
||||
},
|
||||
- .thumb, .thumbeb, .arm, .armeb => {
|
||||
- bindings.LLVMInitializeARMTarget();
|
||||
- bindings.LLVMInitializeARMTargetInfo();
|
||||
- bindings.LLVMInitializeARMTargetMC();
|
||||
- bindings.LLVMInitializeARMAsmPrinter();
|
||||
- bindings.LLVMInitializeARMAsmParser();
|
||||
- },
|
||||
- .avr => {
|
||||
- bindings.LLVMInitializeAVRTarget();
|
||||
- bindings.LLVMInitializeAVRTargetInfo();
|
||||
- bindings.LLVMInitializeAVRTargetMC();
|
||||
- bindings.LLVMInitializeAVRAsmPrinter();
|
||||
- bindings.LLVMInitializeAVRAsmParser();
|
||||
- },
|
||||
.bpfel, .bpfeb => {
|
||||
bindings.LLVMInitializeBPFTarget();
|
||||
bindings.LLVMInitializeBPFTargetInfo();
|
||||
@@ -4757,34 +4743,6 @@ pub fn initializeLLVMTarget(arch: std.Target.Cpu.Arch) void {
|
||||
bindings.LLVMInitializeBPFAsmPrinter();
|
||||
bindings.LLVMInitializeBPFAsmParser();
|
||||
},
|
||||
- .hexagon => {
|
||||
- bindings.LLVMInitializeHexagonTarget();
|
||||
- bindings.LLVMInitializeHexagonTargetInfo();
|
||||
- bindings.LLVMInitializeHexagonTargetMC();
|
||||
- bindings.LLVMInitializeHexagonAsmPrinter();
|
||||
- bindings.LLVMInitializeHexagonAsmParser();
|
||||
- },
|
||||
- .lanai => {
|
||||
- bindings.LLVMInitializeLanaiTarget();
|
||||
- bindings.LLVMInitializeLanaiTargetInfo();
|
||||
- bindings.LLVMInitializeLanaiTargetMC();
|
||||
- bindings.LLVMInitializeLanaiAsmPrinter();
|
||||
- bindings.LLVMInitializeLanaiAsmParser();
|
||||
- },
|
||||
- .mips, .mipsel, .mips64, .mips64el => {
|
||||
- bindings.LLVMInitializeMipsTarget();
|
||||
- bindings.LLVMInitializeMipsTargetInfo();
|
||||
- bindings.LLVMInitializeMipsTargetMC();
|
||||
- bindings.LLVMInitializeMipsAsmPrinter();
|
||||
- bindings.LLVMInitializeMipsAsmParser();
|
||||
- },
|
||||
- .msp430 => {
|
||||
- bindings.LLVMInitializeMSP430Target();
|
||||
- bindings.LLVMInitializeMSP430TargetInfo();
|
||||
- bindings.LLVMInitializeMSP430TargetMC();
|
||||
- bindings.LLVMInitializeMSP430AsmPrinter();
|
||||
- bindings.LLVMInitializeMSP430AsmParser();
|
||||
- },
|
||||
.nvptx, .nvptx64 => {
|
||||
bindings.LLVMInitializeNVPTXTarget();
|
||||
bindings.LLVMInitializeNVPTXTargetInfo();
|
||||
@@ -4806,13 +4764,6 @@ pub fn initializeLLVMTarget(arch: std.Target.Cpu.Arch) void {
|
||||
bindings.LLVMInitializeRISCVAsmPrinter();
|
||||
bindings.LLVMInitializeRISCVAsmParser();
|
||||
},
|
||||
- .sparc, .sparc64 => {
|
||||
- bindings.LLVMInitializeSparcTarget();
|
||||
- bindings.LLVMInitializeSparcTargetInfo();
|
||||
- bindings.LLVMInitializeSparcTargetMC();
|
||||
- bindings.LLVMInitializeSparcAsmPrinter();
|
||||
- bindings.LLVMInitializeSparcAsmParser();
|
||||
- },
|
||||
.s390x => {
|
||||
bindings.LLVMInitializeSystemZTarget();
|
||||
bindings.LLVMInitializeSystemZTargetInfo();
|
||||
@@ -4843,13 +4794,6 @@ pub fn initializeLLVMTarget(arch: std.Target.Cpu.Arch) void {
|
||||
bindings.LLVMInitializeXtensaAsmParser();
|
||||
}
|
||||
},
|
||||
- .xcore => {
|
||||
- bindings.LLVMInitializeXCoreTarget();
|
||||
- bindings.LLVMInitializeXCoreTargetInfo();
|
||||
- bindings.LLVMInitializeXCoreTargetMC();
|
||||
- bindings.LLVMInitializeXCoreAsmPrinter();
|
||||
- // There is no LLVMInitializeXCoreAsmParser function.
|
||||
- },
|
||||
.m68k => {
|
||||
if (build_options.llvm_has_m68k) {
|
||||
bindings.LLVMInitializeM68kTarget();
|
||||
@@ -4868,13 +4812,6 @@ pub fn initializeLLVMTarget(arch: std.Target.Cpu.Arch) void {
|
||||
bindings.LLVMInitializeCSKYAsmParser();
|
||||
}
|
||||
},
|
||||
- .ve => {
|
||||
- bindings.LLVMInitializeVETarget();
|
||||
- bindings.LLVMInitializeVETargetInfo();
|
||||
- bindings.LLVMInitializeVETargetMC();
|
||||
- bindings.LLVMInitializeVEAsmPrinter();
|
||||
- bindings.LLVMInitializeVEAsmParser();
|
||||
- },
|
||||
.arc => {
|
||||
if (build_options.llvm_has_arc) {
|
||||
bindings.LLVMInitializeARCTarget();
|
||||
@@ -4884,21 +4821,29 @@ pub fn initializeLLVMTarget(arch: std.Target.Cpu.Arch) void {
|
||||
// There is no LLVMInitializeARCAsmParser function.
|
||||
}
|
||||
},
|
||||
- .loongarch32, .loongarch64 => {
|
||||
- bindings.LLVMInitializeLoongArchTarget();
|
||||
- bindings.LLVMInitializeLoongArchTargetInfo();
|
||||
- bindings.LLVMInitializeLoongArchTargetMC();
|
||||
- bindings.LLVMInitializeLoongArchAsmPrinter();
|
||||
- bindings.LLVMInitializeLoongArchAsmParser();
|
||||
- },
|
||||
+
|
||||
+ // Disabled LLVM targets
|
||||
+ .thumb,
|
||||
+ .thumbeb,
|
||||
+ .arm,
|
||||
+ .armeb,
|
||||
+ .avr,
|
||||
+ .hexagon,
|
||||
+ .lanai,
|
||||
+ .mips,
|
||||
+ .mipsel,
|
||||
+ .mips64,
|
||||
+ .mips64el,
|
||||
+ .msp430,
|
||||
+ .sparc,
|
||||
+ .sparc64,
|
||||
+ .xcore,
|
||||
+ .ve,
|
||||
+ .loongarch32,
|
||||
+ .loongarch64,
|
||||
.spirv32,
|
||||
.spirv64,
|
||||
- => {
|
||||
- bindings.LLVMInitializeSPIRVTarget();
|
||||
- bindings.LLVMInitializeSPIRVTargetInfo();
|
||||
- bindings.LLVMInitializeSPIRVTargetMC();
|
||||
- bindings.LLVMInitializeSPIRVAsmPrinter();
|
||||
- },
|
||||
+ => unreachable,
|
||||
|
||||
// LLVM does does not have a backend for these.
|
||||
.alpha,
|
||||
diff --git a/src/target.zig b/src/target.zig
|
||||
index 3d04c06f5e..9e19836815 100644
|
||||
--- a/src/target.zig
|
||||
+++ b/src/target.zig
|
||||
@@ -185,23 +185,12 @@ pub fn hasLlvmSupport(target: *const std.Target, ofmt: std.Target.ObjectFormat)
|
||||
}
|
||||
|
||||
return switch (target.cpu.arch) {
|
||||
- .arm,
|
||||
- .armeb,
|
||||
.aarch64,
|
||||
.aarch64_be,
|
||||
.arc,
|
||||
- .avr,
|
||||
.bpfel,
|
||||
.bpfeb,
|
||||
- .hexagon,
|
||||
- .loongarch32,
|
||||
- .loongarch64,
|
||||
.m68k,
|
||||
- .mips,
|
||||
- .mipsel,
|
||||
- .mips64,
|
||||
- .mips64el,
|
||||
- .msp430,
|
||||
.powerpc,
|
||||
.powerpcle,
|
||||
.powerpc64,
|
||||
@@ -211,24 +200,38 @@ pub fn hasLlvmSupport(target: *const std.Target, ofmt: std.Target.ObjectFormat)
|
||||
.riscv32be,
|
||||
.riscv64,
|
||||
.riscv64be,
|
||||
- .sparc,
|
||||
- .sparc64,
|
||||
- .spirv32,
|
||||
- .spirv64,
|
||||
.s390x,
|
||||
- .thumb,
|
||||
- .thumbeb,
|
||||
.x86,
|
||||
.x86_64,
|
||||
- .xcore,
|
||||
.nvptx,
|
||||
.nvptx64,
|
||||
- .lanai,
|
||||
.wasm32,
|
||||
.wasm64,
|
||||
- .ve,
|
||||
=> true,
|
||||
|
||||
+ // Disabled LLVM targets
|
||||
+ .thumb,
|
||||
+ .thumbeb,
|
||||
+ .arm,
|
||||
+ .armeb,
|
||||
+ .avr,
|
||||
+ .hexagon,
|
||||
+ .lanai,
|
||||
+ .mips,
|
||||
+ .mipsel,
|
||||
+ .mips64,
|
||||
+ .mips64el,
|
||||
+ .msp430,
|
||||
+ .sparc,
|
||||
+ .sparc64,
|
||||
+ .xcore,
|
||||
+ .ve,
|
||||
+ .loongarch32,
|
||||
+ .loongarch64,
|
||||
+ .spirv32,
|
||||
+ .spirv64,
|
||||
+ => false,
|
||||
+
|
||||
// LLVM backend exists but can produce neither assembly nor object files.
|
||||
.csky,
|
||||
.xtensa,
|
||||
--
|
||||
2.53.0
|
||||
|
||||
61
0003-fetch-prevent-global-cache-from-being-copied.patch
Normal file
61
0003-fetch-prevent-global-cache-from-being-copied.patch
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jan200101 <sentrycraft123@gmail.com>
|
||||
Date: Sun, 12 May 2024 18:20:19 +0200
|
||||
Subject: [PATCH] fetch: prevent global cache from being copied
|
||||
|
||||
Signed-off-by: Jan200101 <sentrycraft123@gmail.com>
|
||||
---
|
||||
src/Package/Fetch.zig | 33 +++++++++++++++++++++------------
|
||||
1 file changed, 21 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/src/Package/Fetch.zig b/src/Package/Fetch.zig
|
||||
index f45a5cc93e..f21409ae76 100644
|
||||
--- a/src/Package/Fetch.zig
|
||||
+++ b/src/Package/Fetch.zig
|
||||
@@ -1343,6 +1343,7 @@ fn unpackGitPack(f: *Fetch, out_dir: fs.Dir, resource: *Resource) anyerror!Unpac
|
||||
|
||||
fn recursiveDirectoryCopy(f: *Fetch, dir: fs.Dir, tmp_dir: fs.Dir) anyerror!void {
|
||||
const gpa = f.arena.child_allocator;
|
||||
+ const cache_root = f.job_queue.global_cache;
|
||||
// Recursive directory copy.
|
||||
var it = try dir.walk(gpa);
|
||||
defer it.deinit();
|
||||
@@ -1350,18 +1351,26 @@ fn recursiveDirectoryCopy(f: *Fetch, dir: fs.Dir, tmp_dir: fs.Dir) anyerror!void
|
||||
switch (entry.kind) {
|
||||
.directory => {}, // omit empty directories
|
||||
.file => {
|
||||
- dir.copyFile(
|
||||
- entry.path,
|
||||
- tmp_dir,
|
||||
- entry.path,
|
||||
- .{},
|
||||
- ) catch |err| switch (err) {
|
||||
- error.FileNotFound => {
|
||||
- if (fs.path.dirname(entry.path)) |dirname| try tmp_dir.makePath(dirname);
|
||||
- try dir.copyFile(entry.path, tmp_dir, entry.path, .{});
|
||||
- },
|
||||
- else => |e| return e,
|
||||
- };
|
||||
+ const full_path = try dir.realpathAlloc(gpa, entry.path);
|
||||
+ defer gpa.free(full_path);
|
||||
+
|
||||
+ const cache_path = try cache_root.handle.realpathAlloc(gpa, ".");
|
||||
+ defer gpa.free(cache_path);
|
||||
+
|
||||
+ if (!std.mem.startsWith(u8, full_path, cache_path)) {
|
||||
+ dir.copyFile(
|
||||
+ entry.path,
|
||||
+ tmp_dir,
|
||||
+ entry.path,
|
||||
+ .{},
|
||||
+ ) catch |err| switch (err) {
|
||||
+ error.FileNotFound => {
|
||||
+ if (fs.path.dirname(entry.path)) |dirname| try tmp_dir.makePath(dirname);
|
||||
+ try dir.copyFile(entry.path, tmp_dir, entry.path, .{});
|
||||
+ },
|
||||
+ else => |e| return e,
|
||||
+ };
|
||||
+ }
|
||||
},
|
||||
.sym_link => {
|
||||
var buf: [fs.MAX_PATH_BYTES]u8 = undefined;
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jan200101 <sentrycraft123@gmail.com>
|
||||
Date: Sun, 26 May 2024 15:13:33 +0200
|
||||
Subject: [PATCH] cmake: correct PIE support detection, add error output for
|
||||
debugging `check_pie_supported` only uses the `OUTPUT_VARIABLE` to to signify
|
||||
errors if PIE is actually supported is signaled by
|
||||
`CMAKE_<lang>_LINK_PIE_SUPPORTED`.
|
||||
|
||||
Checking if `OUTPUT_VARIABLE` is empty is not enough either since the check
|
||||
is bypassed if its results are cached but the output variable is not cached.
|
||||
|
||||
Signed-off-by: Jan200101 <sentrycraft123@gmail.com>
|
||||
---
|
||||
CMakeLists.txt | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 06df068919..a1b8aa57a0 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -125,8 +125,8 @@ check_pie_supported(
|
||||
OUTPUT_VARIABLE ZIG_PIE_SUPPORTED_BY_CMAKE
|
||||
LANGUAGES C CXX
|
||||
)
|
||||
-if(ZIG_PIE AND NOT ZIG_PIE_SUPPORTED_BY_CMAKE)
|
||||
- message(SEND_ERROR "ZIG_PIE was requested but CMake does not support it for \"zigcpp\" target")
|
||||
+if(ZIG_PIE AND NOT CMAKE_CXX_LINK_PIE_SUPPORTED)
|
||||
+ message(SEND_ERROR "ZIG_PIE was requested but CMake does not support it for \"zigcpp\" target: ${ZIG_PIE_SUPPORTED_BY_CMAKE}")
|
||||
endif()
|
||||
|
||||
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
From a865b3569ace118cc1c1cd8d5d130ec316b0307d Mon Sep 17 00:00:00 2001
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jan200101 <sentrycraft123@gmail.com>
|
||||
Date: Tue, 14 Apr 2026 19:04:40 +0200
|
||||
Subject: [PATCH 1/2] remove native lib directories from rpath
|
||||
Date: Tue, 11 Jun 2024 13:35:37 +0200
|
||||
Subject: [PATCH] remove native lib directories from rpath
|
||||
|
||||
Signed-off-by: Jan200101 <sentrycraft123@gmail.com>
|
||||
---
|
||||
|
|
@ -9,13 +9,13 @@ Signed-off-by: Jan200101 <sentrycraft123@gmail.com>
|
|||
1 file changed, 9 insertions(+)
|
||||
|
||||
diff --git a/src/main.zig b/src/main.zig
|
||||
index 0395a21a5f..86b6d9f86b 100644
|
||||
index 21f7281d74..854dfb48cc 100644
|
||||
--- a/src/main.zig
|
||||
+++ b/src/main.zig
|
||||
@@ -4102,6 +4102,15 @@ fn createModule(
|
||||
|
||||
try create_module.lib_directories.ensureUnusedCapacity(arena, paths.lib_dirs.items.len);
|
||||
for (paths.lib_dirs.items) |path| addLibDirectoryWarn2(io, &create_module.lib_directories, path, true);
|
||||
@@ -3740,6 +3740,15 @@ fn createModule(
|
||||
try create_module.framework_dirs.appendSlice(arena, paths.framework_dirs.items);
|
||||
try create_module.lib_dirs.appendSlice(arena, paths.lib_dirs.items);
|
||||
try create_module.rpath_list.appendSlice(arena, paths.rpaths.items);
|
||||
+
|
||||
+ for (paths.lib_dirs.items) |native_lib_dir| {
|
||||
+ for (0.., create_module.rpath_list.items) |i, rpath_dir| {
|
||||
|
|
@ -28,6 +28,3 @@ index 0395a21a5f..86b6d9f86b 100644
|
|||
}
|
||||
|
||||
if (create_module.libc_paths_file) |paths_file| {
|
||||
--
|
||||
2.53.0
|
||||
|
||||
154
changelog
154
changelog
|
|
@ -1,154 +0,0 @@
|
|||
* Fri Jul 17 2026 Fedora Release Engineering <releng@fedoraproject.org> - 0.16.0-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild
|
||||
|
||||
* Wed Apr 15 2026 Jan200101 <sentrycraft123@gmail.com> - 0.16.0-1
|
||||
- Update to 0.16.0
|
||||
|
||||
* Sat Jan 17 2026 Fedora Release Engineering <releng@fedoraproject.org> - 0.15.2-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild
|
||||
|
||||
* Sun Jan 04 2026 Jan200101 <sentrycraft123@gmail.com> - 0.15.2-2
|
||||
- Rebuilt for EPEL
|
||||
|
||||
* Sun Oct 12 2025 Jan200101 <sentrycraft123@gmail.com> - 0.15.2-1
|
||||
- Update to 0.15.2
|
||||
|
||||
* 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
|
||||
47
macros.zig
47
macros.zig
|
|
@ -1,53 +1,39 @@
|
|||
%zig_arches x86_64 aarch64 riscv64 %{mips64}
|
||||
|
||||
%__zig %{_bindir}/zig
|
||||
%zig %{_bindir}/zig
|
||||
|
||||
%_zig_cache_dir %{_vpath_builddir}/zig-cache
|
||||
%_zig_package_dir %{_zig_cache_dir}/p
|
||||
%_zig_cache_dir %{builddir}/zig-cache
|
||||
|
||||
# expected features for each arch when targeting baseline
|
||||
# found in https://github.com/ziglang/zig/tree/master/lib/std/Target
|
||||
# found in https://github.com/ziglang/zig/tree/master/lib/std/target
|
||||
#
|
||||
# aarch64:
|
||||
# enable_select_opt, ete, fuse_adrp_add, fuse_aes, neon, use_postra_scheduler,
|
||||
# ete, fuse_aes, neon, perfmon, use_postra_scheduler,
|
||||
#
|
||||
# x86_64:
|
||||
# cmov, cx8, fxsr, idivq_to_divl, macrofusion, mmx, nopl, slow_3ops_lea, slow_incdec, sse2, vzeroupper, x87
|
||||
# cx8 idivq_to_divl macrofusion slow_3ops_lea slow_incdec vzeroupper x87
|
||||
#
|
||||
# riscv64:
|
||||
# a, c, d, i, m
|
||||
# a, c, d, m
|
||||
#
|
||||
# mips64:
|
||||
# mips64r2
|
||||
#
|
||||
# mips32
|
||||
%_zig_cpu baseline
|
||||
%_zig_target native
|
||||
%_zig_release_mode safe
|
||||
|
||||
# seperated build options
|
||||
%_zig_general_options --verbose --release=%{_zig_release_mode} --build-id=sha1 --summary all
|
||||
%_zig_general_options --verbose --release=%{_zig_release_mode}
|
||||
%_zig_project_options -Dtarget=%{_zig_target} -Dcpu=%{_zig_cpu}
|
||||
# 0.16.0 introduced packaging changes which install packages into this relative directory
|
||||
# Will be ovewritable in 0.17.0
|
||||
# https://codeberg.org/ziglang/zig/pulls/31950
|
||||
%_zig_system_integration --system "zig-pkg"
|
||||
%_zig_advanced_options -fallow-so-scripts --cache-dir "%{_zig_cache_dir}" --global-cache-dir "%{_zig_cache_dir}"
|
||||
%_zig_system_integration --system %{_zig_cache_dir}/p
|
||||
%_zig_advanced_options --cache-dir %{_zig_cache_dir} --global-cache-dir %{_zig_cache_dir}
|
||||
|
||||
%_zig_build_options %{?_zig_general_options} %{?_zig_project_options} %{?_zig_system_integration} %{?_zig_advanced_options} %{?zig_build_options}
|
||||
%_zig_install_options --prefix "%{_prefix}" --prefix-lib-dir "%{_libdir}" --prefix-exe-dir "%{_bindir}" --prefix-include-dir "%{_includedir}" %{?zig_install_options}
|
||||
%_zig_fetch_options --global-cache-dir %{_zig_cache_dir} %{?zig_fetch_options}
|
||||
%_zig_test_options %{?zig_test_options}
|
||||
|
||||
|
||||
%zig_prep %{shrink: \
|
||||
mkdir -p \
|
||||
%{_zig_cache_dir} \
|
||||
%{_zig_package_dir} \
|
||||
"zig-pkg" \
|
||||
}
|
||||
%_zig_build_options %{?_zig_general_options} %{?_zig_project_options} %{?_zig_system_integration} %{?_zig_advanced_options}
|
||||
%_zig_install_options --prefix "%{_prefix}" --prefix-lib-dir "%{_libdir}" --prefix-exe-dir "%{_bindir}" --prefix-include-dir "%{_includedir}"
|
||||
%_zig_fetch_options --global-cache-dir %{_zig_cache_dir}
|
||||
|
||||
%zig_build %{shrink: \
|
||||
%__zig \
|
||||
%zig \
|
||||
build \
|
||||
%{?_zig_build_options} \
|
||||
}
|
||||
|
|
@ -60,13 +46,12 @@
|
|||
}
|
||||
|
||||
%zig_fetch %{shrink: \
|
||||
%__zig \
|
||||
%zig \
|
||||
fetch \
|
||||
%{?_zig_fetch_options} \
|
||||
}
|
||||
|
||||
%zig_test %{shrink: \
|
||||
%zig_build \
|
||||
test \
|
||||
%{?%_zig_test_options} \
|
||||
test
|
||||
}
|
||||
|
|
|
|||
4
sources
4
sources
|
|
@ -1,2 +1,2 @@
|
|||
SHA512 (zig-0.16.0.tar.xz) = 1404a939c6f233d5f328a4833543d7a2b2d9f0f5081babe6e3ad43daed25bbb0844b28c01c900f64b5bb63ac62b5586457c05380b10494dfefb56f49b58d4a0a
|
||||
SHA512 (zig-0.16.0.tar.xz.minisig) = 44a2d57061cbe8bd4e9ad587c247883e2e9abefa148ab375617665fe51500a106f488ceaaeaf038c0ff5ce1a70f4eb3b519a44f3211769ea1ebae5ad49b2f1b9
|
||||
SHA512 (zig-0.13.0.tar.xz) = 6f5f31f4ba71a11d8b16c7a5a613e124095e503fa6b02d2b77e5b177674c739287e81d98d96dc261fed24bc836caf196f71c3fcc7a6518387df86ba9e03df4dd
|
||||
SHA512 (zig-0.13.0.tar.xz.minisig) = 21c6139c06cba6c5e23a3305fed0c0f1b9b32d9140bd686c26365ce0279d5f53cd081894eaba29f0c1ed51b2e831edf7bd4ae6a7eaee5018a252e312e9b65507
|
||||
|
|
|
|||
277
zig.spec
277
zig.spec
|
|
@ -1,119 +1,58 @@
|
|||
# architecture and toolchain
|
||||
|
||||
%if 0%{?rhel}
|
||||
# Zig depends on a C compiler (gcc) during bootstrapping.
|
||||
# Older versions of gcc fail to compile the transpiled source, so limit to x86_64.
|
||||
%global zig_arches x86_64
|
||||
%else
|
||||
# Supported architectures: https://ziglang.org/download/VERSION/release-notes.html#Support-Table
|
||||
# https://ziglang.org/download/VERSION/release-notes.html#Support-Table
|
||||
%global zig_arches x86_64 aarch64 riscv64 %{mips64}
|
||||
%endif
|
||||
|
||||
# GCC < 16.0 miscompiles on RISC-V; use Clang instead on older Fedora versions
|
||||
%ifarch riscv64
|
||||
%if 0%{?fedora} < 44
|
||||
%bcond toolchain_clang 1
|
||||
%endif
|
||||
%endif
|
||||
|
||||
%if %{with toolchain_clang}
|
||||
%global toolchain clang
|
||||
%endif
|
||||
|
||||
# minisign public key for source verification (from https://ziglang.org/download/)
|
||||
# Signing key from https://ziglang.org/download/
|
||||
%global public_key RWSGOq2NVecA2UPNdBUZykf1CCb147pkmdtYxgb3Ti+JO/wCYvhbAb/U
|
||||
|
||||
|
||||
# dependency versions and cache
|
||||
|
||||
# Compatible LLVM/Clang version definitions
|
||||
%if 0%{?fedora} >= 44 || 0%{?rhel} >= 11
|
||||
%global llvm_compat 21
|
||||
# note here at which Fedora or EL release we need to use compat LLVM packages
|
||||
%if 0%{?fedora} >= 41 || 0%{?rhel} >= 9
|
||||
%define llvm_compat 18
|
||||
%endif
|
||||
%global llvm_version 21.1.8
|
||||
|
||||
%global zig_cache_dir %{_vpath_builddir}/zig-cache
|
||||
|
||||
|
||||
# build conditionals
|
||||
%global llvm_version 18.0.0
|
||||
|
||||
%bcond bootstrap 0
|
||||
%bcond docs %{without bootstrap}
|
||||
%bcond macro %{without bootstrap}
|
||||
%bcond test 1
|
||||
|
||||
|
||||
# build and install options
|
||||
|
||||
%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="%{?dev_version}%{!?dev_version:%{version}}" \
|
||||
-Dstatic-llvm=false \
|
||||
-Denable-llvm=true \
|
||||
-Dno-langref=true \
|
||||
-Dstd-docs=false \
|
||||
-Dpie \
|
||||
-Dconfig_h="%{__cmake_builddir}/config.h" \
|
||||
}
|
||||
|
||||
%global zig_install_options %{shrink: \
|
||||
%zig_build_options \
|
||||
--prefix "%{_prefix}" \
|
||||
}
|
||||
|
||||
Name: zig
|
||||
Version: 0.16.0
|
||||
Release: %autorelease
|
||||
Version: 0.13.0
|
||||
Release: 4%{?dist}
|
||||
Summary: Programming language for maintaining robust, optimal, and reusable software
|
||||
|
||||
# The minisign file references a specific archive name so we store for ease of use
|
||||
%global archive_name %{name}-%{version}.tar.xz
|
||||
|
||||
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.1
|
||||
URL: https://ziglang.org
|
||||
Source0: %{url}/download/%{version}/%{archive_name}
|
||||
Source1: %{url}/download/%{version}/%{archive_name}.minisig
|
||||
Source0: %{url}/download/%{version}/%{name}-%{version}.tar.xz
|
||||
Source1: %{url}/download/%{version}/%{name}-%{version}.tar.xz.minisig
|
||||
Source2: macros.%{name}
|
||||
# Support clean build of stage3 with temporary bootstrapped package
|
||||
Patch: 0001-Fedora-bootstrap-and-extra-build-flags-support.patch
|
||||
# There's no global option for build-id so enable it by default
|
||||
# instead of patching every project's build.zig
|
||||
Patch: 0002-Enable-build-id-by-default.patch
|
||||
# Zig fetch will recurse onto the cache directory, prevent that from happening.
|
||||
# https://github.com/ziglang/zig/pull/19951
|
||||
Patch: 0003-fetch-prevent-global-cache-from-being-copied.patch
|
||||
# Fix broken PIE capability detection
|
||||
# https://github.com/ziglang/zig/pull/20072
|
||||
Patch: 0004-cmake-correct-PIE-support-detection-add-error-output.patch
|
||||
# Remove native libr directories from rpath
|
||||
Patch: 0005-remove-native-lib-directories-from-rpath.patch
|
||||
|
||||
# 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 NixOS
|
||||
Patch0: 0001-remove-native-lib-directories-from-rpath.patch
|
||||
|
||||
# LLVM on RHEL/EPEL only provides fewer targets so we patch the required targets down
|
||||
# Targets come from https://src.fedoraproject.org/rpms/llvm/blob/rawhide/f/llvm.spec
|
||||
Patch1: 0002-Remove-unsupported-LLVM-targets-for-EPEL.patch
|
||||
|
||||
%if %{without toolchain_clang}
|
||||
BuildRequires: gcc
|
||||
BuildRequires: gcc-c++
|
||||
%else
|
||||
BuildRequires: clang
|
||||
%endif
|
||||
BuildRequires: cmake
|
||||
BuildRequires: llvm%{?llvm_compat}-devel
|
||||
BuildRequires: clang%{?llvm_compat}-devel
|
||||
BuildRequires: lld%{?llvm_compat}-devel
|
||||
BuildRequires: zlib-devel
|
||||
BuildRequires: libxml2-devel
|
||||
# for man page generation
|
||||
BuildRequires: help2man
|
||||
# for signature verification
|
||||
BuildRequires: minisign
|
||||
|
||||
%if %{without bootstrap}
|
||||
BuildRequires: (zig >= 0.16 with zig < 0.17)
|
||||
BuildRequires: %{name} = %{version}
|
||||
%endif
|
||||
|
||||
%if %{with test}
|
||||
|
|
@ -129,7 +68,7 @@ Requires: %{name}-libs = %{version}
|
|||
# Apache-2.0 WITH LLVM-exception OR NCSA OR MIT
|
||||
Provides: 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-only
|
||||
Provides: bundled(glibc) = 2.43
|
||||
Provides: bundled(glibc) = 2.38
|
||||
# Apache-2.0 WITH LLVM-exception OR MIT OR NCSA
|
||||
Provides: bundled(libcxx) = %{llvm_version}
|
||||
# Apache-2.0 WITH LLVM-exception OR MIT OR NCSA
|
||||
|
|
@ -137,11 +76,11 @@ Provides: bundled(libcxxabi) = %{llvm_version}
|
|||
# NCSA
|
||||
Provides: bundled(libunwind) = %{llvm_version}
|
||||
# BSD, LGPG, ZPL
|
||||
Provides: bundled(mingw) = 3839e21b08807479a31d5a9764666f82ae2f0356
|
||||
Provides: bundled(mingw) = 0bac2d3cdb122dadcdee90009f7e24a69d56939f
|
||||
# MIT
|
||||
Provides: bundled(musl) = 1.2.5
|
||||
Provides: bundled(musl) = 1.2.4
|
||||
# Apache-2.0 WITH LLVM-exception AND Apache-2.0 AND MIT AND BSD-2-Clause
|
||||
Provides: bundled(wasi-libc) = d03829489904d38c624f6de9983190f1e5e7c9c5
|
||||
Provides: bundled(wasi-libc) = 3189cd1ceec8771e8f27faab58ad05d4d6c369ef
|
||||
|
||||
ExclusiveArch: %{zig_arches}
|
||||
|
||||
|
|
@ -178,71 +117,49 @@ This package contains common RPM macros for %{name}.
|
|||
%endif
|
||||
|
||||
%prep
|
||||
minisign -V -m %{SOURCE0} -x %{SOURCE1} -P %{public_key} -Q | grep -F "file:%{archive_name}"
|
||||
|
||||
%autosetup -N
|
||||
%patch 0 -p1
|
||||
%if 0%{?rhel}
|
||||
%patch 1 -p1
|
||||
%endif
|
||||
/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 used
|
||||
rm -f stage1/zig1.wasm
|
||||
%endif
|
||||
|
||||
%build
|
||||
|
||||
# Fedora supports using ccache systemwide
|
||||
# Zig generates a large C file for bootstrapping which does not
|
||||
# behave well with ccache so we explicitly disable it.
|
||||
export CCACHE_DISABLE=1
|
||||
|
||||
# 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
|
||||
# EXTRA_BUILD_ARGS: apply --build-id=sha1 even if running unpatched stage2 compiler.
|
||||
%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_EXTRA_BUILD_ARGS:STRING="--verbose;-Dbuild-id=sha1" \
|
||||
-DZIG_SHARED_LLVM:BOOL=true \
|
||||
-DZIG_PIE:BOOL=true \
|
||||
\
|
||||
-DZIG_TARGET_MCPU:STRING=baseline \
|
||||
-DZIG_TARGET_TRIPLE:STRING=native \
|
||||
\
|
||||
-DZIG_VERSION:STRING="%{?dev_version}%{!?dev_version:%{version}}"
|
||||
|
||||
%if %{with bootstrap}
|
||||
-DZIG_VERSION:STRING="%{version}" \
|
||||
%{!?with_bootstrap:-DZIG_EXECUTABLE:STRING="/usr/bin/zig"}
|
||||
# Build only stage3 and dependencies. Skips stage1/2 if using /usr/bin/zig
|
||||
%cmake_build --target stage3
|
||||
%else
|
||||
%cmake_build --target zigcpp
|
||||
zig build %{zig_build_options}
|
||||
|
||||
# Zig has no official manpage
|
||||
# https://github.com/ziglang/zig/issues/715
|
||||
help2man --no-discard-stderr --no-info "./zig-out/bin/zig" --version-option=version --output=zig.1
|
||||
%endif
|
||||
|
||||
help2man --no-discard-stderr --no-info "%{__cmake_builddir}/stage3/bin/zig" --version-option=version --output=%{name}.1
|
||||
|
||||
%if %{with docs}
|
||||
# Use the newly made stage 3 compiler to generate docs
|
||||
./zig-out/bin/zig build docs %{zig_build_options}
|
||||
"%{__cmake_builddir}/stage3/bin/zig" build docs \
|
||||
--verbose \
|
||||
--global-cache-dir zig-cache \
|
||||
-Dversion-string="%{version}"
|
||||
%endif
|
||||
|
||||
%install
|
||||
%if %{with bootstrap}
|
||||
%cmake_install
|
||||
%else
|
||||
DESTDIR="%{buildroot}" zig build install %{zig_install_options}
|
||||
|
||||
install -D -pv -m 0644 -t %{buildroot}%{_mandir}/man1/ zig.1
|
||||
%endif
|
||||
|
||||
install -D -pv -m 0644 -t %{buildroot}%{_mandir}/man1/ %{name}.1
|
||||
|
||||
%if %{with macro}
|
||||
install -D -pv -m 0644 %{SOURCE2} %{buildroot}%{_rpmmacrodir}/macros.%{name}
|
||||
|
|
@ -251,15 +168,13 @@ install -D -pv -m 0644 %{SOURCE2} %{buildroot}%{_rpmmacrodir}/macros.%{name}
|
|||
%if %{with test}
|
||||
%check
|
||||
# Run reduced set of tests, based on the Zig CI
|
||||
"%{buildroot}%{_bindir}/zig" test test/behavior.zig -Itest
|
||||
"%{__cmake_builddir}/stage3/bin/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}
|
||||
|
|
@ -277,4 +192,110 @@ install -D -pv -m 0644 %{SOURCE2} %{buildroot}%{_rpmmacrodir}/macros.%{name}
|
|||
%endif
|
||||
|
||||
%changelog
|
||||
%autochangelog
|
||||
* 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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue