2024-01-02 18:46:39 +01:00
|
|
|
# Maintainer in AUR: drakkan <nicola.murino at gmail dot com>
|
2020-10-07 18:30:59 +02:00
|
|
|
|
2024-01-02 18:46:39 +01:00
|
|
|
# This version includes the static library as well (in contrast
|
|
|
|
# to the version found in the AUR).
|
2020-10-07 18:30:59 +02:00
|
|
|
|
|
|
|
pkgname=mingw-w64-brotli
|
|
|
|
_pkgname=brotli
|
2024-01-02 18:46:39 +01:00
|
|
|
_gitcommit=ed738e842d2fbdf2d6459e39267a633c4a9b2f5d
|
|
|
|
pkgver=1.1.0
|
2020-10-07 18:30:59 +02:00
|
|
|
pkgrel=2
|
|
|
|
pkgdesc='Brotli compression library (mingw-w64)'
|
|
|
|
arch=('any')
|
|
|
|
license=('MIT')
|
2024-01-02 18:46:39 +01:00
|
|
|
url='https://github.com/google/brotli.git'
|
2020-10-07 18:30:59 +02:00
|
|
|
depends=('mingw-w64-gcc')
|
|
|
|
makedepends=('mingw-w64-cmake' 'git')
|
|
|
|
options=('!buildflags' '!strip' 'staticlibs')
|
|
|
|
source=(${_pkgname}::"git+${url}#commit=${_gitcommit}")
|
|
|
|
sha512sums=('SKIP')
|
|
|
|
|
|
|
|
_architectures="i686-w64-mingw32 x86_64-w64-mingw32"
|
|
|
|
|
|
|
|
pkgver() {
|
|
|
|
cd ${_pkgname}
|
|
|
|
git describe --tags --match 'v*' | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
|
|
|
|
}
|
|
|
|
|
|
|
|
build() {
|
|
|
|
for _arch in ${_architectures}; do
|
|
|
|
cd "$srcdir"/${_pkgname}
|
|
|
|
mkdir -p build-${_arch} && pushd build-${_arch}
|
2024-01-02 18:46:39 +01:00
|
|
|
${_arch}-cmake -DBUILD_SHARED_LIBS=ON ..
|
|
|
|
make
|
|
|
|
popd
|
|
|
|
mkdir -p build-${_arch}-static && pushd build-${_arch}-static
|
|
|
|
${_arch}-cmake -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=/usr/$_arch/static ..
|
2020-10-07 18:30:59 +02:00
|
|
|
make
|
|
|
|
popd
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
package() {
|
|
|
|
for _arch in ${_architectures}; do
|
2024-01-02 18:46:39 +01:00
|
|
|
make -C "${srcdir}/${_pkgname}/build-${_arch}-static" DESTDIR="${pkgdir}" install
|
|
|
|
make -C "${srcdir}/${_pkgname}/build-${_arch}" DESTDIR="${pkgdir}" install
|
|
|
|
ln -s --verbose --relative --target-directory="$pkgdir"/usr/${_arch}/lib "$pkgdir"/usr/${_arch}/static/lib/*.a
|
2020-10-07 18:30:59 +02:00
|
|
|
find "${pkgdir}/usr/${_arch}" -name "*.exe" -exec ${_arch}-strip --strip-all {} \;
|
|
|
|
${_arch}-strip --strip-unneeded "$pkgdir"/usr/${_arch}/bin/*.dll
|
|
|
|
${_arch}-strip -g "$pkgdir"/usr/${_arch}/lib/*.a
|
|
|
|
if [[ $NO_EXECUTABLES ]]; then
|
|
|
|
find "${pkgdir}/usr/${_arch}" -name '*.exe' -delete
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
for file in "${pkgdir}"/usr/*/lib/pkgconfig/*.pc; do
|
|
|
|
sed -i 's| -R${libdir}||g' "$file"
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
# vim: ts=2 sw=2 et:
|