-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
Copy pathPKGBUILD
144 lines (124 loc) · 4.77 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
# Maintainer: Alexey Pavlov <alexpux@gmail.com>
_realname=boost
pkgbase=mingw-w64-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}"
"${MINGW_PACKAGE_PREFIX}-${_realname}-libs")
pkgver=1.87.0
pkgrel=2
pkgdesc="Free peer-reviewed portable C++ source libraries"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clangarm64')
url="https://www.boost.org/"
msys2_repository_url="https://github.com/boostorg/boost"
msys2_references=(
'archlinux: boost'
"cpe: cpe:/a:boost:boost"
)
license=('spdx:BSL-1.0')
depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs"
"${MINGW_PACKAGE_PREFIX}-bzip2"
"${MINGW_PACKAGE_PREFIX}-icu"
"${MINGW_PACKAGE_PREFIX}-xz"
"${MINGW_PACKAGE_PREFIX}-zstd"
"${MINGW_PACKAGE_PREFIX}-zlib")
makedepends=("${MINGW_PACKAGE_PREFIX}-cc"
"${MINGW_PACKAGE_PREFIX}-cmake"
"${MINGW_PACKAGE_PREFIX}-ninja"
$([[ ${CARCH} == i686 ]] || echo \
"${MINGW_PACKAGE_PREFIX}-python" \
"${MINGW_PACKAGE_PREFIX}-python-numpy"))
source=(https://github.com/boostorg/boost/releases/download/boost-${pkgver}/boost-${pkgver}-cmake.tar.xz
0001-Fix-building-with-cmake-on-MINGW.patch
0002-No-Arch-in-library-name-tag.patch
0003-fix-build-context-with-CMake-on-arm64.patch
boost-1.63.0-python-test-PyImport_AppendInittab.patch)
sha256sums=('7da75f171837577a52bbf217e17f8ea576c7c246e4594d617bfde7fafd408be5'
'abc6c78a252165df1de504d854d942eb486d88f06a6423d8b99dfec6ab138170'
'ee45d199c0e578a8d670ee6c6fa46466a53a02690c94f9221c67bbc9ab3387dc'
'ac6f996db2d5e2e5870b1a2d26c3b7d022f09d5be94945451d90875e8d4ecda4'
'b22196b6415f5e1c0fe56b49a12ea7c20073b15a5f31907f363c7be38d70d628')
# Helper macros to help make tasks easier #
apply_patch_with_msg() {
for _patch in "$@"
do
msg2 "Applying ${_patch}"
patch -Nbp1 -i "${srcdir}/${_patch}"
done
}
prepare() {
cd "${srcdir}/${_realname}-${pkgver}"
# https://bugzilla.redhat.com/show_bug.cgi?id=1102667
apply_patch_with_msg \
boost-1.63.0-python-test-PyImport_AppendInittab.patch
apply_patch_with_msg \
0001-Fix-building-with-cmake-on-MINGW.patch \
0002-No-Arch-in-library-name-tag.patch \
0003-fix-build-context-with-CMake-on-arm64.patch
}
build() {
declare -a _extra_config
if check_option "debug" "n"; then
_extra_config+=("-DCMAKE_BUILD_TYPE=Release")
else
_extra_config+=("-DCMAKE_BUILD_TYPE=Debug")
fi
if [[ "${CARCH}" != "i686" ]]; then
_extra_config+=('-DBOOST_ENABLE_PYTHON=ON')
fi
MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \
${MINGW_PREFIX}/bin/cmake.exe \
-G'Ninja' \
-DCMAKE_INSTALL_PREFIX=${MINGW_PREFIX} \
"${_extra_config[@]}" \
-DBUILD_SHARED_LIBS="OFF" \
-DBOOST_INSTALL_LAYOUT=tagged \
-DBOOST_STACKTRACE_ENABLE_FROM_EXCEPTION=OFF \
-DPython_EXECUTABLE=${MINGW_PREFIX}/bin/python \
-DBUILD_TESTING=OFF \
-S ${_realname}-${pkgver} \
-B build-${MSYSTEM}-static
${MINGW_PREFIX}/bin/cmake --build build-${MSYSTEM}-static
MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \
${MINGW_PREFIX}/bin/cmake.exe \
-G'Ninja' \
-DCMAKE_INSTALL_PREFIX=${MINGW_PREFIX} \
"${_extra_config[@]}" \
-DBUILD_SHARED_LIBS="ON" \
-DBOOST_INSTALL_LAYOUT=tagged \
-DBOOST_STACKTRACE_ENABLE_FROM_EXCEPTION=OFF \
-DPython_EXECUTABLE=${MINGW_PREFIX}/bin/python \
-DBUILD_TESTING=OFF \
-S ${_realname}-${pkgver} \
-B build-${MSYSTEM}
${MINGW_PREFIX}/bin/cmake --build build-${MSYSTEM}
}
package_boost() {
pkgdesc+=" (mingw-w64)"
depends=("${MINGW_PACKAGE_PREFIX}-boost-libs")
if [[ ${CARCH} != i686 ]]; then
optdepends=("${MINGW_PACKAGE_PREFIX}-python: For Boost.Python"
"${MINGW_PACKAGE_PREFIX}-python-numpy: For Boost.Python (NumPy)")
fi
DESTDIR="${pkgdir}" ${MINGW_PREFIX}/bin/cmake.exe --install build-${MSYSTEM}-static
DESTDIR="${pkgdir}" ${MINGW_PREFIX}/bin/cmake.exe --install build-${MSYSTEM}
install -Dm644 "${srcdir}"/${_realname}-${pkgver}/LICENSE_1_0.txt \
"${pkgdir}"${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE
# split runtime libraries
mkdir -p dest${MINGW_PREFIX}/bin
mv "${pkgdir}${MINGW_PREFIX}"/bin/*.dll dest${MINGW_PREFIX}/bin/
}
package_boost-libs() {
pkgdesc+=" (runtime libraries) (mingw-w64)"
mv dest/* "${pkgdir}"
install -Dm644 "${srcdir}"/${_realname}-${pkgver}/LICENSE_1_0.txt \
"${pkgdir}"${MINGW_PREFIX}/share/licenses/${_realname}-libs/LICENSE
}
# 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;