forked from msys2/MINGW-packages
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPKGBUILD
125 lines (114 loc) · 4.19 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
# Contributor: Mehdi Chinoune <mehdi.chinoune@hotmail.com>
_realname=ADIOS2
pkgbase=mingw-w64-${_realname,,}
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname,,}")
pkgver=2.10.1
pkgrel=5
pkgdesc="The Adaptable Input/Output System version 2 (mingw-w64)"
arch=(any)
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
url="https://adios2.readthedocs.io/en/latest/"
msys2_repository_url="https://github.com/ornladios/ADIOS2/"
msys2_references=(
'archlinux: adios2'
)
license=('spdx:Apache-2.0')
depends=("${MINGW_PACKAGE_PREFIX}-blosc2"
"${MINGW_PACKAGE_PREFIX}-bzip2"
"${MINGW_PACKAGE_PREFIX}-gcc-libs"
$([[ ${MINGW_PACKAGE_PREFIX} == *-clang-* ]] || echo "${MINGW_PACKAGE_PREFIX}-gcc-libgfortran")
"${MINGW_PACKAGE_PREFIX}-hdf5"
"${MINGW_PACKAGE_PREFIX}-libpng"
"${MINGW_PACKAGE_PREFIX}-libsodium"
"${MINGW_PACKAGE_PREFIX}-pugixml"
"${MINGW_PACKAGE_PREFIX}-yaml-cpp"
"${MINGW_PACKAGE_PREFIX}-sqlite3"
"${MINGW_PACKAGE_PREFIX}-zeromq"
"${MINGW_PACKAGE_PREFIX}-zlib")
makedepends=("${MINGW_PACKAGE_PREFIX}-cc"
"${MINGW_PACKAGE_PREFIX}-cmake"
"${MINGW_PACKAGE_PREFIX}-ninja"
"${MINGW_PACKAGE_PREFIX}-fc"
"${MINGW_PACKAGE_PREFIX}-libffi"
"${MINGW_PACKAGE_PREFIX}-nlohmann-json"
"${MINGW_PACKAGE_PREFIX}-pybind11"
"${MINGW_PACKAGE_PREFIX}-python"
"${MINGW_PACKAGE_PREFIX}-python-numpy")
source=(https://github.com/ornladios/ADIOS2/archive/v${pkgver}/${_realname}-${pkgver}.tar.gz
001-fix-build-on-mingw-w64.patch
002-fix-build-on-clangarm64.patch
003-no-regex_h-with-clang.patch)
sha256sums=('ce776f3a451994f4979c6bd6d946917a749290a37b7433c0254759b02695ad85'
'8058f2265602ad7fbf762b3f5d2a97a4efaaa9348ff97a72c017dc4302a14c27'
'0f365062c19c21cda137ccacbf1dd33bd00afdc3418299e2abae8aab5fba33b0'
'379fe5edf3df2474edfe6515e0592af681c17f082fb4885b5cd554bdee11cd36')
# 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}
apply_patch_with_msg \
001-fix-build-on-mingw-w64.patch \
002-fix-build-on-clangarm64.patch \
003-no-regex_h-with-clang.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
if [[ ${CARCH} == aarch64 ]]; then
_extra_config+=("-DDILL_NATIVE_ONLY=OFF" "-DDILL_IGNORE_NATIVE=ON")
fi
CFLAGS+=" -Wno-implicit-function-declaration -Wno-int-conversion" \
CXXFLAGS+=" -Wno-narrowing" \
LDFLAGS+=" -Wl,--export-all-symbols" \
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 \
-DADIOS2_USE_EXTERNAL_DEPENDENCIES=ON \
-DADIOS2_USE_Blosc2=ON \
-DADIOS2_USE_BZip2=ON \
-DADIOS2_USE_DataMan=ON \
-DADIOS2_USE_Fortran=ON \
-DADIOS2_USE_HDF5=ON \
-DADIOS2_USE_Python=ON \
-DADIOS2_USE_PNG=ON \
-DADIOS2_USE_ZeroMQ=ON \
-DADIOS2_USE_DataMan=OFF \
-DADIOS2_USE_DataSpaces=OFF \
-DADIOS2_USE_Endian_Reverse=OFF \
-DADIOS2_USE_IME=OFF \
-DADIOS2_USE_MGARD=OFF \
-DADIOS2_USE_MPI=OFF \
-DADIOS2_USE_Profiling=OFF \
-DADIOS2_USE_SST=OFF \
-DADIOS2_USE_SZ=OFF \
-DADIOS2_USE_ZFP=OFF \
-DPython_EXECUTABLE=${MINGW_PREFIX}/bin/python \
-DADIOS2_BUILD_EXAMPLES=OFF \
-DEVPATH_TRANSPORT_MODULES=OFF \
-DBUILD_TESTING=OFF \
../${_realname}-${pkgver}
${MINGW_PREFIX}/bin/cmake --build .
}
package() {
cd "${srcdir}/build-${MSYSTEM}"
DESTDIR="${pkgdir}" ${MINGW_PREFIX}/bin/cmake --install .
MSYS2_ARG_CONV_EXCL="-p" python -m compileall \
-o 0 -o 1 -q -s"${pkgdir}" -p"/" "${pkgdir}${MINGW_PREFIX}/lib"
install -D -m644 "${srcdir}"/${_realname}-${pkgver}/LICENSE \
"${pkgdir}"${MINGW_PREFIX}/share/${_realname,,}/LICENSE
}