From affce504f84697c2ead180c3b493bdef9ffe07f7 Mon Sep 17 00:00:00 2001 From: emmett1 Date: Mon, 27 May 2019 15:34:07 +0800 Subject: [PATCH] add nostrip function to certain libraries --- pkgbuild | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/pkgbuild b/pkgbuild index bd1e79b..d0eefa2 100755 --- a/pkgbuild +++ b/pkgbuild @@ -264,7 +264,19 @@ removelibtool() { } strip_files() { - find . -type f 2>/dev/null | while read -r binary ; do + local xstrip + local FILTER + + if [ "$nostrip" ]; then + for i in ${nostrip[@]}; do + xstrip="$xstrip -e $i" + done + FILTER="grep -v $xstrip" + else + FILTER="cat" + fi + + find . -type f -printf "%P\n" 2>/dev/null | $FILTER | while read -r binary ; do case "$(file -bi "$binary")" in *application/x-sharedlib*) # Libraries (.so) strip --strip-unneeded "$binary" 2>/dev/null ;;