Compare commits
44 Commits
| Author | SHA256 | Date | |
|---|---|---|---|
| bce7ac7703 | |||
| b97859a14d | |||
| f21863840d | |||
|
|
3bb312a363 | ||
| 926d389228 | |||
|
|
48e6b0ee09 | ||
| 66658d58a3 | |||
| 15815f1459 | |||
| 313ccb8634 | |||
|
|
50dc71abe9 | ||
| 47d984f034 | |||
|
|
15a6207e77 | ||
|
|
0e97ce964c | ||
|
|
d7f3e5387e | ||
|
|
916a8dfa48 | ||
|
|
3e800f8ae2 | ||
|
|
c87a233603 | ||
|
|
492cfa8a9d | ||
|
|
93a60323ca | ||
|
|
bf7918c042 | ||
|
|
3c0c285f5e | ||
|
|
9188254726 | ||
|
|
e39573411b | ||
|
|
bf208962e0 | ||
|
|
e5512844f1 | ||
|
|
aca4ce3fe6 | ||
|
|
7f741f0567 | ||
|
|
f1ca18b3cd | ||
|
|
7bd1d451f7 | ||
|
|
56c37b6d1e | ||
|
|
e256911be3 | ||
|
|
af76719f06 | ||
|
|
cde208fffa | ||
|
|
80bb2641d0 | ||
|
|
9cb6508e6b | ||
|
|
e51deb7f8a | ||
|
|
d8d47ce95e | ||
|
|
eb8010870f | ||
|
|
2eafc87a19 | ||
| e13dfb3c9f | |||
|
|
1af365e1e3 | ||
|
|
9e5d0a8a54 | ||
|
|
86abd88865 | ||
|
|
fb33ce16b6 |
@@ -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}
|
||||
)
|
||||
@@ -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, "");
|
||||
@@ -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
2
README
Normal file
@@ -0,0 +1,2 @@
|
||||
This is a package that depends on the current latest zig for the distribution
|
||||
|
||||
66
_constraints
66
_constraints
@@ -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>
|
||||
43
macros.zig
43
macros.zig
@@ -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
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:a6744ef84b6716f976dad923075b2f54dc4f785f200ae6c8ea07997bd9d9bd9a
|
||||
size 17099152
|
||||
@@ -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")
|
||||
86
zig.changes
86
zig.changes
@@ -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.
|
||||
|
||||
94
zig.spec
94
zig.spec
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user