44 Commits

Author SHA256 Message Date
bce7ac7703 Accepting request 1328022 from devel:languages:zig
- no longer hard enforce the latest version. Require any version
  but recommend the latest
- No longer obsolete older packages in case we need older versions working
- Initial package for zig stub package. This package will point to latest zig version.

OBS-URL: https://build.opensuse.org/request/show/1328022
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/zig?expand=0&rev=11
2026-01-19 17:37:56 +00:00
b97859a14d Accepting request 1314099 from devel:tools:compiler
- Add RPM 4.20 declarative build system macros

These allow reducing most spec file boilerplate to a simple BuildSystem: zig (forwarded request 1313383 from mia)

OBS-URL: https://build.opensuse.org/request/show/1314099
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/zig?expand=0&rev=10
2025-10-29 20:05:40 +00:00
f21863840d - Add RPM 4.20 declarative build system macros
These allow reducing most spec file boilerplate to a simple BuildSystem: zig

OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/zig?expand=0&rev=62
2025-10-28 14:39:50 +00:00
Soc Virnyl Estela
3bb312a363 I removed all the obsoletes from the packages and now I want to switch the zig main package to the same solution as ruby does.
thoughts?

Those implementation provides arent in the zigX.Y packages yet

- no longer hard enforce the latest version. Require any version
  but recommend the latest

Thos

OBS-URL: https://build.opensuse.org/package/show/devel:languages:zig/zig?expand=0&rev=3
2025-10-19 11:27:02 +00:00
926d389228 no longer obsolete
OBS-URL: https://build.opensuse.org/package/show/devel:languages:zig/zig?expand=0&rev=2
2025-10-19 00:51:55 +00:00
Soc Virnyl Estela
48e6b0ee09 Stub package that points to latest zig version.
OBS-URL: https://build.opensuse.org/package/show/devel:languages:zig/zig?expand=0&rev=1
2025-09-20 14:36:52 +00:00
66658d58a3 Accepting request 1305271 from devel:tools:compiler
- Remove unused build requires (forwarded request 1305214 from Andreas_Schwab)

OBS-URL: https://build.opensuse.org/request/show/1305271
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/zig?expand=0&rev=9
2025-09-17 14:44:03 +00:00
15815f1459 - Remove unused build requires
OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/zig?expand=0&rev=60
2025-09-17 01:05:45 +00:00
313ccb8634 Accepting request 1302085 from devel:tools:compiler
OBS-URL: https://build.opensuse.org/request/show/1302085
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/zig?expand=0&rev=8
2025-09-01 15:18:01 +00:00
Soc Virnyl Estela
50dc71abe9 Accepting request 1301851 from home:uncomfyhalomacro:branches:devel:tools:compiler
- Update to version 0.15.1:
  ** CHANGELOG TOO LONG **
  See https://ziglang.org/download/0.15.1/release-notes.html

OBS-URL: https://build.opensuse.org/request/show/1301851
OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/zig?expand=0&rev=58
2025-08-31 11:37:18 +00:00
47d984f034 Accepting request 1241564 from home:bmwiedemann:branches:devel:tools:compiler
- Add reproducible.patch to fix reproducible-builds issues (boo#1100677)
  https://github.com/ziglang/zig/issues/22663

This fixes river, stacktile, waylock, wayprompt and zls

only zig itself has some variations from ASLR left. Will debug later...

OBS-URL: https://build.opensuse.org/request/show/1241564
OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/zig?expand=0&rev=57
2025-02-10 10:30:00 +00:00
Soc Virnyl Estela
15a6207e77 OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/zig?expand=0&rev=56 2024-06-24 05:54:49 +00:00
Soc Virnyl Estela
0e97ce964c OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/zig?expand=0&rev=55 2024-06-24 04:46:17 +00:00
Soc Virnyl Estela
d7f3e5387e OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/zig?expand=0&rev=54 2024-06-24 00:06:27 +00:00
Soc Virnyl Estela
916a8dfa48 OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/zig?expand=0&rev=53 2024-06-23 13:15:18 +00:00
Soc Virnyl Estela
3e800f8ae2 OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/zig?expand=0&rev=52 2024-06-23 08:42:37 +00:00
Soc Virnyl Estela
c87a233603 OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/zig?expand=0&rev=51 2024-06-23 08:36:36 +00:00
Soc Virnyl Estela
492cfa8a9d OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/zig?expand=0&rev=50 2024-06-23 06:04:49 +00:00
Soc Virnyl Estela
93a60323ca OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/zig?expand=0&rev=49 2024-06-23 03:58:08 +00:00
Soc Virnyl Estela
bf7918c042 OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/zig?expand=0&rev=48 2024-06-23 03:08:46 +00:00
Soc Virnyl Estela
3c0c285f5e - Add *debuginfo variants of build requirements for tests
OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/zig?expand=0&rev=47
2024-06-23 03:05:02 +00:00
Soc Virnyl Estela
9188254726 OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/zig?expand=0&rev=46 2024-06-23 02:21:44 +00:00
Soc Virnyl Estela
e39573411b - Workaround for test
* add vendored cache dependencies.

OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/zig?expand=0&rev=45
2024-06-23 01:32:00 +00:00
Soc Virnyl Estela
bf208962e0 OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/zig?expand=0&rev=44 2024-06-23 00:47:24 +00:00
Soc Virnyl Estela
e5512844f1 OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/zig?expand=0&rev=43 2024-06-23 00:41:59 +00:00
Soc Virnyl Estela
aca4ce3fe6 - Fix check section for tests
OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/zig?expand=0&rev=42
2024-06-23 00:18:33 +00:00
Soc Virnyl Estela
7f741f0567 - Add -DZIG_USE_LLVM_CONFIG=ON option
OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/zig?expand=0&rev=41
2024-06-22 09:14:10 +00:00
Soc Virnyl Estela
f1ca18b3cd - Add elfutils and libelf-devel for test suites
OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/zig?expand=0&rev=40
2024-06-22 07:42:01 +00:00
Soc Virnyl Estela
7bd1d451f7 - Add patch skip-localhost-test.patch
OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/zig?expand=0&rev=39
2024-06-22 05:25:43 +00:00
Soc Virnyl Estela
56c37b6d1e OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/zig?expand=0&rev=38 2024-06-22 03:46:45 +00:00
Soc Virnyl Estela
e256911be3 OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/zig?expand=0&rev=37 2024-06-22 03:15:54 +00:00
Soc Virnyl Estela
af76719f06 OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/zig?expand=0&rev=36 2024-06-22 01:25:27 +00:00
Soc Virnyl Estela
cde208fffa - Add liburing-devel for test suites
OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/zig?expand=0&rev=35
2024-06-22 01:21:59 +00:00
Soc Virnyl Estela
80bb2641d0 OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/zig?expand=0&rev=34 2024-06-22 01:19:28 +00:00
Soc Virnyl Estela
9cb6508e6b OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/zig?expand=0&rev=33 2024-06-22 01:12:15 +00:00
Soc Virnyl Estela
e51deb7f8a OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/zig?expand=0&rev=32 2024-06-22 00:26:43 +00:00
Soc Virnyl Estela
d8d47ce95e OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/zig?expand=0&rev=31 2024-06-22 00:17:59 +00:00
Soc Virnyl Estela
eb8010870f - Set mold as linker. Efficient and fast at utilising computer resources
unlike GNU ld.
- Enable tests
- Specfile cleanup
  * remove some outdated comments

OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/zig?expand=0&rev=30
2024-06-22 00:11:57 +00:00
Soc Virnyl Estela
2eafc87a19 Accepting request 1180180 from home:Andreas_Schwab:Factory
- Reduce constraints

OBS-URL: https://build.opensuse.org/request/show/1180180
OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/zig?expand=0&rev=29
2024-06-13 11:50:22 +00:00
e13dfb3c9f Accepting request 1179408 from devel:tools:compiler
- Update patchsets for llvm18 changes
  ./0000-remove-lld-in-cmakelist.patch
  ./0001-invoke-lld.patch
- Update to version 0.13.0:
  ** CHANGELOG TOO LONG **
  See https://ziglang.org/download/0.12.0/release-notes.html
  * Release focuses more on the LLVM18 support

OBS-URL: https://build.opensuse.org/request/show/1179408
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/zig?expand=0&rev=7
2024-06-09 18:22:22 +00:00
Soc Virnyl Estela
1af365e1e3 ./0001-invoke-lld.patch
OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/zig?expand=0&rev=27
2024-06-07 18:27:34 +00:00
Soc Virnyl Estela
9e5d0a8a54 OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/zig?expand=0&rev=26 2024-06-07 18:08:12 +00:00
Soc Virnyl Estela
86abd88865 - Update patchsets for llvm18 changes
./0000-remove-lld-in-cmakelist.patch

OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/zig?expand=0&rev=25
2024-06-07 17:57:56 +00:00
Soc Virnyl Estela
fb33ce16b6 - Update to version 0.13.0:
** CHANGELOG TOO LONG **
  See https://ziglang.org/download/0.12.0/release-notes.html
  * Release focuses more on the LLVM18 support

OBS-URL: https://build.opensuse.org/package/show/devel:tools:compiler/zig?expand=0&rev=24
2024-06-07 17:36:53 +00:00
10 changed files with 27 additions and 505 deletions

View File

@@ -1,32 +0,0 @@
We invoke LLD so we also commented/remove it out as well.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 92be8fb..e19d18e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -136,7 +136,7 @@
find_package(llvm 17)
find_package(clang 17)
-find_package(lld 17)
+# find_package(lld 17)
if(ZIG_STATIC_ZLIB)
if (MSVC)
@@ -183,7 +183,7 @@
endforeach(CONFIG_TYPE CMAKE_CONFIGURATION_TYPES)
include_directories(${LLVM_INCLUDE_DIRS})
-include_directories(${LLD_INCLUDE_DIRS})
+# include_directories(${LLD_INCLUDE_DIRS})
include_directories(${CLANG_INCLUDE_DIRS})
find_package(Threads)
@@ -707,7 +707,7 @@
target_link_libraries(zigcpp LINK_PUBLIC
${CLANG_LIBRARIES}
- ${LLD_LIBRARIES}
+ # ${LLD_LIBRARIES}
${LLVM_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
)

View File

@@ -1,134 +0,0 @@
Based on Aaron Puchert's <aaronpuchert@alice-dsl.net> patch.
diff --git a/src/zig_llvm.cpp b/src/zig_llvm.cpp
index ae1f0242..c0010c77 100644
--- a/src/zig_llvm.cpp
+++ b/src/zig_llvm.cpp
@@ -60,15 +60,18 @@
#include <llvm/Transforms/Utils/CanonicalizeAliases.h>
#include <llvm/Transforms/Utils/NameAnonGlobals.h>
-#include <lld/Common/Driver.h>
-
#if __GNUC__ >= 9
#pragma GCC diagnostic pop
#endif
#include <new>
+#include <poll.h>
#include <stdlib.h>
+#include <spawn.h>
+#include <sys/wait.h>
+#include <unistd.h>
+
using namespace llvm;
@@ -78,6 +81,85 @@ static const bool assertions_on = true;
static const bool assertions_on = false;
#endif
+namespace {
+ class Pipe {
+ public:
+ Pipe(llvm::raw_ostream *output) : output(output) {}
+ ~Pipe() {
+ if (fd[0] != -1) close(fd[0]);
+ if (fd[1] != -1) close(fd[1]);
+ }
+ bool open() { return pipe(fd) == 0; }
+ int getRead() const { return fd[0]; }
+ int getWrite() const { return fd[1]; }
+ void closeWrite() { close(fd[1]); fd[1] = -1; }
+ void flush() const {
+ constexpr size_t size = 1024;
+ char buf[size];
+ ssize_t ret;
+ do {
+ ret = read(getRead(), buf, size);
+ if (ret > 0 && output)
+ output->write(buf, ret);
+ } while (ret == size || (ret == -1 && errno == EINTR));
+ }
+ private:
+ int fd[2] = {-1, -1};
+ llvm::raw_ostream *output;
+ };
+} // anonymous namespace
+
+static bool InvokeLld(const char *variant, llvm::ArrayRef<const char *> args,
+ llvm::raw_ostream &stdoutOS,
+ llvm::raw_ostream &stderrOS, bool disableOutput)
+{
+ Pipe outPipe(disableOutput ? nullptr : &stdoutOS),
+ errPipe(disableOutput ? nullptr : &stderrOS);
+ if (!outPipe.open())
+ return false;
+ if (!errPipe.open())
+ return false;
+
+ posix_spawn_file_actions_t actions;
+ posix_spawn_file_actions_init(&actions);
+ posix_spawn_file_actions_adddup2(&actions, outPipe.getWrite(), STDOUT_FILENO);
+ posix_spawn_file_actions_adddup2(&actions, errPipe.getWrite(), STDERR_FILENO);
+
+ // We need the command as argument, and end with nullptr.
+ SmallVector<char*, 32> arguments{const_cast<char*>(variant)};
+ for (size_t arg = 1; arg != args.size(); ++arg)
+ arguments.push_back(const_cast<char*>(args[arg]));
+ arguments.push_back(nullptr);
+
+ pid_t pid;
+ if (posix_spawnp(&pid, variant, &actions, nullptr, arguments.data(), environ) != 0)
+ return false;
+ posix_spawn_file_actions_destroy(&actions);
+ outPipe.closeWrite();
+ errPipe.closeWrite();
+
+ // Wait for child to finish and flush pipes.
+ sigset_t signals, old;
+ sigemptyset(&signals);
+ sigaddset(&signals, SIGCHLD);
+ pthread_sigmask(SIG_BLOCK, &signals, &old);
+ pollfd pollfds[2] = {{outPipe.getRead(), POLLIN}, {errPipe.getRead(), POLLIN}};
+ int wstatus;
+ do {
+ poll(pollfds, 2, -1);
+ if (pollfds[0].revents & POLLIN)
+ outPipe.flush();
+ if (pollfds[1].revents & POLLIN)
+ errPipe.flush();
+ } while (waitpid(pid, &wstatus, WNOHANG) == 0);
+ pthread_sigmask(SIG_SETMASK, &old, nullptr);
+
+ outPipe.flush();
+ errPipe.flush();
+
+ return WIFEXITED(wstatus) && WEXITSTATUS(wstatus) == 0;
+}
+
LLVMTargetMachineRef ZigLLVMCreateTargetMachine(LLVMTargetRef T, const char *Triple,
const char *CPU, const char *Features, LLVMCodeGenOptLevel Level, LLVMRelocMode Reloc,
LLVMCodeModel CodeModel, bool function_sections, bool data_sections, ZigLLVMABIType float_abi,
@@ -558,18 +640,15 @@ namespace lld {
}
bool ZigLLDLinkCOFF(int argc, const char **argv, bool can_exit_early, bool disable_output) {
- std::vector<const char *> args(argv, argv + argc);
- return lld::coff::link(args, llvm::outs(), llvm::errs(), can_exit_early, disable_output);
+ return InvokeLld("lld-link-17", llvm::ArrayRef<const char *>(argv, argc), llvm::outs(), llvm::errs(), disable_output);
}
bool ZigLLDLinkELF(int argc, const char **argv, bool can_exit_early, bool disable_output) {
- std::vector<const char *> args(argv, argv + argc);
- return lld::elf::link(args, llvm::outs(), llvm::errs(), can_exit_early, disable_output);
+ return InvokeLld("ld.lld-17", llvm::ArrayRef<const char *>(argv, argc), llvm::outs(), llvm::errs(), disable_output);
}
bool ZigLLDLinkWasm(int argc, const char **argv, bool can_exit_early, bool disable_output) {
- std::vector<const char *> args(argv, argv + argc);
- return lld::wasm::link(args, llvm::outs(), llvm::errs(), can_exit_early, disable_output);
+ return InvokeLld("wasm-ld-17", llvm::ArrayRef<const char *>(argv, argc), llvm::outs(), llvm::errs(), disable_output);
}
static_assert((Triple::ArchType)ZigLLVM_UnknownArch == Triple::UnknownArch, "");

View File

@@ -1,67 +0,0 @@
Since we patched it to invoke LLD directly, we will have
to remove any mentions of LLD here.
diff --git a/build.zig b/build.zig
index 0e43b82f..14792f48 100644
--- a/build.zig
+++ b/build.zig
@@ -689,12 +689,12 @@ fn addCmakeCfgOptionsToExe(
cfg.cmake_static_library_suffix,
}),
}) });
- assert(cfg.lld_include_dir.len != 0);
- exe.addIncludePath(.{ .cwd_relative = cfg.lld_include_dir });
+ // assert(cfg.lld_include_dir.len != 0);
+ // exe.addIncludePath(.{ .cwd_relative = cfg.lld_include_dir });
exe.addIncludePath(.{ .cwd_relative = cfg.llvm_include_dir });
exe.addLibraryPath(.{ .cwd_relative = cfg.llvm_lib_dir });
addCMakeLibraryList(exe, cfg.clang_libraries);
- addCMakeLibraryList(exe, cfg.lld_libraries);
+ // addCMakeLibraryList(exe, cfg.lld_libraries);
addCMakeLibraryList(exe, cfg.llvm_libraries);
if (use_zig_libcxx) {
@@ -862,8 +862,8 @@ const CMakeConfig = struct {
cmake_static_library_suffix: []const u8,
cxx_compiler: []const u8,
cxx_compiler_arg1: []const u8,
- lld_include_dir: []const u8,
- lld_libraries: []const u8,
+ // lld_include_dir: []const u8,
+ // lld_libraries: []const u8,
clang_libraries: []const u8,
llvm_lib_dir: []const u8,
llvm_include_dir: []const u8,
@@ -929,8 +929,8 @@ fn parseConfigH(b: *std.Build, config_h_text: []const u8) ?CMakeConfig {
.cmake_static_library_suffix = undefined,
.cxx_compiler = undefined,
.cxx_compiler_arg1 = "",
- .lld_include_dir = undefined,
- .lld_libraries = undefined,
+ // .lld_include_dir = undefined,
+ // .lld_libraries = undefined,
.clang_libraries = undefined,
.llvm_lib_dir = undefined,
.llvm_include_dir = undefined,
@@ -964,14 +964,14 @@ fn parseConfigH(b: *std.Build, config_h_text: []const u8) ?CMakeConfig {
.prefix = "#define ZIG_CXX_COMPILER_ARG1 ",
.field = "cxx_compiler_arg1",
},
- .{
- .prefix = "#define ZIG_LLD_INCLUDE_PATH ",
- .field = "lld_include_dir",
- },
- .{
- .prefix = "#define ZIG_LLD_LIBRARIES ",
- .field = "lld_libraries",
- },
+ // .{
+ // .prefix = "#define ZIG_LLD_INCLUDE_PATH ",
+ // .field = "lld_include_dir",
+ // },
+ // .{
+ // .prefix = "#define ZIG_LLD_LIBRARIES ",
+ // .field = "lld_libraries",
+ // },
.{
.prefix = "#define ZIG_CLANG_LIBRARIES ",
.field = "clang_libraries",

2
README Normal file
View File

@@ -0,0 +1,2 @@
This is a package that depends on the current latest zig for the distribution

View File

@@ -1,66 +0,0 @@
<?xml version="1.0"?>
<!--
arm, and ppc64 architectures won't build for now since llvm-config
in opensuse has no build target for those architectures.
These are just placeholders for now just in case.
-->
<constraints>
<hardware>
<jobs>6</jobs>
<physicalmemory>
<size unit="G">16</size>
</physicalmemory>
<disk>
<size unit="G">35</size>
</disk>
</hardware>
<overwrite>
<!--
We have disabled debuginfo on 32 bit architecture because they simply can no address enough memory to link llvm libraries with it.
Without debuginfo the disk and memory requirements are much lower.
-->
<conditions>
<arch>ppc</arch>
<arch>s390</arch>
<arch>riscv64</arch>
</conditions>
<hardware>
<disk>
<size unit="G">30</size>
</disk>
<physicalmemory>
<size unit="G">64</size>
</physicalmemory>
</hardware>
</overwrite>
<!--
Same as above but build workers for this arch can only support lower physical memory.
-->
<overwrite>
<conditions>
<arch>armv6l</arch>
<arch>armv7l</arch>
</conditions>
<hardware>
<disk>
<size unit="G">30</size>
</disk>
<physicalmemory>
<size unit="G">8</size>
</physicalmemory>
</hardware>
</overwrite>
<overwrite>
<conditions>
<arch>i586</arch>
</conditions>
<hardware>
<disk>
<size unit="G">30</size>
</disk>
<physicalmemory>
<size unit="G">32</size>
</physicalmemory>
</hardware>
</overwrite>
</constraints>

View File

@@ -1,43 +0,0 @@
%zig_arches x86_64 aarch64 riscv64 %{mips64}
%_zig_version @@ZIG_VERSION@@
%__zig %{_bindir}/zig
# expected features for each arch when targeting baseline
# found in https://github.com/ziglang/zig/tree/master/lib/std/target
#
# aarch64:
# ete, fuse_aes, neon, perfmon, use_postra_scheduler,
#
# x86_64:
# cx8 idivq_to_divl macrofusion slow_3ops_lea slow_incdec vzeroupper x87
#
# riscv64:
# a, c, d, m
#
# mips64:
# mips32
%_zig_cpu baseline
%_zig_target native
# seperated build options
%_zig_general_options --verbose
%_zig_project_options -Dtarget=%{_zig_target} -Dcpu=%{_zig_cpu} -Doptimize=ReleaseSafe
%_zig_advanced_options --cache-dir zig-cache
%_zig_build_options %{?_zig_general_options} %{?_zig_project_options} %{?_zig_advanced_options}
%_zig_install_options --prefix "%{_prefix}" --prefix-lib-dir "%{_libdir}" --prefix-exe-dir "%{_bindir}" --prefix-include-dir "%{_includedir}"
%zig_build %__zig \\\
build \\\
%{?_zig_build_options}
%zig_install \
DESTDIR="%{buildroot}" %zig_build \\\
install \\\
%{?_zig_install_options}
%zig_test \
%zig_build \\\
test

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a6744ef84b6716f976dad923075b2f54dc4f785f200ae6c8ea07997bd9d9bd9a
size 17099152

View File

@@ -1,5 +0,0 @@
addFilter("devel-file-in-non-devel-package")
addFilter("files-duplicate")
addFilter("name-repeated-in-summary")
addFilter("hidden-file-or-dir")
addFilter("zero-length")

View File

@@ -1,87 +1,15 @@
-------------------------------------------------------------------
Sat May 4 15:13:58 UTC 2024 - Michael Burge <michael.burge77@gmail.com>
Sun Oct 19 03:07:03 UTC 2025 - Marcus Rueckert <mrueckert@suse.de>
- Update to version 0.12.0:
** CHANGELOG TOO LONG **
See https://ziglang.org/download/0.12.0/release-notes.html
- Now requires llvm17, all patches and specfile updated accordingly
- no longer hard enforce the latest version. Require any version
but recommend the latest
-------------------------------------------------------------------
Tue Nov 7 02:58:39 UTC 2023 - Soc Virnyl Estela <uncomfy+openbuildservice@uncomfyhalomacro.pl>
Sun Oct 19 00:51:05 UTC 2025 - Marcus Rueckert <mrueckert@suse.de>
- Update macros.zig
* Change %zig to %__zig to avoid confusion between `zig` or `%zig`.
- No longer obsolete older packages in case we need older versions working
-------------------------------------------------------------------
Sat Oct 21 06:20:47 UTC 2023 - Soc Virnyl Estela <uncomfy+openbuildservice@uncomfyhalomacro.pl>
Sat Sep 20 08:51:00 UTC 2025 - Soc Virnyl Estela <uncomfyhalomacro@opensuse.org>
- Drelease-safe is now Doptimize
-------------------------------------------------------------------
Wed Oct 18 10:55:45 UTC 2023 - Soc Virnyl S. Estela <contact@uncomfyhalomacro.pl>
- Change builder to ninja. change c and c++ compiler to clang
-------------------------------------------------------------------
Thu Sep 7 11:16:24 UTC 2023 - Soc Virnyl Estela <socvirnyl.estela@gmail.com>
- Remove comment since it builds now on latest glibc.
-------------------------------------------------------------------
Fri Aug 4 06:18:37 UTC 2023 - Soc Virnyl Estela <socvirnyl.estela@gmail.com>
- Update to version 0.11.0:
** CHANGELOG TOO LONG **
See https://ziglang.org/download/0.11.0/release-notes.html
- Update patchsets:
* remove 0000-invoke-lld-llvm15.patch
* add 0000-remove-lld-in-cmakelist.patch
* add 0001-invoke-lld.patch
* update 0002-no-lld-libs-and-includes.patch
* change to llvm16
- Update specfile to use LLVM version 16.x. This will be removed in the future.
-------------------------------------------------------------------
Thu Feb 2 02:13:28 UTC 2023 - Soc Virnyl Estela <socvirnyl.estela@gmail.com>
- Enable build with riscv64 and %{mips64} arches.
-------------------------------------------------------------------
Mon Jan 30 13:41:31 UTC 2023 - Soc Virnyl Estela <socvirnyl.estela@gmail.com>
- Declare Group as "Development/Languages/Other" to remove some warnings.
-------------------------------------------------------------------
Mon Jan 30 13:12:39 UTC 2023 - Soc Virnyl Estela <socvirnyl.estela@gmail.com>
- Fix version required for LLVM on Leap.
-------------------------------------------------------------------
Wed Jan 25 03:31:57 UTC 2023 - Soc Virnyl Estela <socvirnyl.estela@gmail.com>
- Add rpm-macros to recommends.
- Simplify to just use ExclusiveArch declaration.
-------------------------------------------------------------------
Tue Jan 24 16:22:36 UTC 2023 - Soc Virnyl Estela <socvirnyl.estela@gmail.com>
- Improve specfile: from %{_rpmconfigdir}/macros.d to %{_rpmmacrodir}
-------------------------------------------------------------------
Tue Jan 24 15:45:26 UTC 2023 - Soc Virnyl Estela <socvirnyl.estela@gmail.com>
- Add zig-rpmlintrc to specfile as one of sources.
-------------------------------------------------------------------
Tue Jan 24 12:18:58 UTC 2023 - Soc Virnyl Estela <socvirnyl.estela@gmail.com>
- Increase physical memory to 64G on riscv, and aarch.
* Note: ppc architectures won't build. Placeholder for now.
- Set physical memory to 8G for arm architectures. Placeholder for now
- Set physical memory to 32G for i586 archictectures.
- ExcludeArch for ppc and arm architectures.
-------------------------------------------------------------------
Mon Jan 23 03:58:18 UTC 2023 - Soc Virnyl Estela <socvirnyl.estela@gmail.com>
- Initial spec for zig 0.10.1
- Initial package for zig stub package. This package will point to latest zig version.

View File

@@ -1,7 +1,7 @@
#
# spec file for package zig
#
# Copyright (c) 2024 SUSE LLC
# Copyright (c) 2025 SUSE LLC and contributors
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -15,48 +15,21 @@
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%global _lto_cflags %{nil}
%global __builder ninja
%global version_suffix 0.15
%global version_current 0.15.1
%bcond_without macro
%bcond_without test
Name: zig
Version: 0.12.0
Version: %{version_current}
Release: 0
Summary: Compiler for the Zig language
License: MIT
Group: Development/Languages/Other
URL: https://ziglang.org/
Source0: https://ziglang.org/download/%{version}/%{name}-%{version}.tar.xz
Source1: macros.%{name}
Source2: zig-rpmlintrc
Patch0: 0000-remove-lld-in-cmakelist.patch
Patch1: 0001-invoke-lld.patch
Patch2: 0002-no-lld-libs-and-includes.patch
BuildRequires: clang17
BuildRequires: clang17-devel
BuildRequires: cmake
BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: glibc
BuildRequires: glibc-devel
BuildRequires: help2man
BuildRequires: lld17
BuildRequires: llvm17-devel
BuildRequires: ninja
BuildRequires: zlib-devel
Requires: lld17
Source0: README
Requires: zig-implementation
Recommends: zig%{version_suffix}
# llvm-config is missing targets for ppc and arm architectures.
# ExcludeArch: ppc64 ppc64le %%arm %%ix86
ExclusiveArch: x86_64 aarch64 riscv64 %{mips64}
# Zig needs this to work
Requires: %{name}-libs = %{version}
# Zig Macros
Recommends: %{name}-rpm-macros
%description
General-purpose programming language and toolchain for maintaining robust, optimal, and reusable software.
@@ -70,66 +43,35 @@ The language imposes a low overhead to reading code and is resilient to changing
%package libs
Summary: Zig Standard Library
BuildArch: noarch
Requires: zig-libs-implementation
Recommends: zig-libs%{version_suffix}
#obsolete_zig_versioned zig-libs
%description libs
%{name} Standard Library
%{name} %{version_current} Standard Library
%if %{with macro}
%package rpm-macros
Summary: Common RPM macros for %{name}
Requires: rpm
Requires: zig-rpm-macros-implementation
Recommends: zig-rpm-macros%{version_suffix}
BuildArch: noarch
#obsolete_zig_versioned zig-rpm-macros
%description rpm-macros
This package contains common RPM macros for %{name}.
This package contains common RPM macros for %{name} version %{version_current}.
%endif
%prep
%autosetup -n %{name}-%{version} -p1
%build
# NOTE: ix86 architectures will still fail to build due to OOM. Once 0.11.x lands,
# this won't be an issue anymore since that version does not use much memory
%cmake \
%ifarch aarch64 s390x
-DCMAKE_BUILD_TYPE=Release \
%endif
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_C_COMPILER="clang-17" \
-DCMAKE_CXX_COMPILER="clang++-17" \
-DZIG_SHARED_LLVM=On \
-DZIG_TARGET_MCPU="baseline" \
-DZIG_VERSION:STRING="%{version}"
%cmake_build
%install
%cmake_install
mkdir -p %{buildroot}%{_mandir}/man1
help2man --no-discard-stderr "%{buildroot}%{_bindir}/%{name}" --version-option=version --output=%{buildroot}%{_mandir}/man1/%{name}.1
mkdir -p %{buildroot}%{_rpmconfigdir}/macros.d/
install -p -m644 %{SOURCE1} %{buildroot}%{_rpmmacrodir}
sed -i -e "s|@@ZIG_VERSION@@|%{version}|" %{buildroot}%{_rpmmacrodir}/macros.%{name}
mv -v doc/langref.html.in doc/langref.html
install -D -m 0644 %{S:0} %{buildroot}%{_datadir}/doc/packages/zig/README
%files
%license LICENSE
%{_bindir}/zig
%{_mandir}/man1/%{name}.1%{?ext_man}
%doc README.md
%doc lib/docs
%doc doc/langref.html
%files libs
%dir %{_prefix}/lib/%{name}
%{_prefix}/lib/%{name}/*
%if %{with macro}
%files rpm-macros
%{_rpmmacrodir}/macros.%{name}
%endif
%defattr(-,root,root,-)
%doc %{_datadir}/doc/packages/zig
%changelog