-
Notifications
You must be signed in to change notification settings - Fork 491
/
PKGBUILD
102 lines (89 loc) · 3.28 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
# Maintainer: Alexey Pavlov <alexpux@gmail.com>
# Contributor: Martell Malone <martellmalone@gmail.com>
_realname=headers
_mingw_suff=mingw-w64-cross
pkgbase="${_mingw_suff}-${_realname}"
_targetpkgs=("${_mingw_suff}-ucrt64-${_realname}" "${_mingw_suff}-mingw32-${_realname}" "${_mingw_suff}-mingw64-${_realname}")
pkgname=("${_mingw_suff}-${_realname}" "${_targetpkgs[@]}")
pkgver=12.0.0.r250.gc6bf4bdf6
pkgrel=1
pkgdesc="MinGW-w64 headers for cross-compiler"
arch=('i686' 'x86_64')
url="https://www.mingw-w64.org/"
msys2_repository_url="https://sourceforge.net/p/mingw-w64/mingw-w64/ci/master/tree/mingw-w64-headers"
license=('custom')
groups=("${_mingw_suff}-toolchain" "${_mingw_suff}")
makedepends=('git' 'autotools')
options=('!strip' '!libtool' '!emptydirs' '!buildflags')
_commit='c6bf4bdf6572bfd530833ebd7e2dccb1133b602d'
source=("mingw-w64"::"git+https://git.code.sf.net/p/mingw-w64/mingw-w64#commit=$_commit")
sha256sums=('3aafb8dadd7285254b9f6862bc359e99485c578d5bfb7ad9cad7d958547db291')
msys2_references=(
'archlinux: mingw-w64-headers'
'cpe: cpe:/a:mingw-w64:mingw-w64'
)
pkgver() {
cd "${srcdir}/mingw-w64"
git describe --long ${_commit} | sed 's/\([^-]*-g\)/r\1/;s/-/./g;s/^v//g'
}
_build() {
_target=$1
unset CC CXX
if [[ "${_target}" == "x86_64-w64-mingw32ucrt" ]]; then
_default_msvcrt=ucrt
_default_win32_winnt=0x603 # Windows 8.1
elif [[ "${_target}" == "aarch64-w64-mingw32" ]]; then
_default_msvcrt=ucrt
_default_win32_winnt=0xA00 # Windows 10
else
_default_msvcrt=msvcrt
_default_win32_winnt=0x601 # Windows 7
fi
msg "Configuring ${_target} headers"
mkdir -p ${srcdir}/headers-${_target} && cd ${srcdir}/headers-${_target}
${srcdir}/mingw-w64/mingw-w64-headers/configure \
--build=${CHOST} \
--host=${_target} \
--prefix=/opt/${_target} \
--enable-sdk=all \
--with-default-win32-winnt=${_default_win32_winnt} \
--with-default-msvcrt=${_default_msvcrt}
}
_package() {
_target=$1
msg "Installing ${_target} headers"
cd ${srcdir}/headers-${_target}
make DESTDIR=${pkgdir} install
rm ${pkgdir}/opt/${_target}/include/pthread_signal.h
rm ${pkgdir}/opt/${_target}/include/pthread_time.h
rm ${pkgdir}/opt/${_target}/include/pthread_unistd.h
}
build() {
for _pkg in "${_targetpkgs[@]}"; do
case "$_pkg" in
"${_mingw_suff}-ucrt64-${_realname}") _build "x86_64-w64-mingw32ucrt" ;;
"${_mingw_suff}-mingw32-${_realname}") _build "i686-w64-mingw32" ;;
"${_mingw_suff}-mingw64-${_realname}") _build "x86_64-w64-mingw32" ;;
"${_mingw_suff}-mingwarm64-${_realname}") _build "aarch64-w64-mingw32" ;;
esac
done
}
package_mingw-w64-cross-headers() {
pkgdesc+=" (meta package, for backward compatibility)"
provides=("${_mingw_suff}-${_realname}-git")
conflicts=("${_mingw_suff}-${_realname}-git")
replaces=("${_mingw_suff}-${_realname}-git")
depends=("${_targetpkgs[@]}")
}
package_mingw-w64-cross-ucrt64-headers() {
conflicts=("${_mingw_suff}-${_realname}<=12.0.0.r0.g819a6ec2e-1")
_package "x86_64-w64-mingw32ucrt"
}
package_mingw-w64-cross-mingw32-headers() {
conflicts=("${_mingw_suff}-${_realname}<=12.0.0.r0.g819a6ec2e-1")
_package "i686-w64-mingw32"
}
package_mingw-w64-cross-mingw64-headers() {
conflicts=("${_mingw_suff}-${_realname}<=12.0.0.r0.g819a6ec2e-1")
_package "x86_64-w64-mingw32"
}