1 |
commit: 3e4dcebab96edb125e5089b9fd996ebdd36e23fa |
2 |
Author: Eric Joldasov <bratishkaerik <AT> getgoogleoff <DOT> me> |
3 |
AuthorDate: Fri Sep 2 10:22:36 2022 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Sep 5 01:23:50 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3e4dceba |
7 |
|
8 |
dev-lang/zig: always install self-hosted compiler, workaround upstream cmake bugs |
9 |
|
10 |
Closes: https://bugs.gentoo.org/867592 |
11 |
Signed-off-by: Eric Joldasov <bratishkaerik <AT> getgoogleoff.me> |
12 |
Closes: https://github.com/gentoo/gentoo/pull/27112 |
13 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
14 |
|
15 |
dev-lang/zig/files/zig-9999-stage2-fix.patch | 6 +++--- |
16 |
dev-lang/zig/metadata.xml | 3 --- |
17 |
dev-lang/zig/zig-9999.ebuild | 25 +++++++++---------------- |
18 |
3 files changed, 12 insertions(+), 22 deletions(-) |
19 |
|
20 |
diff --git a/dev-lang/zig/files/zig-9999-stage2-fix.patch b/dev-lang/zig/files/zig-9999-stage2-fix.patch |
21 |
index 610ab6b86623..a2fe945c4a39 100644 |
22 |
--- a/dev-lang/zig/files/zig-9999-stage2-fix.patch |
23 |
+++ b/dev-lang/zig/files/zig-9999-stage2-fix.patch |
24 |
@@ -1,12 +1,12 @@ |
25 |
diff --git a/build.zig b/build.zig |
26 |
-index ac0a161..12f7e15 100644 |
27 |
+index c8e757dc4..b698b5680 100644 |
28 |
--- a/build.zig |
29 |
+++ b/build.zig |
30 |
-@@ -562,6 +562,7 @@ fn addCmakeCfgOptionsToExe( |
31 |
+@@ -577,6 +577,7 @@ fn addCmakeCfgOptionsToExe( |
32 |
else => |e| return e, |
33 |
}; |
34 |
exe.linkSystemLibrary("unwind"); |
35 |
+ exe.linkSystemLibrary("c_nonshared"); |
36 |
} else if (exe.target.isFreeBSD()) { |
37 |
- try addCxxKnownPath(b, cfg, exe, "libc++.a", null, need_cpp_includes); |
38 |
+ try addCxxKnownPath(b, cfg, exe, b.fmt("libc++.{s}", .{lib_suffix}), null, need_cpp_includes); |
39 |
exe.linkSystemLibrary("pthread"); |
40 |
|
41 |
diff --git a/dev-lang/zig/metadata.xml b/dev-lang/zig/metadata.xml |
42 |
index c12ebabd226e..a5a5818faae7 100644 |
43 |
--- a/dev-lang/zig/metadata.xml |
44 |
+++ b/dev-lang/zig/metadata.xml |
45 |
@@ -9,9 +9,6 @@ |
46 |
<email>proxy-maint@g.o</email> |
47 |
<name>Proxy Maintainers</name> |
48 |
</maintainer> |
49 |
- <use> |
50 |
- <flag name="stage2">Install stage2 compiler (written in Zig) alongside stage1 compiler (written in C++ and Zig)</flag> |
51 |
- </use> |
52 |
<upstream> |
53 |
<remote-id type="github">ziglang/zig</remote-id> |
54 |
<bugs-to>https://github.com/ziglang/zig/issues</bugs-to> |
55 |
|
56 |
diff --git a/dev-lang/zig/zig-9999.ebuild b/dev-lang/zig/zig-9999.ebuild |
57 |
index 32a064ec02fc..1574aa37588a 100644 |
58 |
--- a/dev-lang/zig/zig-9999.ebuild |
59 |
+++ b/dev-lang/zig/zig-9999.ebuild |
60 |
@@ -18,7 +18,7 @@ fi |
61 |
|
62 |
LICENSE="MIT" |
63 |
SLOT="0" |
64 |
-IUSE="test +stage2 +threads" |
65 |
+IUSE="test +threads" |
66 |
RESTRICT="!test? ( test )" |
67 |
|
68 |
BUILD_DIR="${S}/build" |
69 |
@@ -56,34 +56,27 @@ src_configure() { |
70 |
-DZIG_USE_CCACHE=OFF |
71 |
-DZIG_SHARED_LLVM=ON |
72 |
-DZIG_SINGLE_THREADED="$(usex !threads)" |
73 |
+ -DCMAKE_PREFIX_PATH=$(get_llvm_prefix ${LLVM_MAX_SLOT}) |
74 |
+ -DCMAKE_INSTALL_PREFIX="${BUILD_DIR}/stage3" |
75 |
) |
76 |
|
77 |
cmake_src_configure |
78 |
} |
79 |
|
80 |
-src_compile() { |
81 |
- cmake_src_compile |
82 |
- |
83 |
- if use stage2 ; then |
84 |
- cd "${BUILD_DIR}" || die |
85 |
- ./zig build -p stage2 -Dstatic-llvm=false -Denable-llvm=true -Dsingle-threaded="$(usex threads false true)" -Dskip-install-lib-files=true --verbose || die |
86 |
- fi |
87 |
-} |
88 |
- |
89 |
src_test() { |
90 |
cd "${BUILD_DIR}" || die |
91 |
- ./zig build test || die |
92 |
+ ./stage3/bin/zig build test -Dstatic-llvm=false -Denable-llvm=true || die |
93 |
} |
94 |
|
95 |
src_install() { |
96 |
- cmake_src_install |
97 |
- |
98 |
- use stage2 && newbin "${BUILD_DIR}/stage2/bin/zig" zig-stage2 |
99 |
+ cd "${BUILD_DIR}" || die |
100 |
+ DESTDIR="${D}" ./zig2 build install -Denable-stage1=true -Dstatic-llvm=false -Denable-llvm=true --prefix "${EPREFIX}"/usr || die |
101 |
+ dodoc ../README.md |
102 |
} |
103 |
|
104 |
# see https://github.com/ziglang/zig/issues/3382 |
105 |
-QA_FLAGS_IGNORED="usr/bin/zig-stage2" |
106 |
+QA_FLAGS_IGNORED="usr/bin/zig" |
107 |
|
108 |
pkg_postinst() { |
109 |
- use stage2 && elog "You enabled stage2 USE flag, Zig stage1 was installed as /usr/bin/zig, Zig stage2 was installed as /usr/bin/zig-stage2" |
110 |
+ elog "If you want to use stage1 backend, use -fstage1 flag" |
111 |
} |