1
0
Fork 0
mirror of https://github.com/pygos/build.git synced 2024-11-22 11:09:46 +01:00

Cleanup deploy/devdeploy split

- Don't duplicate shared objects, use the ones from the deploy
   directory when building dependend packages
 - Add helper function for moving headers, static libraries
   and pkgconfig data to devdeploy directory

Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
This commit is contained in:
David Oberhollenzer 2018-02-10 01:57:53 +01:00
parent 8dca35930b
commit 525b36aa89
28 changed files with 74 additions and 92 deletions

View file

@ -31,13 +31,10 @@ deploy() {
ln -sv bash "$DEPLOY/bin/sh" ln -sv bash "$DEPLOY/bin/sh"
rm -r "$DEPLOY/share/doc" rm -r "$DEPLOY/share"
rm -r "$DEPLOY/share/info" rm "$DEPLOY/bin/bashbug"
rm -r "$DEPLOY/share/man"
rm -r "$DEPLOY/share/locale"
mv "$DEPLOY/lib" "$DEVDEPLOY"
mv "$DEPLOY/include" "$DEVDEPLOY"
cp -r "$SCRIPTDIR/$PKGDIR/$PKGNAME/etc" "$DEPLOY" cp -r "$SCRIPTDIR/$PKGDIR/$PKGNAME/etc" "$DEPLOY"
split_dev_deploy "$DEPLOY" "$DEVDEPLOY"
} }

View file

@ -38,8 +38,7 @@ deploy() {
done done
rm -r "$DEPLOY/docs" rm -r "$DEPLOY/docs"
mv "$DEPLOY/include" "$DEVDEPLOY"
cp -r "$DEPLOY/lib" "$DEVDEPLOY"
rm ${DEPLOY}/lib/*.la rm ${DEPLOY}/lib/*.la
split_dev_deploy "$DEPLOY" "$DEVDEPLOY"
} }

View file

@ -26,8 +26,6 @@ deploy() {
make PREFIX="$DEPLOY" install make PREFIX="$DEPLOY" install
mv $DEPLOY/include $DEVDEPLOY
mv $DEPLOY/lib $DEVDEPLOY
rm -r $DEPLOY/man rm -r $DEPLOY/man
${TARGET}-strip --discard-all ${DEPLOY}/bin/bunzip2 ${TARGET}-strip --discard-all ${DEPLOY}/bin/bunzip2
@ -44,4 +42,6 @@ deploy() {
ln -s "/bin/bzgrep" "$DEPLOY/bin/bzfgrep" ln -s "/bin/bzgrep" "$DEPLOY/bin/bzfgrep"
ln -s "/bin/bzmore" "$DEPLOY/bin/bzless" ln -s "/bin/bzmore" "$DEPLOY/bin/bzless"
ln -s "/bin/bzdiff" "$DEPLOY/bin/bzcmp" ln -s "/bin/bzdiff" "$DEPLOY/bin/bzcmp"
split_dev_deploy "$DEPLOY" "$DEVDEPLOY"
} }

View file

@ -28,9 +28,7 @@ deploy() {
make DESTDIR="$DEPLOY" install-strip make DESTDIR="$DEPLOY" install-strip
rm ${DEPLOY}/lib/*.la rm ${DEPLOY}/lib/*.la
mv "$DEPLOY/include" "$DEVDEPLOY"
rm -r "$DEPLOY/share" rm -r "$DEPLOY/share"
cp -r "$DEPLOY/lib" "$DEVDEPLOY"
rm -r "$DEPLOY/lib/pkgconfig" split_dev_deploy "$DEPLOY" "$DEVDEPLOY"
} }

View file

@ -26,8 +26,8 @@ deploy() {
make DESTDIR="$DEPLOY" install-strip make DESTDIR="$DEPLOY" install-strip
mv "$DEPLOY/include" "$DEVDEPLOY"
rm -r "$DEPLOY/share" rm -r "$DEPLOY/share"
rm -r ${DEPLOY}/lib/*.la rm -r ${DEPLOY}/lib/*.la
cp -r "$DEPLOY/lib" "$DEVDEPLOY"
split_dev_deploy "$DEPLOY" "$DEVDEPLOY"
} }

View file

@ -27,8 +27,8 @@ deploy() {
make DESTDIR="$DEPLOY" install make DESTDIR="$DEPLOY" install
mv "$DEPLOY/include" "$DEVDEPLOY"
cp -r "$DEPLOY/lib" "$DEVDEPLOY"
rm ${DEPLOY}/lib/*.la rm ${DEPLOY}/lib/*.la
rm -r "$DEPLOY/share" rm -r "$DEPLOY/share"
split_dev_deploy "$DEPLOY" "$DEVDEPLOY"
} }

View file

@ -28,13 +28,12 @@ deploy() {
make DESTDIR="$DEPLOY" install-strip make DESTDIR="$DEPLOY" install-strip
mv "$DEPLOY/include" "$DEVDEPLOY"
cp -r "$DEPLOY/lib" "$DEVDEPLOY"
rm -r "$DEPLOY/lib/pkgconfig"
rm -r "$DEPLOY/share/man" rm -r "$DEPLOY/share/man"
rm -r ${DEPLOY}/lib/*.la rm -r ${DEPLOY}/lib/*.la
for target in depmod insmod lsmod modinfo modprobe rmmod; do for target in depmod insmod lsmod modinfo modprobe rmmod; do
ln -sf kmod $DEPLOY/bin/$target ln -sf kmod $DEPLOY/bin/$target
done done
split_dev_deploy "$DEPLOY" "$DEVDEPLOY"
} }

View file

@ -27,9 +27,7 @@ deploy() {
make DESTDIR="$DEPLOY" install-strip make DESTDIR="$DEPLOY" install-strip
rm ${DEPLOY}/lib/*.la rm ${DEPLOY}/lib/*.la
mv "$DEPLOY/include" "$DEVDEPLOY"
cp -r "$DEPLOY/lib" "$DEVDEPLOY"
rm -r "$DEPLOY/share" rm -r "$DEPLOY/share"
rm -r "$DEPLOY/lib/pkgconfig"
split_dev_deploy "$DEPLOY" "$DEVDEPLOY"
} }

View file

@ -26,9 +26,8 @@ deploy() {
make DESTDIR="$DEPLOY" install make DESTDIR="$DEPLOY" install
mv "$DEPLOY/include" "$DEVDEPLOY"
cp -r "$DEPLOY/lib" "$DEVDEPLOY"
rm -r "$DEPLOY/bin"
rm -r "$DEPLOY/lib/pkgconfig"
rm ${DEPLOY}/lib/*.la rm ${DEPLOY}/lib/*.la
rm -r "$DEPLOY/bin"
split_dev_deploy "$DEPLOY" "$DEVDEPLOY"
} }

View file

@ -29,6 +29,5 @@ deploy() {
rm -r "$DEPLOY/share" rm -r "$DEPLOY/share"
rm ${DEPLOY}/lib/*.la rm ${DEPLOY}/lib/*.la
mv "$DEPLOY/include" "$DEVDEPLOY" split_dev_deploy "$DEPLOY" "$DEVDEPLOY"
cp -r "$DEPLOY/lib" "$DEVDEPLOY"
} }

View file

@ -29,8 +29,5 @@ deploy() {
rm -r "$DEPLOY/share" rm -r "$DEPLOY/share"
rm ${DEPLOY}/lib/*.la rm ${DEPLOY}/lib/*.la
mv "$DEPLOY/include" "$DEVDEPLOY" split_dev_deploy "$DEPLOY" "$DEVDEPLOY"
cp -r "$DEPLOY/lib" "$DEVDEPLOY"
rm -r "$DEPLOY/lib/pkgconfig"
} }

View file

@ -26,8 +26,7 @@ deploy() {
make DESTDIR="$DEPLOY" install-strip make DESTDIR="$DEPLOY" install-strip
mv "$DEPLOY/include" "$DEVDEPLOY"
cp -r "$DEPLOY/lib" "$DEVDEPLOY"
rm -r "$DEPLOY/lib/pkgconfig"
rm ${DEPLOY}/lib/*.la rm ${DEPLOY}/lib/*.la
split_dev_deploy "$DEPLOY" "$DEVDEPLOY"
} }

View file

@ -27,9 +27,7 @@ deploy() {
make DESTDIR="$DEPLOY" install-strip make DESTDIR="$DEPLOY" install-strip
rm ${DEPLOY}/lib/*.la rm ${DEPLOY}/lib/*.la
mv "$DEPLOY/include" "$DEVDEPLOY"
cp -r "$DEPLOY/lib" "$DEVDEPLOY"
rm -r "$DEPLOY/share" rm -r "$DEPLOY/share"
rm -r "$DEPLOY/lib/pkgconfig"
split_dev_deploy "$DEPLOY" "$DEVDEPLOY"
} }

View file

@ -26,9 +26,8 @@ deploy() {
make DESTDIR="$DEPLOY" install-strip make DESTDIR="$DEPLOY" install-strip
mv "$DEPLOY/include" "$DEVDEPLOY"
cp -r "$DEPLOY/lib" "$DEVDEPLOY"
rm -r "$DEPLOY/lib/pkgconfig"
rm -r "$DEPLOY/share" rm -r "$DEPLOY/share"
rm ${DEPLOY}/lib/*.la rm ${DEPLOY}/lib/*.la
split_dev_deploy "$DEPLOY" "$DEVDEPLOY"
} }

View file

@ -29,6 +29,5 @@ deploy() {
rm -r "$DEPLOY/share" rm -r "$DEPLOY/share"
rm ${DEPLOY}/lib/*.la rm ${DEPLOY}/lib/*.la
mv "$DEPLOY/include" "$DEVDEPLOY" split_dev_deploy "$DEPLOY" "$DEVDEPLOY"
cp -r "$DEPLOY/lib" "$DEVDEPLOY"
} }

View file

@ -33,12 +33,7 @@ deploy() {
rm -r "$DEPLOY/share/man" rm -r "$DEPLOY/share/man"
rm "$DEPLOY/bin/ncursesw6-config" rm "$DEPLOY/bin/ncursesw6-config"
mkdir -p "$DEVDEPLOY/lib" split_dev_deploy "$DEPLOY" "$DEVDEPLOY"
mv "$DEPLOY/include" "$DEVDEPLOY"
cp -r "$DEPLOY/lib" "$DEVDEPLOY"
rm ${DEPLOY}/lib/*.a
rm -r "$DEPLOY/lib/pkgconfig"
mkdir -p "${DEVDEPLOY}/include/ncurses" mkdir -p "${DEVDEPLOY}/include/ncurses"
@ -53,9 +48,7 @@ deploy() {
ln -s "libncursesw.so.$VERSION" "$DEPLOY/lib/libtinfo.so" ln -s "libncursesw.so.$VERSION" "$DEPLOY/lib/libtinfo.so"
ln -s "libncursesw.so.$VERSION" "$DEPLOY/lib/libtinfo.so.$VERSION" ln -s "libncursesw.so.$VERSION" "$DEPLOY/lib/libtinfo.so.$VERSION"
ln -s "libncursesw.so.$VERSION" "$DEVDEPLOY/lib/libtinfo.so" ln -s "libncursesw.a" "$DEVDEPLOY/lib/libtinfo.a"
ln -s "libncursesw.so.$VERSION" "$DEVDEPLOY/lib/libtinfo.so.$VERSION"
ln -s "libncursesw.a.$VERSION" "$DEVDEPLOY/lib/libtinfo.a"
# only keep relevant terminfo files # only keep relevant terminfo files
local olddir="$DEPLOY/share/terminfo.old" local olddir="$DEPLOY/share/terminfo.old"

View file

@ -26,7 +26,5 @@ deploy() {
make DESTDIR="$DEPLOY" install make DESTDIR="$DEPLOY" install
mv "$DEPLOY/include" "$DEVDEPLOY" split_dev_deploy "$DEPLOY" "$DEVDEPLOY"
cp -r "$DEPLOY/lib" "$DEVDEPLOY"
rm -r "$DEPLOY/lib/pkgconfig"
} }

View file

@ -37,10 +37,8 @@ deploy() {
DESTDIR="$DEPLOY" OS=Linux BRANDING="distroname" UPREFIX="" \ DESTDIR="$DEPLOY" OS=Linux BRANDING="distroname" UPREFIX="" \
install install
mv ${DEPLOY}/include ${DEVDEPLOY} split_dev_deploy "$DEPLOY" "$DEVDEPLOY"
cp -R ${DEPLOY}/lib ${DEVDEPLOY}
rm -r ${DEPLOY}/lib/pkgconfig
rm ${DEPLOY}/lib/*.a
rm -r ${DEPLOY}/share rm -r ${DEPLOY}/share
rm -r ${DEPLOY}/etc rm -r ${DEPLOY}/etc

View file

@ -29,12 +29,9 @@ deploy() {
make DESTDIR="$DEPLOY" install make DESTDIR="$DEPLOY" install
mv "$DEPLOY/include" "$DEVDEPLOY"
cp -r "$DEPLOY/lib" "$DEVDEPLOY"
rm "$DEPLOY/bin/c_rehash" rm "$DEPLOY/bin/c_rehash"
rm -r "$DEPLOY/etc/ssl/misc" rm -r "$DEPLOY/etc/ssl/misc"
rm -r "$DEPLOY/share" rm -r "$DEPLOY/share"
rm -r "$DEPLOY/lib/pkgconfig"
rm ${DEPLOY}/lib/*.a split_dev_deploy "$DEPLOY" "$DEVDEPLOY"
} }

View file

@ -31,8 +31,7 @@ deploy() {
make DESTDIR="$DEPLOY" install-strip make DESTDIR="$DEPLOY" install-strip
rm ${DEPLOY}/lib/*.la rm ${DEPLOY}/lib/*.la
mv "$DEPLOY/include" "$DEVDEPLOY"
cp -R "$DEPLOY/lib" "$DEVDEPLOY"
rm -r "$DEPLOY/lib/pkgconfig"
rm -r "$DEPLOY/share" rm -r "$DEPLOY/share"
split_dev_deploy "$DEPLOY" "$DEVDEPLOY"
} }

View file

@ -26,8 +26,7 @@ deploy() {
make SHLIB_LIBS="-lncursesw" DESTDIR="$DEPLOY" install make SHLIB_LIBS="-lncursesw" DESTDIR="$DEPLOY" install
mv "$DEPLOY/include" "$DEVDEPLOY"
rm -r "$DEPLOY/share" rm -r "$DEPLOY/share"
cp -r "$DEPLOY/lib" "$DEVDEPLOY/" split_dev_deploy "$DEPLOY" "$DEVDEPLOY"
} }

View file

@ -26,10 +26,8 @@ deploy() {
make DESTDIR="$DEPLOY" install-strip make DESTDIR="$DEPLOY" install-strip
mv "$DEPLOY/include" "$DEVDEPLOY"
cp -r "$DEPLOY/lib" "$DEVDEPLOY/"
rm -r "$DEPLOY/share" rm -r "$DEPLOY/share"
rm -r "$DEPLOY/lib/pkgconfig" rm ${DEPLOY}/lib/*.la
rm ${DEPLOY}/lib/*.a ${DEPLOY}/lib/*.la
split_dev_deploy "$DEPLOY" "$DEVDEPLOY"
} }

View file

@ -32,6 +32,5 @@ deploy() {
rm ${DEPLOY}/lib/*.la rm ${DEPLOY}/lib/*.la
rm -r "$DEPLOY/share" rm -r "$DEPLOY/share"
mv "$DEPLOY/include" "$DEVDEPLOY" split_dev_deploy "$DEPLOY" "$DEVDEPLOY"
cp -r "$DEPLOY/lib" "$DEVDEPLOY"
} }

View file

@ -59,11 +59,7 @@ deploy() {
make DESTDIR="$DEPLOY" install-strip make DESTDIR="$DEPLOY" install-strip
cp -r "$DEPLOY/lib" "$DEVDEPLOY"
mv "$DEPLOY/include" "$DEVDEPLOY"
rm -r "$DEPLOY/share/man" rm -r "$DEPLOY/share/man"
rm -r "$DEPLOY/lib/pkgconfig"
rm -r "$DEPLOY/share/doc" rm -r "$DEPLOY/share/doc"
rm -r ${DEPLOY}/lib/*.la rm -r ${DEPLOY}/lib/*.la
@ -84,4 +80,6 @@ deploy() {
rm "$path" rm "$path"
fi fi
done done
split_dev_deploy "$DEPLOY" "$DEVDEPLOY"
} }

View file

@ -26,9 +26,8 @@ deploy() {
make DESTDIR="$DEPLOY" install-strip make DESTDIR="$DEPLOY" install-strip
cp -r "$DEPLOY/lib" "$DEVDEPLOY"
mv "$DEPLOY/include" "$DEVDEPLOY"
rm ${DEPLOY}/lib/*.la rm ${DEPLOY}/lib/*.la
rm -r "$DEPLOY/share" rm -r "$DEPLOY/share"
rm -r "$DEPLOY/lib/pkgconfig"
split_dev_deploy "$DEPLOY" "$DEVDEPLOY"
} }

View file

@ -26,10 +26,8 @@ deploy() {
make DESTDIR="$DEPLOY" install make DESTDIR="$DEPLOY" install
cp -r "$DEPLOY/lib" "$DEVDEPLOY" split_dev_deploy "$DEPLOY" "$DEVDEPLOY"
mv "$DEPLOY/include" "$DEVDEPLOY"
mv "$DEPLOY/share/pkgconfig" "$DEVDEPLOY/lib" mv "$DEPLOY/share/pkgconfig" "$DEVDEPLOY/lib"
rm ${DEPLOY}/lib/*.a
rm -r ${DEPLOY}/share rm -r ${DEPLOY}/share
} }

View file

@ -5,3 +5,25 @@ apply_patches() {
patch -p1 < $PATCH patch -p1 < $PATCH
done done
} }
split_dev_deploy() {
local lib f
if [ -d "$1/include" ]; then
mv "$1/include" "$2"
fi
if [ -d "$1/lib/pkgconfig" ]; then
mkdir -p "$2/lib"
mv "$1/lib/pkgconfig" "$2/lib"
fi
for f in ${1}/lib/*.a; do
if [ -f "$f" ]; then
mkdir -p "$2/lib"
mv ${1}/lib/*.a "$2/lib"
fi
break
done
}

View file

@ -24,6 +24,9 @@ install_build_deps() {
if [ -d "$devdir/include" ]; then if [ -d "$devdir/include" ]; then
cp -R "$devdir/include" "$TCDIR/$TARGET" cp -R "$devdir/include" "$TCDIR/$TARGET"
fi fi
if [ -d "$PKGDEPLOYDIR/$deppkg/lib" ]; then
cp -R "$PKGDEPLOYDIR/$deppkg/lib" "$TCDIR/$TARGET"
fi
if [ -d "$devdir/lib" ]; then if [ -d "$devdir/lib" ]; then
cp -R "$devdir/lib" "$TCDIR/$TARGET" cp -R "$devdir/lib" "$TCDIR/$TARGET"
fi fi