2018-02-09 18:49:17 +01:00
|
|
|
apply_patches() {
|
|
|
|
local PATCH
|
|
|
|
|
2018-02-15 23:47:54 +01:00
|
|
|
for PATCH in $SCRIPTDIR/pkg/$PKGNAME/*.patch; do
|
|
|
|
if [ -f $PATCH ]; then
|
|
|
|
patch -p1 < $PATCH
|
|
|
|
fi
|
2018-02-09 18:49:17 +01:00
|
|
|
done
|
|
|
|
}
|
2018-02-10 01:57:53 +01:00
|
|
|
|
2018-02-15 14:24:53 +01:00
|
|
|
strip_files() {
|
|
|
|
local f
|
|
|
|
|
|
|
|
for f in $@; do
|
2018-06-17 16:08:11 +02:00
|
|
|
[ ! -L "$f" ] || continue;
|
|
|
|
|
|
|
|
if [ -d "$f" ]; then
|
|
|
|
strip_files ${f}/*
|
2018-02-15 14:24:53 +01:00
|
|
|
fi
|
|
|
|
|
2018-06-17 16:08:11 +02:00
|
|
|
[ -f "$f" ] || continue;
|
|
|
|
|
2019-03-03 16:13:00 +01:00
|
|
|
if file -b $f | grep -q -i elf; then
|
2018-02-15 14:24:53 +01:00
|
|
|
${TARGET}-strip --discard-all "$f"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2018-06-17 13:28:18 +02:00
|
|
|
deploy_dev_cleanup() {
|
|
|
|
local f
|
2018-02-10 01:57:53 +01:00
|
|
|
|
2019-03-05 16:09:55 +01:00
|
|
|
if [ -d "$PKGDEPLOYDIR/share/pkgconfig" ]; then
|
|
|
|
mkdir -p "$PKGDEPLOYDIR/lib/pkgconfig"
|
|
|
|
mv $PKGDEPLOYDIR/share/pkgconfig/* "$PKGDEPLOYDIR/lib/pkgconfig"
|
|
|
|
rmdir "$PKGDEPLOYDIR/share/pkgconfig"
|
2018-02-19 12:43:22 +01:00
|
|
|
fi
|
|
|
|
|
2019-03-05 16:09:55 +01:00
|
|
|
for f in $PKGDEPLOYDIR/lib/*.la; do
|
2018-06-17 13:28:18 +02:00
|
|
|
[ ! -e "$f" ] || rm "$f"
|
2018-02-10 01:57:53 +01:00
|
|
|
done
|
|
|
|
}
|
2018-05-19 21:13:51 +02:00
|
|
|
|
|
|
|
unfuck_libtool() {
|
2019-03-05 15:09:34 +01:00
|
|
|
local libdir="$PKGDEPLOYDIR/lib"
|
2018-05-19 21:13:51 +02:00
|
|
|
local f
|
|
|
|
|
2019-01-17 19:55:32 +01:00
|
|
|
for f in $(find $PKGBUILDDIR -type f -name '*.la' -o -name '*.lai'); do
|
|
|
|
sed -i "s#libdir='.*'#libdir='$libdir'#g" "$f"
|
2018-05-19 21:13:51 +02:00
|
|
|
done
|
|
|
|
|
|
|
|
sed -i -r "s/(finish_cmds)=.*$/\1=\"\"/" "$PKGBUILDDIR/libtool"
|
|
|
|
sed -i -r "s/(hardcode_into_libs)=.*$/\1=no/" "$PKGBUILDDIR/libtool"
|
2019-01-17 19:55:32 +01:00
|
|
|
|
|
|
|
sed -i "s#libdir='\$install_libdir'#libdir='$libdir'#g" "$PKGBUILDDIR/libtool"
|
2018-05-19 21:13:51 +02:00
|
|
|
}
|