jobextra/upx/PKGBUILD

68 lines
2.3 KiB
Bash

#!/usr/bin/bash
# JOBoRun : Jwm OpenBox Obarun RUNit
# Maintainer : Joe Bo Run <joborun@disroot.org>
# PkgSource : url="https://gittea.disroot.org/joborun-pkg/jobextra/$pkgname"
# Website : https://pozol.eu
#-----------------------------------------| DESCRIPTION |---------------------------------------
pkgname=upx
pkgver=4.2.2
pkgrel=01
pkgdesc='Extendable, high-performance executable packer for several executable formats'
url='https://github.com/upx/upx'
makedepends=(cmake git perl)
# https://github.com/upx/upx/tree/v4.2.2/vendor
# b='v4.2.2'; for x in doctest lzma-sdk ucl valgrind zlib; do echo "git+\$url-vendor-$x#commit=$(git ls-remote https://github.com/upx/upx-vendor-$x $b-upx-vendor | cut -b-40)"; done
source=(git+$url-vendor-doctest#commit=6f57b91261fef5d19fd1abd7b917eec847cc7389
git+$url-vendor-lzma-sdk#commit=f0b8d236c1bdf66532a198c983469da5c05593cf
git+$url-vendor-ucl#commit=2c68ae51994892b9080328617a84296ee55f0c80
git+$url-vendor-valgrind#commit=a196a50056be5e6ef0c5f7456e95b4234b799a33
git+$url-vendor-zlib#commit=93538c2b9403ec5b8ed673a3a5f3874430569b70
"git+$url#commit=099c3d829e80488af7395a4242b318877e980da4") # tag: v4.2.2
##
## Arch's -zlib ref didn't exist so it was replaced by what is found
##
prepare() {
cd $pkgname
# set up symbolic links for the vendor repos
for x in doctest lzma-sdk ucl valgrind zlib; do
rm -frv vendor/$x && ln -s "$srcdir/upx-vendor-$x" vendor/$x
done
}
build() {
make -C $pkgname \
CHECK_WHITESPACE=/bin/true \
CXXFLAGS_WERROR="" \
UPX_CMAKE_CONFIG_FLAGS='-D UPX_CONFIG_DISABLE_GITREV=1 -D UPX_CONFIG_DISABLE_SANITIZE=1 -D UPX_CONFIG_DISABLE_WERROR=1' \
UPX_LZMA_VERSION=0x465 \
UPX_LZMADIR="$srcdir"
}
check() {
# check that the version has the proper version number and not something like "git-877911+"
$pkgname/build/release/upx --help | grep -q "^UPX $pkgver" || exit 1
# Run tests
make -C $pkgname/build/release test
}
package() {
cd $pkgname
install -Dm755 build/release/upx "$pkgdir/usr/bin/upx"
install -Dm644 doc/upx.1 "$pkgdir/usr/share/man/man1/upx.1"
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
#---- arch license gpg-key & sha256sums ----
arch=(x86_64)
license=(custom GPL2)
sha256sums=(SKIP SKIP SKIP SKIP SKIP SKIP)
## 3cfaf78bdec0eee53260a006cf59135ed53f14aa5a2e506254a54f5b5075201e upx-4.2.2-01-x86_64.pkg.tar.lz