forked from msys2/MINGW-packages
-
Notifications
You must be signed in to change notification settings - Fork 0
/
PKGBUILD
84 lines (72 loc) · 2.68 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
# Maintainer: Michał Łukowski <michal.lukowski@gmail.com>
_realname=abseil-cpp
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=20240722.0
pkgrel=3
pkgdesc="Abseil Common Libraries (C++) from Google (mingw-w64)"
arch=('any')
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
url="https://abseil.io"
msys2_repository_url="https://github.com/abseil/abseil-cpp"
msys2_references=(
'archlinux: abseil-cpp'
)
license=('spdx:Apache-2.0')
depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs"
"${MINGW_PACKAGE_PREFIX}-libwinpthread")
makedepends=("${MINGW_PACKAGE_PREFIX}-cc"
"${MINGW_PACKAGE_PREFIX}-cmake"
"${MINGW_PACKAGE_PREFIX}-ninja")
source=("https://github.com/abseil/abseil-cpp/archive/$pkgver/$_realname-$pkgver.tar.gz"
"0001-abseil-Fix-compiler-warnings.patch"
"0002-abseil-Remove-librt-library.patch"
"0003-fix-linking-abseil_dll.patch"
"0004-abseil-include-winstring.patch")
sha256sums=('f50e5ac311a81382da7fa75b97310e4b9006474f9560ac46f54a9967f07d4ae3'
'30fb7526d1c89f722dd0ce0c467e034370140fbf07a1ad4f91df301c7f442551'
'8946282db6a225b385729deb345b57e3ee75f4e859dbbc49ab7bc5604d71192f'
'67ee0328f1aa8e3ad24231b2e6ef6a78963218e087cc6a7230e2d4e61b27a741'
'92bfd39284ecf1fbbe77e022e7c8a2a6607ac831697497ece1fd70a829a34857')
apply_patch_with_msg() {
for _patch in "$@"
do
msg2 "Applying $_patch"
patch -Nbp1 -i "${srcdir}/$_patch"
done
}
prepare() {
cd "${_realname}-${pkgver}"
apply_patch_with_msg \
0001-abseil-Fix-compiler-warnings.patch \
0002-abseil-Remove-librt-library.patch \
0003-fix-linking-abseil_dll.patch
# https://github.com/abseil/abseil-cpp/commit/1d4466e8d3fdc153ad053f2ffd18f898e516f8f0
apply_patch_with_msg \
0004-abseil-include-winstring.patch
}
build() {
mkdir -p "${srcdir}/build-${MSYSTEM}" && cd "${srcdir}/build-${MSYSTEM}"
declare -a _extra_config
if check_option "debug" "n"; then
_extra_config+=("-DCMAKE_BUILD_TYPE=Release")
else
_extra_config+=("-DCMAKE_BUILD_TYPE=Debug")
fi
MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \
${MINGW_PREFIX}/bin/cmake \
-GNinja \
-DCMAKE_INSTALL_PREFIX=${MINGW_PREFIX} \
"${_extra_config[@]}" \
-DBUILD_SHARED_LIBS=ON \
-DCMAKE_DLL_NAME_WITH_SOVERSION=ON \
-DABSL_PROPAGATE_CXX_STD=ON \
-DCMAKE_CXX_STANDARD=17 \
../${_realname}-${pkgver}
${MINGW_PREFIX}/bin/cmake --build .
}
package() {
cd "${srcdir}/build-${MSYSTEM}"
DESTDIR="${pkgdir}" ${MINGW_PREFIX}/bin/cmake --install .
install -Dm644 "${srcdir}/${_realname}-${pkgver}/LICENSE" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE"
}