2022-03-20 13:19:37 +01:00
|
|
|
#!/usr/bin/bash
|
|
|
|
# JOBoRun : Jwm OpenBox Obarun RUNit
|
2022-04-25 11:02:36 +02:00
|
|
|
# Maintainer : Joe Bo Run <joborun@disroot.org>
|
|
|
|
# PkgSource : url="https://gittea.disroot.org/joborun-pkg/jobcore/$pkgname"
|
|
|
|
# Website : https://pozol.eu
|
2022-03-20 13:19:37 +01:00
|
|
|
#-----------------------------------------| DESCRIPTION |---------------------------------------
|
|
|
|
|
|
|
|
pkgbase=brotli
|
|
|
|
pkgname=('brotli' 'python-brotli' 'brotli-testdata')
|
|
|
|
_gitcommit=e61745a6b7add50d380cfd7d3883dd6c62fc2c71
|
|
|
|
pkgver=1.0.9
|
2023-01-31 21:17:45 +01:00
|
|
|
pkgrel=010
|
2022-03-20 13:19:37 +01:00
|
|
|
pkgdesc='Generic-purpose lossless compression algorithm'
|
|
|
|
url='https://github.com/google/brotli'
|
|
|
|
arch=('x86_64')
|
2023-01-31 21:17:45 +01:00
|
|
|
makedepends=('git' 'cmake' 'python-setuptools')
|
2022-11-19 18:17:37 +01:00
|
|
|
# options=('debug') ## uncomment this to produce the debug pkg
|
2022-03-20 13:19:37 +01:00
|
|
|
source=(${pkgname}::"git+${url}#commit=${_gitcommit}")
|
|
|
|
|
|
|
|
prepare() {
|
|
|
|
cd ${pkgbase}
|
|
|
|
git cherry-pick -n 09b0992b6acb7faa6fd3b23f9bc036ea117230fc # Fix broken Libs: in pc file
|
|
|
|
}
|
|
|
|
|
|
|
|
pkgver() {
|
|
|
|
cd ${pkgbase}
|
|
|
|
git describe --tags --match 'v*' | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
|
|
|
|
}
|
|
|
|
|
|
|
|
build() {
|
|
|
|
cd ${pkgbase}
|
|
|
|
python setup.py build
|
2022-11-19 18:17:37 +01:00
|
|
|
cmake -S . -B build \
|
2022-03-20 13:19:37 +01:00
|
|
|
-DCMAKE_BUILD_TYPE=Release \
|
|
|
|
-DCMAKE_INSTALL_PREFIX=/usr \
|
2022-04-25 11:02:36 +02:00
|
|
|
-DBUILD_SHARED_LIBS=True \
|
|
|
|
-DCMAKE_C_FLAGS="$CFLAGS -ffat-lto-objects"
|
2022-11-19 18:17:37 +01:00
|
|
|
cmake --build build -v
|
2022-03-20 13:19:37 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
check() {
|
|
|
|
cd ${pkgbase}
|
2023-01-31 21:17:45 +01:00
|
|
|
local python_version=$(python -c 'import sys; print("".join(map(str, sys.version_info[:2])))')
|
|
|
|
PYTHONPATH="$PWD/bin/lib.linux-$CARCH-cpython-${python_version}" python -m unittest discover python "*_test.py"
|
|
|
|
|
2022-11-19 18:17:37 +01:00
|
|
|
cd build
|
|
|
|
ctest --output-on-failure --stop-on-failure -j$(nproc)
|
2023-01-31 21:17:45 +01:00
|
|
|
|
|
|
|
|
2022-03-20 13:19:37 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
package_brotli() {
|
2023-01-31 21:17:45 +01:00
|
|
|
depends=('glibc')
|
2022-03-20 13:19:37 +01:00
|
|
|
provides=(libbrotlicommon.so libbrotlidec.so libbrotlienc.so)
|
|
|
|
|
|
|
|
cd ${pkgbase}
|
2022-11-19 18:17:37 +01:00
|
|
|
DESTDIR="$pkgdir" cmake --install build
|
|
|
|
local man
|
2022-03-20 13:19:37 +01:00
|
|
|
for man in docs/*.?; do
|
|
|
|
install -Dm 644 "$man" "$pkgdir/usr/share/man/man${man##*.}/${man##*/}"
|
|
|
|
done
|
|
|
|
install -Dm 644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname"
|
|
|
|
}
|
|
|
|
|
|
|
|
package_python-brotli() {
|
|
|
|
pkgdesc+=' - python library'
|
2023-01-31 21:17:45 +01:00
|
|
|
depends=('python')
|
2022-03-20 13:19:37 +01:00
|
|
|
|
|
|
|
cd ${pkgbase}
|
|
|
|
python setup.py install --skip-build -O1 --root="$pkgdir"
|
|
|
|
install -Dm 644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname"
|
|
|
|
}
|
|
|
|
|
|
|
|
package_brotli-testdata() {
|
|
|
|
pkgdesc+=' - test data'
|
|
|
|
depends=()
|
|
|
|
|
|
|
|
cd ${pkgbase}
|
|
|
|
install -dm755 "$pkgdir"/usr/share/brotli
|
|
|
|
cp -a tests/testdata "$pkgdir"/usr/share/brotli/
|
|
|
|
install -Dm 644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname"
|
|
|
|
}
|
|
|
|
|
2022-09-03 00:50:45 +02:00
|
|
|
#---- license gpg-key sha256sums ----
|
2022-03-20 13:19:37 +01:00
|
|
|
|
|
|
|
license=('MIT')
|
|
|
|
|
2022-04-25 11:02:36 +02:00
|
|
|
sha256sums=(SKIP)
|
2022-11-19 18:17:37 +01:00
|
|
|
|
2023-01-31 21:17:45 +01:00
|
|
|
# b754bfc91460158839077b4494f25d6e56515f1d032e50b01144ba3d029514c1 brotli-1.0.9-10-x86_64.pkg.tar.xz
|
|
|
|
# 5bc48044a812ef0d3e522d790e78f83f15421b61eaa401eef9d2753fcf44925c brotli-testdata-1.0.9-10-x86_64.pkg.tar.xz
|
|
|
|
# beb6286729ad6b0723bf3d9d5d14661556092634b2d133c5e8dcd007064a4cf5 python-brotli-1.0.9-10-x86_64.pkg.tar.xz
|
2022-11-19 18:17:37 +01:00
|
|
|
|