Christoph Reiter 619a8198e5 Add some CPEs
2024-03-26 11:53:19 +01:00

572 lines
23 KiB
Bash

# 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>
_enable_ada=yes
_enable_objc=yes
_enable_rust=no
_enable_jit=yes
_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")
)
#_snapshot=20181214
pkgver=13.2.0
#_majorver=${pkgver:0:1}
#_sourcedir=${_realname}-${_majorver}-${_snapshot}
_sourcedir=${_realname}-${pkgver}
_libdir=lib/gcc/${CHOST}/${pkgver%%+*}
pkgrel=5
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")
"${MINGW_PACKAGE_PREFIX}-binutils"
"${MINGW_PACKAGE_PREFIX}-crt"
"${MINGW_PACKAGE_PREFIX}-headers"
"${MINGW_PACKAGE_PREFIX}-gmp"
"${MINGW_PACKAGE_PREFIX}-isl"
"${MINGW_PACKAGE_PREFIX}-libiconv"
"${MINGW_PACKAGE_PREFIX}-mpc"
"${MINGW_PACKAGE_PREFIX}-mpfr"
"${MINGW_PACKAGE_PREFIX}-windows-default-manifest"
"${MINGW_PACKAGE_PREFIX}-winpthreads"
"${MINGW_PACKAGE_PREFIX}-zlib"
"${MINGW_PACKAGE_PREFIX}-zstd"
"${MINGW_PACKAGE_PREFIX}-gperf"
"${MINGW_PACKAGE_PREFIX}-autotools")
options=('!emptydirs') # '!strip' 'debug')
source=("https://ftp.gnu.org/gnu/gcc/${_realname}-${pkgver%%+*}/${_realname}-${pkgver}.tar.xz"{,.sig}
#https://www.mirrorservice.org/sites/sourceware.org/pub/gcc/snapshots/${_majorver}-${_snapshot}/gcc-${_majorver}-${_snapshot}.tar.xz
"gdbinit"
0002-Relocate-libintl.patch
0003-Windows-Follow-Posix-dir-exists-semantics-more-close.patch
0005-Windows-Don-t-ignore-native-system-header-dir.patch
0006-Windows-New-feature-to-allow-overriding.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
0300-override-builtin-printf-format.patch
2000-enable-rust.patch
2001-fix-building-rust-on-mingw-w64.patch
"2f7e7bfa3c6327793cdcdcb5c770b93cecd49bd0.patch"
"3eeb4801d6f45f6250fc77a6d3ab4e0115f8cfdd.patch"
"777aa930b106fea2dd6ed9fe22b42a2717f1472d.patch")
sha256sums=('e275e76442a6067341a27f04c5c6b83d8613144004c0413528863dc6b5c743da'
'SKIP'
'bce81824fc89e5e62cca350de4c17a27e27a18a1a1ad5ca3492aec1fc5af3234'
'3fab890be4b0d4e9e309749c4de5ce00f069eee4fe6080baa100f768264e6218'
'3fc35067823f87e48dd3bfd265e7593000dc110fa9ad5f16c81b896765fc897a'
'57f0081655ba9a94ed7cc3d8b67a79aee8442a56613bd17f9809a7b0e68e43cd'
'a3637466910fae6145c947095051e3b91b16e4715d4abddc474eeb00539e9dc2'
'90d5cb570083f9dea4ac0f0f87e3e8d2230f5052e6f9b946061a20a224a9d195'
'8a40ea004a803b7e6aabd6c58d859502a57c87755dbcfedbdfed161f2fb7eb62'
'5ef4148acc4a2b7ed648d4fe75fab5545e84b4b93a12d6ba4e4ea6061dd635fa'
'e98805ead7d78ee2a92f237894c4b2b7ddc1688e1b517d8c04f28d440202e40f'
'fd9bdecb2bbc4796bbc9f00b708dac42ef9e3464a06d6d27e5475cee117de5be'
'ad1f7b5e7afaaec008b7cbd14feea13a10989fa91bda7003af72d457619bb199'
'6c272078340a27b3f147e497115b0a6e9fc0da720a2602f12b086524522caa59'
'e0a5b470f49a29f20215cc9f9d04c1cb9969dff6f0e546542799d3a693ef1c84'
'c34f9e71b5a092be1987ad4c65891742c74c9eb8ef6560100e751cd31375f579'
'f73c8d1701762fed7d8102d17d8e4416a4cc5e600e297a89c2e1fe09cd743a1c'
'693a91a863a706b3526af01c9de5ce8295c59ef0f56f009bcfbf79a93cba2728'
'e78d51c908cd4e5c905c62e8350db1c609479bb95333c67f706b56974226fd94'
'74c4693850f6c96992d43414f88e9f16ab1a5d1458f5e4dc76ac3ce435a80eef'
'8dc297c658911ead58cd06407b853bbe82c2c3da1ad24cbcc7b01f3c7b5f666b'
'b0a98a41fea4a68f15d35b44495a487183a4d85ea9cb70cd4a645b4ed6583122')
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}
del_file_exists intl/canonicalize.c intl/canonicalize.h \
intl/relocatex.c intl/relocatex.h
apply_patch_with_msg \
0002-Relocate-libintl.patch \
0003-Windows-Follow-Posix-dir-exists-semantics-more-close.patch \
0005-Windows-Don-t-ignore-native-system-header-dir.patch \
0006-Windows-New-feature-to-allow-overriding.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
# Patch from https://gcc.gnu.org/pipermail/gcc-patches/2022-January/588341.html
# Related bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95130
apply_patch_with_msg \
0300-override-builtin-printf-format.patch
# https://salsa.debian.org/toolchain-team/gcc/-/blob/b953a3f9/debian/patches/rust-enabled.diff
apply_patch_with_msg \
2000-enable-rust.patch
apply_patch_with_msg \
2001-fix-building-rust-on-mingw-w64.patch
# backport: https://github.com/msys2/MINGW-packages/issues/17599
# https://inbox.sourceware.org/gcc-patches/a22433f5-b4d2-19b7-86a2-31e2ee45fb61@martin.st/T/
# https://gcc.gnu.org/git/?p=gcc.git;a=patch;h=2f7e7bfa3c6327793cdcdcb5c770b93cecd49bd0
# https://gcc.gnu.org/git/?p=gcc.git;a=patch;h=3eeb4801d6f45f6250fc77a6d3ab4e0115f8cfdd
apply_patch_with_msg \
2f7e7bfa3c6327793cdcdcb5c770b93cecd49bd0.patch \
3eeb4801d6f45f6250fc77a6d3ab4e0115f8cfdd.patch
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110315#c7
apply_patch_with_msg \
777aa930b106fea2dd6ed9fe22b42a2717f1472d.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
case "${CARCH}" in
i686)
extra_config+=(
"--disable-sjlj-exceptions"
"--with-dwarf2"
)
LDFLAGS+=" -Wl,--large-address-aware"
local _arch=pentium4
;;
x86_64)
local _arch=nocona
;;
esac
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:
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}-libiconv"
"${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")
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/gccrs.exe "${pkgdir}"${MINGW_PREFIX}/bin/gccrs.exe
install -Dm755 gcc/rust1.exe "${pkgdir}"${MINGW_PREFIX}/${_libdir}/rust1.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;