diff options
author | Ilya Basin | 2018-03-27 16:46:44 +0300 |
---|---|---|
committer | Ilya Basin | 2018-03-27 16:46:44 +0300 |
commit | 195c6acd48a51622ca143cb3a26bede47eef02ec (patch) | |
tree | 3740cbedcbf5fba69de6be965bf6361bcb24b1f0 | |
parent | b732498c534c8dd0321739e011698abd164b0537 (diff) | |
download | aur-195c6acd48a51622ca143cb3a26bede47eef02ec.tar.gz |
check output binaries arch
-rw-r--r-- | PKGBUILD | 26 |
1 files changed, 25 insertions, 1 deletions
@@ -38,7 +38,7 @@ prepare() { } build() { - unset CFLAGS + unset CFLAGS CXXLAGS cd $_pkgname-$pkgver if true; then ./configure \ @@ -56,6 +56,30 @@ fi make } +check() { + local s readelfarch + readelfarch='AArch64' + cd $_pkgname-$pkgver + + s=$(find . -type f "(" -name "*.so*" -o -name "*.a" ")" -print0 | \ + 2>/dev/null LC_ALL=C xargs -0 readelf -h | \ + sed -n -e '/File:/h;/Machine:/{/'"$readelfarch"'/!{H;x;p}}' | head -10) + + if [ -n "$s" ]; then + >&2 echo "some binaries have wrong architecture:" + >&2 echo "$s" + return 1 + fi +} + +strip() { + ${_target}-strip "$@" +} + +objcopy() { + ${_target}-objcopy "$@" +} + package() { cd $_pkgname-$pkgver make DESTDIR="$pkgdir" install |