forked from msys2/MINGW-packages
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathPKGBUILD
46 lines (40 loc) · 1.58 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
# Maintainer: Diego Sogari <[email protected]>
# Contributor: Konstantin Podsvirov <[email protected]>
_realname=binaryen
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=105
pkgrel=2
pkgdesc="Compiler infrastructure and toolchain library for WebAssembly, in C++ (mingw-w64)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32')
url="https://github.com/WebAssembly/binaryen"
license=('Apache')
depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs")
makedepends=("${MINGW_PACKAGE_PREFIX}-cmake"
"${MINGW_PACKAGE_PREFIX}-cc"
"${MINGW_PACKAGE_PREFIX}-ninja")
source=("${_realname}-${pkgver}.tar.gz::https://github.com/WebAssembly/binaryen/archive/version_${pkgver}.tar.gz")
sha256sums=('c5ec27c157d3b33ce4360607cc6afe565fa490094237895db2162b3a7d667da2')
build() {
[[ -d "${srcdir}/build-${MSYSTEM}" ]] && rm -rf "${srcdir}/build-${MSYSTEM}"
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.exe \
-G"Ninja" \
-DCMAKE_INSTALL_PREFIX=${MINGW_PREFIX} \
${extra_config} \
"../${_realname}-version_${pkgver}"
cmake --build .
}
package() {
cd "${srcdir}/build-${MSYSTEM}"
DESTDIR="${pkgdir}" cmake --install .
install -Dm644 ${srcdir}/${_realname}-version_${pkgver}/LICENSE ${okgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE
}