updated buildpkg for suport CROSS_COMPILE

This commit is contained in:
wt committed 2025-09-29 15:56:36 +07:00
1 parent 73750d289b
commit 42da0fb84f
1 file changed
+8 -4
+8 -4
View File
@@ -389,10 +389,10 @@ buildpkg() {
printf "$BBLUE**$BWHITE $pkgname-$pkgver-$pkgrel.pkg.gz already exists please use -r to rebuild [$YELLOW WARNING $BWHITE]\n$RESET" printf "$BBLUE**$BWHITE $pkgname-$pkgver-$pkgrel.pkg.gz already exists please use -r to rebuild [$YELLOW WARNING $BWHITE]\n$RESET"
exit 0 exit 0
else else
[ -d pkg ] && rm -r pkg [ -d pkg ] && rm -rf pkg
[ -d src ] && rm -r src [ -d src ] && rm -rf src
[ -f $pkgname-$pkgver-$pkgrel.pkg.gz ] \ [ -f $pkgname-$pkgver-$pkgrel.pkg.gz ] \
&& rm -r $pkgname-$pkgver-$pkgrel.pkg.gz && rm -rf $pkgname-$pkgver-$pkgrel.pkg.gz
fi fi
fi fi
[ ! -d src ] && mkdir -p src [ ! -d src ] && mkdir -p src
@@ -431,8 +431,12 @@ buildpkg() {
echo "no package" echo "no package"
fi fi
printf "$BBLUE**$BWHITE Stripping unneded symbols\n$RESET" printf "$BBLUE**$BWHITE Stripping unneded symbols\n$RESET"
STRIP=$(which strip)
if [ -n "$CROSS_COMPILE" ]; then
STRIP=$CROSS_COMPILE-strip
fi
for execfile in $(find $pkgdir -executable -type f); do for execfile in $(find $pkgdir -executable -type f); do
strip $execfile $STRIP $execfile
done done
printf "$BBLUE**$BWHITE Strip unneded symbols [$BGREEN SUCCESS $BWHITE]\n$RESET" printf "$BBLUE**$BWHITE Strip unneded symbols [$BGREEN SUCCESS $BWHITE]\n$RESET"
cd $pkgdir cd $pkgdir