1 |
commit: 2174b583aaa54f035fb1a1ebbe1a64d72e21f74e |
2 |
Author: Huang Rui <vowstar <AT> gmail <DOT> com> |
3 |
AuthorDate: Thu Nov 3 07:09:54 2022 +0000 |
4 |
Commit: Rui Huang <vowstar <AT> gmail <DOT> com> |
5 |
CommitDate: Thu Nov 3 07:09:54 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=2174b583 |
7 |
|
8 |
sci-electronics/slang: fix bugs and bump to 2.0 |
9 |
|
10 |
Signed-off-by: Huang Rui <vowstar <AT> gmail.com> |
11 |
|
12 |
sci-electronics/slang/Manifest | 1 + |
13 |
.../slang/files/slang-2.0-fix-lib-path.patch | 64 ++++++++++++++++++++++ |
14 |
sci-electronics/slang/slang-1.0.ebuild | 3 +- |
15 |
.../slang/{slang-1.0.ebuild => slang-2.0.ebuild} | 28 ++++++---- |
16 |
sci-electronics/slang/slang-9999.ebuild | 28 ++++++---- |
17 |
5 files changed, 102 insertions(+), 22 deletions(-) |
18 |
|
19 |
diff --git a/sci-electronics/slang/Manifest b/sci-electronics/slang/Manifest |
20 |
index db3d59054..37c981edb 100644 |
21 |
--- a/sci-electronics/slang/Manifest |
22 |
+++ b/sci-electronics/slang/Manifest |
23 |
@@ -1 +1,2 @@ |
24 |
DIST slang-1.0.tar.gz 1239664 BLAKE2B 98355987b5c355eb914dd0d38c7441d5d39b7a0259e557d9cfd6271fd35aab642db6036d55228f75522fef0c31a4c82dea4d09cdb04ea33c60d843a3ca14caf0 SHA512 25ef7f5abb1b73928f61b853db5462baf72077a47daa9419311aba1f8fdca0bd499518c2f64dfff95b3c0671e52f2b1cd37edb7d1c74fb983b74de08fe7eea37 |
25 |
+DIST slang-2.0.tar.gz 1026299 BLAKE2B d55e0f419e030a37ff80aef3c0b16a96ee402707c758797fea3d1914e29247d22d240693cd873f95f634438fad5b8ed65961a324c69788fc3e62f83ce0a94869 SHA512 3d18961cda7eb40877932e937364b19cfcef3127a8467fbfc70febd1d6ef8b267aeae8244355a4b0206197ef126ee5a65aa4a4fb49d0970fe6c626725b7e6b21 |
26 |
|
27 |
diff --git a/sci-electronics/slang/files/slang-2.0-fix-lib-path.patch b/sci-electronics/slang/files/slang-2.0-fix-lib-path.patch |
28 |
new file mode 100644 |
29 |
index 000000000..8aeb228fa |
30 |
--- /dev/null |
31 |
+++ b/sci-electronics/slang/files/slang-2.0-fix-lib-path.patch |
32 |
@@ -0,0 +1,64 @@ |
33 |
+From 16ef772ec581e929197eae35ef99993e4d7c8dbb Mon Sep 17 00:00:00 2001 |
34 |
+From: Huang Rui <vowstar@×××××.com> |
35 |
+Date: Thu, 3 Nov 2022 12:04:42 +0800 |
36 |
+Subject: [PATCH] external/CMakeLists.txt: fix find_pkg when unordered_dense |
37 |
+ installed |
38 |
+ |
39 |
+If the user has already installed unordered_dense beforehand, |
40 |
+avoid downloading and installing again. |
41 |
+Applicable when the distribution has packaged unordered_dense. |
42 |
+ |
43 |
+Signed-off-by: Huang Rui <vowstar@×××××.com> |
44 |
+--- |
45 |
+ external/CMakeLists.txt | 22 ++++++++++++++++------ |
46 |
+ 1 file changed, 16 insertions(+), 6 deletions(-) |
47 |
+ |
48 |
+diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt |
49 |
+index 97e0e79c7..6eb30989a 100644 |
50 |
+--- a/external/CMakeLists.txt |
51 |
++++ b/external/CMakeLists.txt |
52 |
+@@ -27,11 +27,17 @@ if((SLANG_INCLUDE_PYLIB OR BUILD_SHARED_LIBS) AND NOT fmt_FOUND) |
53 |
+ set_target_properties(fmt PROPERTIES POSITION_INDEPENDENT_CODE ON) |
54 |
+ endif() |
55 |
+ |
56 |
++set(find_pkg_args "") |
57 |
++if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.24.0") |
58 |
++ set(find_pkg_args "FIND_PACKAGE_ARGS" "2.0.0") |
59 |
++endif() |
60 |
++ |
61 |
+ FetchContent_Declare( |
62 |
+ unordered_dense |
63 |
+ GIT_REPOSITORY https://github.com/martinus/unordered_dense.git |
64 |
+ GIT_TAG v2.0.0 |
65 |
+- GIT_SHALLOW ON) |
66 |
++ GIT_SHALLOW ON |
67 |
++ ${find_pkg_args}) |
68 |
+ FetchContent_MakeAvailable(unordered_dense) |
69 |
+ |
70 |
+ if(SLANG_INCLUDE_INSTALL) |
71 |
+@@ -44,10 +50,12 @@ if(SLANG_INCLUDE_INSTALL) |
72 |
+ ${PROJECT_SOURCE_DIR}/external/span.hpp |
73 |
+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} |
74 |
+ COMPONENT slang_Development) |
75 |
+- install( |
76 |
+- DIRECTORY ${unordered_dense_SOURCE_DIR}/include/ankerl |
77 |
+- DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} |
78 |
+- COMPONENT slang_Development) |
79 |
++ if(NOT unordered_dense_FOUND) |
80 |
++ install( |
81 |
++ DIRECTORY ${unordered_dense_SOURCE_DIR}/include/ankerl |
82 |
++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} |
83 |
++ COMPONENT slang_Development) |
84 |
++ endif() |
85 |
+ |
86 |
+ if(NOT fmt_FOUND) |
87 |
+ install( |
88 |
+@@ -59,5 +67,7 @@ if(SLANG_INCLUDE_INSTALL) |
89 |
+ PRIVATE_HEADER EXCLUDE_FROM_ALL) |
90 |
+ endif() |
91 |
+ |
92 |
+- install(TARGETS unordered_dense EXPORT slangTargets) |
93 |
++ if(NOT unordered_dense_FOUND) |
94 |
++ install(TARGETS unordered_dense EXPORT slangTargets) |
95 |
++ endif() |
96 |
+ endif() |
97 |
|
98 |
diff --git a/sci-electronics/slang/slang-1.0.ebuild b/sci-electronics/slang/slang-1.0.ebuild |
99 |
index 1e1d7d743..d788704f4 100644 |
100 |
--- a/sci-electronics/slang/slang-1.0.ebuild |
101 |
+++ b/sci-electronics/slang/slang-1.0.ebuild |
102 |
@@ -4,7 +4,7 @@ |
103 |
EAPI="8" |
104 |
|
105 |
PYTHON_COMPAT=( python3_{8..11} ) |
106 |
-inherit cmake python-r1 |
107 |
+inherit cmake python-single-r1 |
108 |
|
109 |
DESCRIPTION="SystemVerilog compiler and language services" |
110 |
HOMEPAGE=" |
111 |
@@ -42,7 +42,6 @@ src_configure() { |
112 |
local mycmakeargs=( |
113 |
-D CMAKE_INSTALL_LIBDIR="${EPREFIX}/usr/$(get_libdir)" |
114 |
-D BUILD_SHARED_LIBS=ON |
115 |
- -D SLANG_INCLUDE_PYLIB=$(usex python) |
116 |
-D SLANG_INCLUDE_TESTS=$(usex test) |
117 |
) |
118 |
cmake_src_configure |
119 |
|
120 |
diff --git a/sci-electronics/slang/slang-1.0.ebuild b/sci-electronics/slang/slang-2.0.ebuild |
121 |
similarity index 65% |
122 |
copy from sci-electronics/slang/slang-1.0.ebuild |
123 |
copy to sci-electronics/slang/slang-2.0.ebuild |
124 |
index 1e1d7d743..4a9134e0f 100644 |
125 |
--- a/sci-electronics/slang/slang-1.0.ebuild |
126 |
+++ b/sci-electronics/slang/slang-2.0.ebuild |
127 |
@@ -4,7 +4,7 @@ |
128 |
EAPI="8" |
129 |
|
130 |
PYTHON_COMPAT=( python3_{8..11} ) |
131 |
-inherit cmake python-r1 |
132 |
+inherit cmake python-single-r1 |
133 |
|
134 |
DESCRIPTION="SystemVerilog compiler and language services" |
135 |
HOMEPAGE=" |
136 |
@@ -29,19 +29,29 @@ RESTRICT="!test? ( test )" |
137 |
|
138 |
RDEPEND=" |
139 |
${PYTHON_DEPS} |
140 |
- dev-libs/libfmt |
141 |
+ >=dev-cpp/catch-3.0.1 |
142 |
+ >=dev-libs/libfmt-9.1.0 |
143 |
+ >=dev-libs/unordered_dense-2.0.0 |
144 |
+ $(python_gen_cond_dep ' |
145 |
+ >=dev-python/pybind11-2.10[${PYTHON_USEDEP}] |
146 |
+ ') |
147 |
" |
148 |
|
149 |
DEPEND=" |
150 |
${RDEPEND} |
151 |
" |
152 |
|
153 |
+PATCHES=( |
154 |
+ "${FILESDIR}/${PN}-2.0-fix-lib-path.patch" |
155 |
+) |
156 |
+ |
157 |
src_configure() { |
158 |
python_setup |
159 |
- |
160 |
+ # BUILD_SHARED_LIBS=OFF because of name collision |
161 |
+ # https://github.com/MikePopoloski/slang/issues/646 |
162 |
local mycmakeargs=( |
163 |
-D CMAKE_INSTALL_LIBDIR="${EPREFIX}/usr/$(get_libdir)" |
164 |
- -D BUILD_SHARED_LIBS=ON |
165 |
+ -D BUILD_SHARED_LIBS=OFF |
166 |
-D SLANG_INCLUDE_PYLIB=$(usex python) |
167 |
-D SLANG_INCLUDE_TESTS=$(usex test) |
168 |
) |
169 |
@@ -50,10 +60,8 @@ src_configure() { |
170 |
|
171 |
src_install() { |
172 |
cmake_src_install |
173 |
- # fix libdir path |
174 |
- if [[ "$(get_libdir)" != "lib" ]] ; then |
175 |
- mv "${D}"/usr/lib "${D}"/usr/"$(get_libdir)" || die |
176 |
- fi |
177 |
- # file collisions of internal fmt |
178 |
- rm -r "${D}"/usr/include/fmt || die |
179 |
+ |
180 |
+ # fix python unexpected paths QA |
181 |
+ mkdir -p "${D}/$(python_get_sitedir)" || die |
182 |
+ mv "${D}"/usr/pyslang* "${D}/$(python_get_sitedir)" || die |
183 |
} |
184 |
|
185 |
diff --git a/sci-electronics/slang/slang-9999.ebuild b/sci-electronics/slang/slang-9999.ebuild |
186 |
index 1e1d7d743..4a9134e0f 100644 |
187 |
--- a/sci-electronics/slang/slang-9999.ebuild |
188 |
+++ b/sci-electronics/slang/slang-9999.ebuild |
189 |
@@ -4,7 +4,7 @@ |
190 |
EAPI="8" |
191 |
|
192 |
PYTHON_COMPAT=( python3_{8..11} ) |
193 |
-inherit cmake python-r1 |
194 |
+inherit cmake python-single-r1 |
195 |
|
196 |
DESCRIPTION="SystemVerilog compiler and language services" |
197 |
HOMEPAGE=" |
198 |
@@ -29,19 +29,29 @@ RESTRICT="!test? ( test )" |
199 |
|
200 |
RDEPEND=" |
201 |
${PYTHON_DEPS} |
202 |
- dev-libs/libfmt |
203 |
+ >=dev-cpp/catch-3.0.1 |
204 |
+ >=dev-libs/libfmt-9.1.0 |
205 |
+ >=dev-libs/unordered_dense-2.0.0 |
206 |
+ $(python_gen_cond_dep ' |
207 |
+ >=dev-python/pybind11-2.10[${PYTHON_USEDEP}] |
208 |
+ ') |
209 |
" |
210 |
|
211 |
DEPEND=" |
212 |
${RDEPEND} |
213 |
" |
214 |
|
215 |
+PATCHES=( |
216 |
+ "${FILESDIR}/${PN}-2.0-fix-lib-path.patch" |
217 |
+) |
218 |
+ |
219 |
src_configure() { |
220 |
python_setup |
221 |
- |
222 |
+ # BUILD_SHARED_LIBS=OFF because of name collision |
223 |
+ # https://github.com/MikePopoloski/slang/issues/646 |
224 |
local mycmakeargs=( |
225 |
-D CMAKE_INSTALL_LIBDIR="${EPREFIX}/usr/$(get_libdir)" |
226 |
- -D BUILD_SHARED_LIBS=ON |
227 |
+ -D BUILD_SHARED_LIBS=OFF |
228 |
-D SLANG_INCLUDE_PYLIB=$(usex python) |
229 |
-D SLANG_INCLUDE_TESTS=$(usex test) |
230 |
) |
231 |
@@ -50,10 +60,8 @@ src_configure() { |
232 |
|
233 |
src_install() { |
234 |
cmake_src_install |
235 |
- # fix libdir path |
236 |
- if [[ "$(get_libdir)" != "lib" ]] ; then |
237 |
- mv "${D}"/usr/lib "${D}"/usr/"$(get_libdir)" || die |
238 |
- fi |
239 |
- # file collisions of internal fmt |
240 |
- rm -r "${D}"/usr/include/fmt || die |
241 |
+ |
242 |
+ # fix python unexpected paths QA |
243 |
+ mkdir -p "${D}/$(python_get_sitedir)" || die |
244 |
+ mv "${D}"/usr/pyslang* "${D}/$(python_get_sitedir)" || die |
245 |
} |