This repository has been archived by the owner on May 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 295
/
Copy pathPKGBUILD
75 lines (67 loc) · 3.07 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
# Maintainer: Felix Yan <[email protected]>
pkgname=mingw-w64-gcc
pkgver=10.2.0
_islver=0.21
pkgrel=2
pkgdesc="Cross GCC for the MinGW-w64 cross-compiler"
arch=('x86_64' 'aarch64')
url="https://gcc.gnu.org"
license=('GPL' 'LGPL' 'FDL' 'custom')
groups=('mingw-w64-toolchain' 'mingw-w64')
depends=('zlib' 'libmpc' 'mingw-w64-crt' 'mingw-w64-binutils' 'mingw-w64-winpthreads' 'mingw-w64-headers')
makedepends=("gcc-ada>=${pkgver:0:2}")
options=('!strip' 'staticlibs' '!emptydirs' '!buildflags')
source=(https://ftp.gnu.org/gnu/gcc/gcc-$pkgver/gcc-$pkgver.tar.xz{,.sig}
"http://isl.gforge.inria.fr/isl-${_islver}.tar.bz2"
https://raw.githubusercontent.com/msys2/MINGW-packages/master/mingw-w64-gcc/0020-libgomp-Don-t-hard-code-MS-printf-attributes.patch)
validpgpkeys=(33C235A34C46AA3FFB293709A328C3A2C3C45C06 # Jakub Jelinek <[email protected]>
13975A70E63C361C73AE69EF6EEB81F8981C74C7) # [email protected]
sha512sums=('42ae38928bd2e8183af445da34220964eb690b675b1892bbeb7cd5bb62be499011ec9a93397dba5e2fb681afadfc6f2767d03b9035b44ba9be807187ae6dc65e'
'SKIP'
'48f3b8d90550e8ab28837b5757f87bf99cddec67769877e04942abef69bbe526ef4c863951d55dd89a6027dc09df48988c8df6029782f990aa4d5b67e65f6d53'
'8266eae8b3be5557e8cd79c21b6326db7cd83604db6d6ad83923798650fcd8d0f9f1f4ed424c816a48e91f21fb1852ab9272c73100b219f07d3bbb566bfd6fae')
_architectures="i686-w64-mingw32 x86_64-w64-mingw32"
prepare() {
ln -sf gcc-${pkgver/+/-} gcc
cd gcc
# https://sourceforge.net/p/mingw-w64/bugs/853/
patch -p1 -i ../0020-libgomp-Don-t-hard-code-MS-printf-attributes.patch
# mmapio.c:69:14: error: implicit declaration of function ‘getpagesize’
sed -i 's|\-Werror||g' libbacktrace/configure
# link isl for in-tree builds
ln -sf ../isl-${_islver} isl
}
build() {
for _arch in ${_architectures}; do
mkdir -p "$srcdir"/build-${_arch} && cd "$srcdir"/build-${_arch}
"$srcdir"/gcc/configure --prefix=/usr --libexecdir=/usr/lib \
--target=${_arch} \
--with-bugurl=https://bugs.archlinux.org/ \
--enable-languages=c,lto,c++,ada,objc,obj-c++,fortran \
--enable-shared --enable-static \
--enable-threads=posix --enable-fully-dynamic-string \
--enable-libstdcxx-time=yes --enable-libstdcxx-filesystem-ts=yes \
--with-system-zlib --enable-cloog-backend=isl \
--enable-lto --enable-libgomp \
--disable-multilib --enable-checking=release \
--disable-sjlj-exceptions --with-dwarf2
make
done
}
package() {
for _arch in ${_architectures}; do
cd "$srcdir"/build-${_arch}
make DESTDIR="$pkgdir" install
${_arch}-strip "$pkgdir"/usr/${_arch}/lib/*.dll
strip "$pkgdir"/usr/bin/${_arch}-*
strip "$pkgdir"/usr/lib/gcc/${_arch}/${pkgver}/{cc1*,collect2,gnat1,f951,lto*}
ln -s ${_arch}-gcc "$pkgdir"/usr/bin/${_arch}-cc
# mv dlls
mkdir -p "$pkgdir"/usr/${_arch}/bin/
mv "$pkgdir"/usr/${_arch}/lib/*.dll "$pkgdir"/usr/${_arch}/bin/
done
strip "$pkgdir"/usr/bin/*
# remove unnecessary files
rm -r "$pkgdir"/usr/share
rm "$pkgdir"/usr/lib/libcc1.*
}