-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
Copy pathPKGBUILD
552 lines (477 loc) · 21.9 KB
/
PKGBUILD
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
# Maintainer: Alexey Pavlov <alexpux@gmail.com>
# Contributor: Alexey Borzenkov <snaury@gmail.com>
# Contributor: Ray Donnelly <mingw.android@gmail.com>
# Contributor: Renato Silva <br.renatosilva@gmail.com>
# Contributor: wirx6 <wirx654@gmail.com>
# Contributor: Kirill Müller <krlmlr@mailbox.org>
if [[ ${CARCH} != i686 ]]; then
_enable_ada=yes
_enable_objc=yes
_enable_rust=yes
_enable_jit=yes
else
_enable_ada=no
_enable_objc=no
_enable_rust=no
_enable_jit=no
fi
_threads="posix"
_realname=gcc
pkgbase=mingw-w64-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}"
"${MINGW_PACKAGE_PREFIX}-${_realname}-libs"
"${MINGW_PACKAGE_PREFIX}-${_realname}-libgfortran"
"${MINGW_PACKAGE_PREFIX}-${_realname}-fortran"
"${MINGW_PACKAGE_PREFIX}-${_realname}-lto-dump"
$([[ "$_enable_ada" == "yes" ]] && echo "${MINGW_PACKAGE_PREFIX}-${_realname}-ada")
$([[ "$_enable_objc" == "yes" ]] && echo "${MINGW_PACKAGE_PREFIX}-${_realname}-objc")
$([[ "$_enable_rust" == "yes" ]] && echo "${MINGW_PACKAGE_PREFIX}-${_realname}-rust")
$([[ "$_enable_jit" == "yes" ]] && echo "${MINGW_PACKAGE_PREFIX}-libgccjit")
)
pkgver=14.2.0
_rc=""
_snapshot=
if [[ -z ${_rc} ]]; then
_version=${pkgver%%.*}
_libdir=lib/gcc/${CHOST}/${pkgver%%+*}
else
_version=${pkgver}-${_rc}
_libdir=lib/gcc/${CHOST}/${pkgver%%.*}.0.1
fi
if [[ -z ${_snapshot} ]]; then
_sourcedir=${_realname}-${pkgver}
_url=https://ftp.gnu.org/gnu/gcc/${_realname}-${pkgver%%+*}
else
_sourcedir=${_realname}-${_version}-${_snapshot}
_url=https://gcc.gnu.org/pub/gcc/snapshots/${_version}-${_snapshot}
fi
pkgrel=2
pkgdesc="GCC for the MinGW-w64"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64')
url="https://gcc.gnu.org"
msys2_references=(
"cpe: cpe:/a:gnu:gcc"
)
license=('spdx:GPL-3.0-or-later')
makedepends=("${MINGW_PACKAGE_PREFIX}-${_realname}"
$([[ "$_enable_ada" == "yes" ]] && echo "${MINGW_PACKAGE_PREFIX}-${_realname}-ada")
$([[ "$_enable_rust" == "yes" ]] && echo "${MINGW_PACKAGE_PREFIX}-rust")
"${MINGW_PACKAGE_PREFIX}-autotools"
"${MINGW_PACKAGE_PREFIX}-binutils"
"${MINGW_PACKAGE_PREFIX}-crt"
"${MINGW_PACKAGE_PREFIX}-headers"
"${MINGW_PACKAGE_PREFIX}-gmp"
"${MINGW_PACKAGE_PREFIX}-gperf"
"${MINGW_PACKAGE_PREFIX}-isl"
"${MINGW_PACKAGE_PREFIX}-libiconv"
"${MINGW_PACKAGE_PREFIX}-mpc"
"${MINGW_PACKAGE_PREFIX}-mpfr"
"${MINGW_PACKAGE_PREFIX}-python"
"${MINGW_PACKAGE_PREFIX}-windows-default-manifest"
"${MINGW_PACKAGE_PREFIX}-winpthreads"
"${MINGW_PACKAGE_PREFIX}-zlib"
"${MINGW_PACKAGE_PREFIX}-zstd")
options=('!emptydirs') # '!strip' 'debug')
source=(${_url}/${_sourcedir}.tar.xz{,.sig}
"gdbinit"
0003-Windows-Follow-Posix-dir-exists-semantics-more-close.patch
0005-Windows-Don-t-ignore-native-system-header-dir.patch
0007-Build-EXTRA_GNATTOOLS-for-Ada.patch
0008-Prettify-linking-no-undefined.patch
0011-Enable-shared-gnat-implib.patch
0012-Handle-spaces-in-path-for-default-manifest.patch
0014-gcc-9-branch-clone_function_name_1-Retain-any-stdcall-suffix.patch
0020-libgomp-Don-t-hard-code-MS-printf-attributes.patch
0021-PR14940-Allow-a-PCH-to-be-mapped-to-a-different-addr.patch
0140-gcc-diagnostic-color.patch
0200-add-m-no-align-vector-insn-option-for-i386.patch
2001-fix-building-rust-on-mingw-w64.patch)
sha256sums=('a7b39bc69cbf9e25826c5a60ab26477001f7c08d85cec04bc0e29cabed6f3cc9'
'SKIP'
'bce81824fc89e5e62cca350de4c17a27e27a18a1a1ad5ca3492aec1fc5af3234'
'3fc35067823f87e48dd3bfd265e7593000dc110fa9ad5f16c81b896765fc897a'
'57f0081655ba9a94ed7cc3d8b67a79aee8442a56613bd17f9809a7b0e68e43cd'
'90d5cb570083f9dea4ac0f0f87e3e8d2230f5052e6f9b946061a20a224a9d195'
'8a40ea004a803b7e6aabd6c58d859502a57c87755dbcfedbdfed161f2fb7eb62'
'5ef4148acc4a2b7ed648d4fe75fab5545e84b4b93a12d6ba4e4ea6061dd635fa'
'e98805ead7d78ee2a92f237894c4b2b7ddc1688e1b517d8c04f28d440202e40f'
'fd9bdecb2bbc4796bbc9f00b708dac42ef9e3464a06d6d27e5475cee117de5be'
'ad1f7b5e7afaaec008b7cbd14feea13a10989fa91bda7003af72d457619bb199'
'6c272078340a27b3f147e497115b0a6e9fc0da720a2602f12b086524522caa59'
'e0a5b470f49a29f20215cc9f9d04c1cb9969dff6f0e546542799d3a693ef1c84'
'c34f9e71b5a092be1987ad4c65891742c74c9eb8ef6560100e751cd31375f579'
'ddc1538c2b9132bce5b3b2cad2a382762d58b46b31d2ae291f6e4d963b88dfd4')
validpgpkeys=(F3691687D867B81B51CE07D9BBE43771487328A9 # bpiotrowski@archlinux.org
86CFFCA918CF3AF47147588051E8B148A9999C34 # evangelos@foutrelis.com
13975A70E63C361C73AE69EF6EEB81F8981C74C7 # richard.guenther@gmail.com
D3A93CAD751C2AF4F8C7AD516C35B99309B5FA62) # Jakub Jelinek <jakub@redhat.com>
# Helper macros to help make tasks easier #
apply_patch_with_msg() {
for _patch in "$@"
do
msg2 "Applying ${_patch}"
patch -Nbp1 -i "${srcdir}/${_patch}"
done
}
del_file_exists() {
for _fname in "$@"
do
if [ -f ${_fname} ]; then
rm -rf ${_fname}
fi
done
}
# =========================================== #
prepare() {
cd "${srcdir}"/${_sourcedir}
apply_patch_with_msg \
0003-Windows-Follow-Posix-dir-exists-semantics-more-close.patch \
0005-Windows-Don-t-ignore-native-system-header-dir.patch \
0007-Build-EXTRA_GNATTOOLS-for-Ada.patch \
0008-Prettify-linking-no-undefined.patch \
0011-Enable-shared-gnat-implib.patch \
0012-Handle-spaces-in-path-for-default-manifest.patch \
0014-gcc-9-branch-clone_function_name_1-Retain-any-stdcall-suffix.patch \
0020-libgomp-Don-t-hard-code-MS-printf-attributes.patch \
0021-PR14940-Allow-a-PCH-to-be-mapped-to-a-different-addr.patch
# Enable diagnostic color under mintty
# based on https://github.com/BurntSushi/ripgrep/issues/94#issuecomment-261761687
apply_patch_with_msg \
0140-gcc-diagnostic-color.patch
# workaround for AVX misalignment issue for pass-by-value arguments
# cf. https://github.com/msys2/MSYS2-packages/issues/1209
# cf. https://sourceforge.net/p/mingw-w64/discussion/723797/thread/bc936130/
# Issue is longstanding upstream at https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54412
# Potential alternative: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=939559
# https://github.com/msys2/MINGW-packages/pull/8317#issuecomment-824548411
apply_patch_with_msg \
0200-add-m-no-align-vector-insn-option-for-i386.patch
apply_patch_with_msg \
2001-fix-building-rust-on-mingw-w64.patch
# do not expect ${prefix}/mingw symlink - this should be superceded by
# 0005-Windows-Don-t-ignore-native-system-header-dir.patch .. but isn't!
sed -i 's/${prefix}\/mingw\//${prefix}\//g' configure
# change hardcoded /mingw prefix to the real prefix .. isn't this rubbish?
# it might work at build time and could be important there but beyond that?!
local MINGW_NATIVE_PREFIX=$(cygpath -am ${MINGW_PREFIX})
sed -i "s#\\/mingw\\/#${MINGW_NATIVE_PREFIX//\//\\/}\\/#g" gcc/config/i386/mingw32.h
}
build() {
mkdir -p "${srcdir}"/build-${MSYSTEM} && cd "${srcdir}"/build-${MSYSTEM}
declare -a _extra_config
if check_option "debug" "n"; then
_extra_config+=("--disable-libstdcxx-debug")
else
_extra_config+=("--enable-libstdcxx-debug")
fi
if [[ "${CARCH}" == "i686" ]]; then
_extra_config+=(
"--disable-sjlj-exceptions"
"--with-dwarf2"
)
LDFLAGS+=" -Wl,--large-address-aware"
local _arch=pentium4
else
_extra_config+=("--enable-plugin")
local _arch=nocona
fi
local _languages="c,lto,c++,fortran"
if [ "$_enable_ada" == "yes" ]; then
_languages+=",ada"
fi
if [ "$_enable_objc" == "yes" ]; then
_languages+=",objc,obj-c++"
fi
if [ "$_enable_rust" == "yes" ]; then
_languages+=",rust"
fi
if [ "$_enable_jit" == "yes" ]; then
_languages+=",jit"
fi
# so libgomp DLL gets built despide static libdl
export lt_cv_deplibs_check_method='pass_all'
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105507#c3
# At least with mingw32 + dwarf-2 exceptions there can only be one libgcc in
# process, or exceptions will no longer work. Since some of the gcc deps are
# linked dynamically like gmp/zlib/zstd and those pull in libgcc we can't
# allow libgcc to be linked statically. The default is "-static-libstdc++
# -static-libgcc" for both, so we drop "-static-libgcc" here:
# GCC 14 Update: Since we dropped 32bit Ada with GCC 14.1 and GCC doesn't use
# exceptions elsewhere this could in theory be removed, in case it makes problems.
_extra_config+=(
'--with-boot-ldflags="-static-libstdc++"'
'--with-stage1-ldflags="-static-libstdc++"'
)
# In addition adaint.c does `#include <accctrl.h>` which pulls in msxml.h, hacky hack:
CPPFLAGS+=" -DCOM_NO_WINDOWS_H"
../${_sourcedir}/configure \
--prefix=${MINGW_PREFIX} \
--with-local-prefix=${MINGW_PREFIX}/local \
--build=${MINGW_CHOST} \
--host=${MINGW_CHOST} \
--target=${MINGW_CHOST} \
--with-native-system-header-dir=${MINGW_PREFIX}/include \
--libexecdir=${MINGW_PREFIX}/lib \
--enable-bootstrap \
--enable-checking=release \
--with-arch=${_arch} \
--with-tune=generic \
--enable-languages=${_languages} \
--enable-shared \
--enable-static \
--enable-libatomic \
--enable-threads=${_threads} \
--enable-graphite \
--enable-fully-dynamic-string \
--enable-libstdcxx-filesystem-ts \
--enable-libstdcxx-time \
--disable-libstdcxx-pch \
--enable-lto \
--enable-libgomp \
--disable-libssp \
--disable-multilib \
--disable-rpath \
--disable-win32-registry \
--disable-nls \
--disable-werror \
--disable-symvers \
--with-libiconv \
--with-system-zlib \
--with-{gmp,mpfr,mpc,isl}=${MINGW_PREFIX} \
--with-pkgversion="Rev${pkgrel}, Built by MSYS2 project" \
--with-bugurl="https://github.com/msys2/MINGW-packages/issues" \
--with-gnu-as \
--with-gnu-ld \
"${_extra_config[@]}"
# While we're debugging -fopenmp problems at least.
# .. we may as well not strip anything.
if check_option "strip" "n"; then
sed -i 's,^STRIP = .*$,STRIP = true,g' Makefile
sed -i 's,^STRIP_FOR_TARGET=.*$,STRIP_FOR_TARGET=true,g' Makefile
fi
# https://gcc.gnu.org/onlinedocs/gccint/Makefile.html
make -O STAGE1_CFLAGS="-O2" \
profiledbootstrap
}
package_gcc-libs() {
pkgdesc="GNU Compiler Collection (libraries) for MinGW-w64"
depends=("${MINGW_PACKAGE_PREFIX}-libwinpthread")
provides=("${MINGW_PACKAGE_PREFIX}-omp")
# Licensing information
# Part of the package is GCCRLE, part is LGPL-2.1-or-later, see README generation below.
# Since the packaged GCCRLE libraries are also spdx:GPL-3.0-or-later,
# and LGPL-2.1-or-later is compatible with GPL-3.0-or-later, the whole package can
# be redistributed under GPL-3.0-or-later.
license=('spdx:GPL-3.0-or-later WITH GCC-exception-3.1 AND LGPL-2.1-or-later')
cd "${srcdir}"/build-${MSYSTEM}
make -C $CHOST/libgcc DESTDIR="${pkgdir}" install-shared
install -dm755 "${pkgdir}"${MINGW_PREFIX}/bin
mv "${pkgdir}"/libgcc_*.dll "${pkgdir}"${MINGW_PREFIX}/bin/
# libitm* and libvtv* are disbled until fixed
for lib in libatomic libgomp libquadmath libstdc++-v3/src; do
make -C $CHOST/$lib DESTDIR="${pkgdir}" install-toolexeclibLTLIBRARIES
done
rm -r "${pkgdir}"${MINGW_PREFIX}/lib
make -C $CHOST/libstdc++-v3/po DESTDIR="${pkgdir}" install
# We explain the licensing in this generated README file
mkdir -p "${pkgdir}"${MINGW_PREFIX}/share/licenses/${_realname}-libs
cat << ENDFILE > "${pkgdir}"${MINGW_PREFIX}/share/licenses/${_realname}-libs/README
The libgcc, libstdc++, libgomp and libatomic libraries are covered by
GPL-3.0-or-later with GCC-exception-3.1. The libquadmath library is covered
by LGPL-2.1-or-later. The package as a whole can be redistributed under GPL-3.0-or-later.
ENDFILE
# License files
install -Dm644 "${srcdir}"/${_sourcedir}/COPYING3 "${pkgdir}"${MINGW_PREFIX}/share/licenses/${_realname}-libs/COPYING3
install -Dm644 "${srcdir}"/${_sourcedir}/COPYING.LIB "${pkgdir}"${MINGW_PREFIX}/share/licenses/${_realname}-libs/COPYING.LIB
install -Dm644 "${srcdir}"/${_sourcedir}/COPYING.RUNTIME "${pkgdir}"${MINGW_PREFIX}/share/licenses/${_realname}-libs/COPYING.RUNTIME
}
package_gcc() {
pkgdesc="GNU Compiler Collection (C,C++,OpenMP) for MinGW-w64"
depends=("${MINGW_PACKAGE_PREFIX}-binutils"
"${MINGW_PACKAGE_PREFIX}-crt"
"${MINGW_PACKAGE_PREFIX}-headers"
"${MINGW_PACKAGE_PREFIX}-isl"
"${MINGW_PACKAGE_PREFIX}-gmp"
"${MINGW_PACKAGE_PREFIX}-mpfr"
"${MINGW_PACKAGE_PREFIX}-mpc"
"${MINGW_PACKAGE_PREFIX}-${_realname}-libs=${pkgver}-${pkgrel}"
"${MINGW_PACKAGE_PREFIX}-windows-default-manifest"
"${MINGW_PACKAGE_PREFIX}-winpthreads"
"${MINGW_PACKAGE_PREFIX}-zlib"
"${MINGW_PACKAGE_PREFIX}-zstd")
provides=("${MINGW_PACKAGE_PREFIX}-${_realname}-base"
"${MINGW_PACKAGE_PREFIX}-cc")
conflicts=("${MINGW_PACKAGE_PREFIX}-${_realname}-base"
$([[ "$_enable_objc" != "yes" ]] && echo "${MINGW_PACKAGE_PREFIX}-${_realname}-objc" || true)
$([[ "$_enable_ada" != "yes" ]] && echo "${MINGW_PACKAGE_PREFIX}-${_realname}-ada" || true)
$([[ "$_enable_rust" != "yes" ]] && echo "${MINGW_PACKAGE_PREFIX}-${_realname}-rust" || true)
$([[ "$_enable_jit" != "yes" ]] && echo "${MINGW_PACKAGE_PREFIX}-libgccjit" || true)
)
groups=("${MINGW_PACKAGE_PREFIX}-toolchain")
cd "${srcdir}"/build-${MSYSTEM}
make -C gcc DESTDIR="${pkgdir}" install-driver install-cpp install-gcc-ar \
c++.install-common install-headers install-plugin install-lto-wrapper
make -C c++tools DESTDIR="${pkgdir}" install
install -m755 -t "${pkgdir}"${MINGW_PREFIX}/bin/ gcc/gcov{,-tool}.exe
install -m755 -t "${pkgdir}"${MINGW_PREFIX}/${_libdir}/ \
gcc/{cc1,cc1plus,collect2,lto1}.exe
make -C $CHOST/libgcc DESTDIR="${pkgdir}" install
rm "${pkgdir}"/libgcc_*.dll
make -C $CHOST/libstdc++-v3/src DESTDIR="${pkgdir}" install
make -C $CHOST/libstdc++-v3/include DESTDIR="${pkgdir}" install
make -C $CHOST/libstdc++-v3/libsupc++ DESTDIR="${pkgdir}" install
make -C $CHOST/libstdc++-v3/python DESTDIR="${pkgdir}" install
make DESTDIR="${pkgdir}" install-libcc1
rm "${pkgdir}"${MINGW_PREFIX}/bin/libstdc++*.dll
for lib in libatomic libgomp libquadmath; do
make -C $CHOST/$lib DESTDIR="${pkgdir}" install
rm "${pkgdir}"${MINGW_PREFIX}/bin/${lib}*.dll
done
rm -r "${pkgdir}"${MINGW_PREFIX}/${_libdir}/finclude
# install -d "${pkgdir}"${MINGW_PREFIX}/share/gdb/auto-load/usr/lib
# mv "${pkgdir}"${MINGW_PREFIX}/lib/libstdc++.dll.a-gdb.py \
# "${pkgdir}"${MINGW_PREFIX}/share/gdb/auto-load/usr/lib/
make DESTDIR="${pkgdir}" install-fixincludes
make -C gcc DESTDIR="${pkgdir}" install-mkheaders
make -C lto-plugin DESTDIR="${pkgdir}" install
install -dm755 "${pkgdir}"${MINGW_PREFIX}/lib/bfd-plugins/
cp "${pkgdir}"${MINGW_PREFIX}/${_libdir}/liblto_plugin.dll "${pkgdir}"${MINGW_PREFIX}/lib/bfd-plugins/
make -C $CHOST/libgomp DESTDIR="${pkgdir}" install-nodist_{libsubinclude,toolexeclib}HEADERS
make -C $CHOST/libquadmath DESTDIR="${pkgdir}" install-nodist_libsubincludeHEADERS
make -C gcc DESTDIR="${pkgdir}" install-man install-info
rm "${pkgdir}"${MINGW_PREFIX}/share/man/man1/{gfortran,lto-dump}.1
rm "${pkgdir}"${MINGW_PREFIX}/share/info/gfortran.info
if [ "$_enable_ada" == "yes" ]; then
rm "${pkgdir}"${MINGW_PREFIX}/share/info/{gnat-style,gnat_rm,gnat_ugn}.info
fi
if [ "$_enable_jit" == "yes" ]; then
rm "${pkgdir}"${MINGW_PREFIX}/share/info/libgccjit.info
fi
make -C libcpp DESTDIR="${pkgdir}" install
make -C gcc DESTDIR="${pkgdir}" install-po
# make -C $CHOST/libstdc++-v3/doc DESTDIR="${pkgdir}" doc-install-man
cp "${pkgdir}"${MINGW_PREFIX}/bin/gcc.exe "${pkgdir}"${MINGW_PREFIX}/bin/cc.exe
cp "${pkgdir}"${MINGW_PREFIX}/bin/gcc.exe "${pkgdir}"${MINGW_PREFIX}/bin/${CHOST}-cc.exe
# install "custom" system gdbinit
install -D -m644 "${srcdir}"/gdbinit "${pkgdir}"${MINGW_PREFIX}/etc/gdbinit
sed -i 's|%GCC_NAME%|gcc-'${pkgver%%+*}'|g' "${pkgdir}"${MINGW_PREFIX}/etc/gdbinit
# byte-compile python libraries
${MINGW_PREFIX}/bin/python -m compileall -o 0 -o 1 "${pkgdir}"${MINGW_PREFIX}/share/gcc-${pkgver%%+*}/
}
package_gcc-libgfortran() {
pkgdesc="GNU Compiler Collection (libgfortran) for MinGW-w64"
depends=("${MINGW_PACKAGE_PREFIX}-${_realname}-libs=${pkgver}-${pkgrel}"
"${MINGW_PACKAGE_PREFIX}-libwinpthread")
provides=("${MINGW_PACKAGE_PREFIX}-fc-libs")
cd "${srcdir}"/build-${MSYSTEM}
make -C $CHOST/libgfortran DESTDIR="${pkgdir}" install-toolexeclibLTLIBRARIES
rm -r "${pkgdir}"${MINGW_PREFIX}/lib
install -Dm644 "${srcdir}"/${_sourcedir}/COPYING.RUNTIME "${pkgdir}"${MINGW_PREFIX}/share/licenses/${_realname}-libgfortran/COPYING.RUNTIME
}
package_gcc-fortran() {
pkgdesc="GNU Compiler Collection (Fortran) for MinGW-w64"
depends=("${MINGW_PACKAGE_PREFIX}-${_realname}=${pkgver}-${pkgrel}"
"${MINGW_PACKAGE_PREFIX}-${_realname}-libgfortran=${pkgver}-${pkgrel}"
"${MINGW_PACKAGE_PREFIX}-${_realname}-libs=${pkgver}-${pkgrel}"
"${MINGW_PACKAGE_PREFIX}-gmp"
"${MINGW_PACKAGE_PREFIX}-isl"
"${MINGW_PACKAGE_PREFIX}-libwinpthread"
"${MINGW_PACKAGE_PREFIX}-mpc"
"${MINGW_PACKAGE_PREFIX}-mpfr"
"${MINGW_PACKAGE_PREFIX}-zlib"
"${MINGW_PACKAGE_PREFIX}-zstd")
provides=("${MINGW_PACKAGE_PREFIX}-fc")
cd "${srcdir}"/build-${MSYSTEM}
make -C $CHOST/libgfortran DESTDIR="${pkgdir}" install
rm "${pkgdir}"${MINGW_PREFIX}/bin/libgfortran*.dll
make -C $CHOST/libgomp DESTDIR="${pkgdir}" install-nodist_fincludeHEADERS
make -C gcc DESTDIR="${pkgdir}" fortran.install-{common,man,info}
install -Dm755 gcc/f951.exe "${pkgdir}"${MINGW_PREFIX}/${_libdir}/f951.exe
}
package_gcc-ada() {
pkgdesc="GNU Compiler Collection (Ada) for MinGW-w64"
depends=("${MINGW_PACKAGE_PREFIX}-${_realname}=${pkgver}-${pkgrel}"
"${MINGW_PACKAGE_PREFIX}-${_realname}-libs=${pkgver}-${pkgrel}"
"${MINGW_PACKAGE_PREFIX}-gmp"
"${MINGW_PACKAGE_PREFIX}-isl"
"${MINGW_PACKAGE_PREFIX}-libwinpthread"
"${MINGW_PACKAGE_PREFIX}-mpc"
"${MINGW_PACKAGE_PREFIX}-mpfr"
"${MINGW_PACKAGE_PREFIX}-zlib"
"${MINGW_PACKAGE_PREFIX}-zstd")
cd "${srcdir}"/build-${MSYSTEM}
make -C gcc DESTDIR="${pkgdir}" ada.install-{common,info} install-gnatlib
mv "${pkgdir}"${MINGW_PREFIX}/${_libdir}/adalib/*.dll "${pkgdir}"${MINGW_PREFIX}/bin/
install -m755 gcc/gnat1.exe "${pkgdir}"${MINGW_PREFIX}/${_libdir}
}
package_gcc-objc() {
pkgdesc="GNU Compiler Collection (ObjC,Obj-C++) for MinGW-w64"
depends=("${MINGW_PACKAGE_PREFIX}-${_realname}=${pkgver}-${pkgrel}"
"${MINGW_PACKAGE_PREFIX}-${_realname}-libs=${pkgver}-${pkgrel}"
"${MINGW_PACKAGE_PREFIX}-gmp"
"${MINGW_PACKAGE_PREFIX}-isl"
"${MINGW_PACKAGE_PREFIX}-libwinpthread"
"${MINGW_PACKAGE_PREFIX}-mpc"
"${MINGW_PACKAGE_PREFIX}-mpfr"
"${MINGW_PACKAGE_PREFIX}-zlib"
"${MINGW_PACKAGE_PREFIX}-zstd")
cd "${srcdir}"/build-${MSYSTEM}
make -C $CHOST/libobjc DESTDIR="${pkgdir}" install-libs
make -C $CHOST/libobjc DESTDIR="${pkgdir}" install-headers
install -dm755 "${pkgdir}"${MINGW_PREFIX}/${_libdir}
install -m755 gcc/cc1obj{,plus}.exe "${pkgdir}"${MINGW_PREFIX}/${_libdir}/
install -Dm644 "${srcdir}/${_sourcedir}/COPYING.RUNTIME" "${pkgdir}"${MINGW_PREFIX}/share/licenses/${_realname}-objc/COPYING.RUNTIME
}
package_gcc-rust() {
pkgdesc="GNU Compiler Collection (Rust) for MinGW-w64"
depends=("${MINGW_PACKAGE_PREFIX}-${_realname}=${pkgver}-${pkgrel}"
"${MINGW_PACKAGE_PREFIX}-${_realname}-libs=${pkgver}-${pkgrel}"
"${MINGW_PACKAGE_PREFIX}-gmp"
"${MINGW_PACKAGE_PREFIX}-isl"
"${MINGW_PACKAGE_PREFIX}-libwinpthread"
"${MINGW_PACKAGE_PREFIX}-mpc"
"${MINGW_PACKAGE_PREFIX}-mpfr"
"${MINGW_PACKAGE_PREFIX}-zlib"
"${MINGW_PACKAGE_PREFIX}-zstd")
cd "${srcdir}"/build-${MSYSTEM}
make -C gcc DESTDIR="${pkgdir}" rust.install-{common,man,info}
install -Dm755 gcc/crab1.exe "${pkgdir}"${MINGW_PREFIX}/${_libdir}/crab1.exe
}
package_gcc-lto-dump() {
pkgdesc="Dump link time optimization object files (mingw-w64)"
depends=("${MINGW_PACKAGE_PREFIX}-${_realname}=$pkgver-$pkgrel"
"${MINGW_PACKAGE_PREFIX}-${_realname}-libs=${pkgver}-${pkgrel}"
"${MINGW_PACKAGE_PREFIX}-gmp"
"${MINGW_PACKAGE_PREFIX}-isl"
"${MINGW_PACKAGE_PREFIX}-libwinpthread"
"${MINGW_PACKAGE_PREFIX}-mpc"
"${MINGW_PACKAGE_PREFIX}-mpfr"
"${MINGW_PACKAGE_PREFIX}-zlib"
"${MINGW_PACKAGE_PREFIX}-zstd")
cd "${srcdir}"/build-${MSYSTEM}
make -C gcc DESTDIR="${pkgdir}" lto.install-{common,man,info}
}
package_libgccjit() {
pkgdesc="GNU Compiler Collection (libgccjit) for MinGW-w64"
depends=("${MINGW_PACKAGE_PREFIX}-${_realname}=${pkgver}-${pkgrel}"
"${MINGW_PACKAGE_PREFIX}-${_realname}-libs=${pkgver}-${pkgrel}"
"${MINGW_PACKAGE_PREFIX}-gmp"
"${MINGW_PACKAGE_PREFIX}-isl"
"${MINGW_PACKAGE_PREFIX}-libwinpthread"
"${MINGW_PACKAGE_PREFIX}-mpc"
"${MINGW_PACKAGE_PREFIX}-mpfr"
"${MINGW_PACKAGE_PREFIX}-zlib"
"${MINGW_PACKAGE_PREFIX}-zstd")
cd "${srcdir}"/build-${MSYSTEM}
make -C gcc DESTDIR="${pkgdir}" jit.install-common jit.install-info
}
# template start; name=mingw-w64-splitpkg-wrappers; version=1.0;
# vim: set ft=bash :
# generate wrappers
for _name in "${pkgname[@]}"; do
_short="package_${_name#${MINGW_PACKAGE_PREFIX}-}"
_func="$(declare -f "${_short}")"
eval "${_func/#${_short}/package_${_name}}"
done
# template end;