Gentoo Archives: gentoo-commits

From: Marco Leise <marco.leise@×××.de>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/user/dlang:master commit in: dev-lang/ldc2/
Date: Sun, 06 Feb 2022 15:50:25
Message-Id: 1643917012.2966167d6db5018b0ea1eb50f2a277324ffbd229.mleise@gentoo
1 commit: 2966167d6db5018b0ea1eb50f2a277324ffbd229
2 Author: Niko Böckerman <niko.bockerman <AT> protonmail <DOT> com>
3 AuthorDate: Thu Feb 3 19:29:34 2022 +0000
4 Commit: Marco Leise <marco.leise <AT> gmx <DOT> de>
5 CommitDate: Thu Feb 3 19:36:52 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/user/dlang.git/commit/?id=2966167d
7
8 ldc2: Add support for newer llvm versions
9
10 LDC2 1.24 added support for LLVM 11 and LDC 1.25 added support also for
11 LLVM 12.
12
13 Signed-off-by: Niko Böckerman <niko.bockerman <AT> protonmail.com>
14
15 dev-lang/ldc2/ldc2-1.24.0-r2.ebuild | 82 ++++++++++++++++++++++++++++++++++++
16 dev-lang/ldc2/ldc2-1.25.1-r1.ebuild | 83 +++++++++++++++++++++++++++++++++++++
17 dev-lang/ldc2/ldc2-1.26.0-r1.ebuild | 83 +++++++++++++++++++++++++++++++++++++
18 3 files changed, 248 insertions(+)
19
20 diff --git a/dev-lang/ldc2/ldc2-1.24.0-r2.ebuild b/dev-lang/ldc2/ldc2-1.24.0-r2.ebuild
21 new file mode 100644
22 index 0000000..181f1b5
23 --- /dev/null
24 +++ b/dev-lang/ldc2/ldc2-1.24.0-r2.ebuild
25 @@ -0,0 +1,82 @@
26 +# Copyright 1999-2021 Gentoo Authors
27 +# Distributed under the terms of the GNU General Public License v2
28 +
29 +EAPI=7
30 +
31 +inherit multilib-build cmake llvm
32 +
33 +MY_PV="${PV//_/-}"
34 +MY_P="ldc-${MY_PV}-src"
35 +SRC_URI="https://github.com/ldc-developers/ldc/releases/download/v${MY_PV}/${MY_P}.tar.gz"
36 +S=${WORKDIR}/${MY_P}
37 +
38 +DESCRIPTION="LLVM D Compiler"
39 +HOMEPAGE="https://github.com/ldc-developers/ldc"
40 +KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86"
41 +LICENSE="BSD"
42 +SLOT="$(ver_cut 1-2)/$(ver_cut 3)"
43 +
44 +IUSE="static-libs"
45 +
46 +# We support LLVM 6.0 through 10.
47 +RDEPEND="dev-util/ninja
48 + || (
49 + sys-devel/llvm:10
50 + sys-devel/llvm:11
51 + )
52 + <sys-devel/llvm-12:=
53 + >=app-eselect/eselect-dlang-20140709"
54 +DEPEND="${RDEPEND}"
55 +LLVM_MAX_SLOT=11
56 +PATCHES="${FILESDIR}/ldc2-1.15.0-link-defaultlib-shared.patch"
57 +
58 +# For now, we support amd64 multilib. Anyone is free to add more support here.
59 +MULTILIB_COMPAT=( abi_x86_{32,64} )
60 +
61 +DLANG_VERSION_RANGE="2.075-"
62 +DLANG_PACKAGE_TYPE="single"
63 +
64 +inherit dlang
65 +
66 +detect_hardened() {
67 + gcc --version | grep -o Hardened
68 +}
69 +
70 +src_prepare() {
71 + cmake_src_prepare
72 +}
73 +
74 +d_src_configure() {
75 + # Make sure libphobos2 is installed into ldc2's directory.
76 + export LIBDIR_${ABI}="${LIBDIR_HOST}"
77 + local mycmakeargs=(
78 + -DD_VERSION=2
79 + -DCMAKE_INSTALL_PREFIX=/usr/lib/ldc2/$(ver_cut 1-2)
80 + -DD_COMPILER="${DMD}"
81 + -DLDC_WITH_LLD=OFF
82 + )
83 + use static-libs && mycmakeargs+=( -DBUILD_SHARED_LIBS=BOTH ) || mycmakeargs+=( -DBUILD_SHARED_LIBS=ON )
84 + use abi_x86_32 && use abi_x86_64 && mycmakeargs+=( -DMULTILIB=ON )
85 + detect_hardened && mycmakeargs+=( -DADDITIONAL_DEFAULT_LDC_SWITCHES=' "-relocation-model=pic",' )
86 + cmake_src_configure
87 +}
88 +
89 +d_src_compile()
90 +{
91 + cmake_src_compile
92 +}
93 +
94 +d_src_install() {
95 + cmake_src_install
96 +
97 + rm -rf "${ED}"/usr/share/bash-completion
98 +}
99 +
100 +pkg_postinst() {
101 + # Update active ldc2
102 + "${ROOT}"/usr/bin/eselect dlang update ldc2
103 +}
104 +
105 +pkg_postrm() {
106 + "${ROOT}"/usr/bin/eselect dlang update ldc2
107 +}
108
109 diff --git a/dev-lang/ldc2/ldc2-1.25.1-r1.ebuild b/dev-lang/ldc2/ldc2-1.25.1-r1.ebuild
110 new file mode 100644
111 index 0000000..1171863
112 --- /dev/null
113 +++ b/dev-lang/ldc2/ldc2-1.25.1-r1.ebuild
114 @@ -0,0 +1,83 @@
115 +# Copyright 1999-2021 Gentoo Authors
116 +# Distributed under the terms of the GNU General Public License v2
117 +
118 +EAPI=7
119 +
120 +inherit multilib-build cmake llvm
121 +
122 +MY_PV="${PV//_/-}"
123 +MY_P="ldc-${MY_PV}-src"
124 +SRC_URI="https://github.com/ldc-developers/ldc/releases/download/v${MY_PV}/${MY_P}.tar.gz"
125 +S=${WORKDIR}/${MY_P}
126 +
127 +DESCRIPTION="LLVM D Compiler"
128 +HOMEPAGE="https://github.com/ldc-developers/ldc"
129 +KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86"
130 +LICENSE="BSD"
131 +SLOT="$(ver_cut 1-2)/$(ver_cut 3)"
132 +
133 +IUSE="static-libs"
134 +
135 +# We support LLVM 6.0 through 10.
136 +RDEPEND="dev-util/ninja
137 + || (
138 + sys-devel/llvm:10
139 + sys-devel/llvm:11
140 + sys-devel/llvm:12
141 + )
142 + <sys-devel/llvm-13:=
143 + >=app-eselect/eselect-dlang-20140709"
144 +DEPEND="${RDEPEND}"
145 +LLVM_MAX_SLOT=12
146 +PATCHES="${FILESDIR}/ldc2-1.15.0-link-defaultlib-shared.patch"
147 +
148 +# For now, we support amd64 multilib. Anyone is free to add more support here.
149 +MULTILIB_COMPAT=( abi_x86_{32,64} )
150 +
151 +DLANG_VERSION_RANGE="2.075-"
152 +DLANG_PACKAGE_TYPE="single"
153 +
154 +inherit dlang
155 +
156 +detect_hardened() {
157 + gcc --version | grep -o Hardened
158 +}
159 +
160 +src_prepare() {
161 + cmake_src_prepare
162 +}
163 +
164 +d_src_configure() {
165 + # Make sure libphobos2 is installed into ldc2's directory.
166 + export LIBDIR_${ABI}="${LIBDIR_HOST}"
167 + local mycmakeargs=(
168 + -DD_VERSION=2
169 + -DCMAKE_INSTALL_PREFIX=/usr/lib/ldc2/$(ver_cut 1-2)
170 + -DD_COMPILER="${DMD}"
171 + -DLDC_WITH_LLD=OFF
172 + )
173 + use static-libs && mycmakeargs+=( -DBUILD_SHARED_LIBS=BOTH ) || mycmakeargs+=( -DBUILD_SHARED_LIBS=ON )
174 + use abi_x86_32 && use abi_x86_64 && mycmakeargs+=( -DMULTILIB=ON )
175 + detect_hardened && mycmakeargs+=( -DADDITIONAL_DEFAULT_LDC_SWITCHES=' "-relocation-model=pic",' )
176 + cmake_src_configure
177 +}
178 +
179 +d_src_compile()
180 +{
181 + cmake_src_compile
182 +}
183 +
184 +d_src_install() {
185 + cmake_src_install
186 +
187 + rm -rf "${ED}"/usr/share/bash-completion
188 +}
189 +
190 +pkg_postinst() {
191 + # Update active ldc2
192 + "${ROOT}"/usr/bin/eselect dlang update ldc2
193 +}
194 +
195 +pkg_postrm() {
196 + "${ROOT}"/usr/bin/eselect dlang update ldc2
197 +}
198
199 diff --git a/dev-lang/ldc2/ldc2-1.26.0-r1.ebuild b/dev-lang/ldc2/ldc2-1.26.0-r1.ebuild
200 new file mode 100644
201 index 0000000..1171863
202 --- /dev/null
203 +++ b/dev-lang/ldc2/ldc2-1.26.0-r1.ebuild
204 @@ -0,0 +1,83 @@
205 +# Copyright 1999-2021 Gentoo Authors
206 +# Distributed under the terms of the GNU General Public License v2
207 +
208 +EAPI=7
209 +
210 +inherit multilib-build cmake llvm
211 +
212 +MY_PV="${PV//_/-}"
213 +MY_P="ldc-${MY_PV}-src"
214 +SRC_URI="https://github.com/ldc-developers/ldc/releases/download/v${MY_PV}/${MY_P}.tar.gz"
215 +S=${WORKDIR}/${MY_P}
216 +
217 +DESCRIPTION="LLVM D Compiler"
218 +HOMEPAGE="https://github.com/ldc-developers/ldc"
219 +KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86"
220 +LICENSE="BSD"
221 +SLOT="$(ver_cut 1-2)/$(ver_cut 3)"
222 +
223 +IUSE="static-libs"
224 +
225 +# We support LLVM 6.0 through 10.
226 +RDEPEND="dev-util/ninja
227 + || (
228 + sys-devel/llvm:10
229 + sys-devel/llvm:11
230 + sys-devel/llvm:12
231 + )
232 + <sys-devel/llvm-13:=
233 + >=app-eselect/eselect-dlang-20140709"
234 +DEPEND="${RDEPEND}"
235 +LLVM_MAX_SLOT=12
236 +PATCHES="${FILESDIR}/ldc2-1.15.0-link-defaultlib-shared.patch"
237 +
238 +# For now, we support amd64 multilib. Anyone is free to add more support here.
239 +MULTILIB_COMPAT=( abi_x86_{32,64} )
240 +
241 +DLANG_VERSION_RANGE="2.075-"
242 +DLANG_PACKAGE_TYPE="single"
243 +
244 +inherit dlang
245 +
246 +detect_hardened() {
247 + gcc --version | grep -o Hardened
248 +}
249 +
250 +src_prepare() {
251 + cmake_src_prepare
252 +}
253 +
254 +d_src_configure() {
255 + # Make sure libphobos2 is installed into ldc2's directory.
256 + export LIBDIR_${ABI}="${LIBDIR_HOST}"
257 + local mycmakeargs=(
258 + -DD_VERSION=2
259 + -DCMAKE_INSTALL_PREFIX=/usr/lib/ldc2/$(ver_cut 1-2)
260 + -DD_COMPILER="${DMD}"
261 + -DLDC_WITH_LLD=OFF
262 + )
263 + use static-libs && mycmakeargs+=( -DBUILD_SHARED_LIBS=BOTH ) || mycmakeargs+=( -DBUILD_SHARED_LIBS=ON )
264 + use abi_x86_32 && use abi_x86_64 && mycmakeargs+=( -DMULTILIB=ON )
265 + detect_hardened && mycmakeargs+=( -DADDITIONAL_DEFAULT_LDC_SWITCHES=' "-relocation-model=pic",' )
266 + cmake_src_configure
267 +}
268 +
269 +d_src_compile()
270 +{
271 + cmake_src_compile
272 +}
273 +
274 +d_src_install() {
275 + cmake_src_install
276 +
277 + rm -rf "${ED}"/usr/share/bash-completion
278 +}
279 +
280 +pkg_postinst() {
281 + # Update active ldc2
282 + "${ROOT}"/usr/bin/eselect dlang update ldc2
283 +}
284 +
285 +pkg_postrm() {
286 + "${ROOT}"/usr/bin/eselect dlang update ldc2
287 +}