diff --git a/docker-builder-data/build/script/common/manager.sh b/docker-builder-data/build/script/common/manager.sh index 55a7e80..3592e2b 100755 --- a/docker-builder-data/build/script/common/manager.sh +++ b/docker-builder-data/build/script/common/manager.sh @@ -154,6 +154,14 @@ remove_recursive() { done } +copy_system_lib() { + cp --remove-destination /lib/x86_64-linux-gnu/$1* "$2" &> /dev/null \ + || cp --remove-destination /lib/i386-linux-gnu/$1* "$2" &> /dev/null \ + || cp --remove-destination /usr/lib/x86_64-linux-gnu/$1* "$2" &> /dev/null \ + || cp --remove-destination /usr/lib/i386-linux-gnu/$1* "$2" &> /dev/null \ + || (echo "$1 not found in system libraries" && return 1) +} + message() { echo " ------ $1" } diff --git a/docker-builder-data/build/script/packet/opentoonz-appimage.sh b/docker-builder-data/build/script/packet/opentoonz-appimage.sh index b978c03..9bb4b72 100644 --- a/docker-builder-data/build/script/packet/opentoonz-appimage.sh +++ b/docker-builder-data/build/script/packet/opentoonz-appimage.sh @@ -10,28 +10,14 @@ pkinstall() { mkdir -p "$APPDIR/usr" mkdir -p "$APPDIR/usr/bin" mkdir -p "$APPDIR/usr/lib" - if ! cp --remove-destination "$ENVDEPS_PACKET_DIR/bin/AppRun" "$APPDIR/"; then - return 1 - fi - if ! cp --remove-destination "$ENVDEPS_PACKET_DIR/bin/desktopintegration" "$APPDIR/usr/bin/launch-opentoonz.sh.wrapper"; then - return 1 - fi - if ! (cp --remove-destination "$FILES_PACKET_DIR/opentoonz.desktop" "$APPDIR/" \ - && cp --remove-destination "$FILES_PACKET_DIR/opentoonz.png" "$APPDIR/"); then - return 1 - fi - if ! (cp --remove-destination /lib/x86_64-linux-gnu/libudev.so* "$APPDIR/usr/lib/" \ - || cp --remove-destination /lib/i386-linux-gnu/libudev.so* "$APPDIR/usr/lib/"); then - return 1 - fi - if ! (cp --remove-destination /usr/lib/x86_64-linux-gnu/libgfortran.so* "$APPDIR/usr/lib/" \ - || cp --remove-destination /usr/lib/i386-linux-gnu/libgfortran.so* "$APPDIR/usr/lib/"); then - return 1 - fi - if ! (cp --remove-destination /usr/lib/x86_64-linux-gnu/libpng12.so* "$APPDIR/usr/lib/" \ - || cp --remove-destination /usr/lib/i386-linux-gnu/libpng12.so* "$APPDIR/usr/lib/"); then - return 1 - fi + cp --remove-destination "$ENVDEPS_PACKET_DIR/bin/AppRun" "$APPDIR/" || return 1 + cp --remove-destination "$ENVDEPS_PACKET_DIR/bin/desktopintegration" "$APPDIR/usr/bin/launch-opentoonz.sh.wrapper" || return 1 + cp --remove-destination "$FILES_PACKET_DIR/opentoonz.desktop" "$APPDIR/" || return 1 + cp --remove-destination "$FILES_PACKET_DIR/opentoonz.png" "$APPDIR/" || return 1 + + copy_system_lib libudev "$APPDIR/usr/lib/" || return 1 + copy_system_lib libgfortran "$APPDIR/usr/lib/" || return 1 + copy_system_lib libpng12 "$APPDIR/usr/lib/" || return 1 } pkinstall_release() { diff --git a/docker-builder-data/build/script/packet/opentoonz-debug.sh b/docker-builder-data/build/script/packet/opentoonz-debug.sh index e234158..f19e4df 100644 --- a/docker-builder-data/build/script/packet/opentoonz-debug.sh +++ b/docker-builder-data/build/script/packet/opentoonz-debug.sh @@ -49,16 +49,13 @@ pkbuild() { pkinstall() { cd "$BUILD_PACKET_DIR/$PK_DIRNAME/toonz/build" - if ! make install; then - return 1 - fi - if ! cp --remove-destination "$FILES_PACKET_DIR/launch-opentoonz.sh" "$INSTALL_PACKET_DIR/bin"; then - return 1 - fi - if ! cp --remove-destination $BUILD_PACKET_DIR/$PK_DIRNAME/thirdparty/tiff-4.0.3/libtiff/.libs/libtiff.so* "$INSTALL_PACKET_DIR/lib"; then - return 1 - fi - if ! cp --remove-destination $BUILD_PACKET_DIR/$PK_DIRNAME/thirdparty/tiff-4.0.3/libtiff/.libs/libtiffxx.so* "$INSTALL_PACKET_DIR/lib"; then - return 1 - fi + make install || return 1 + + cp --remove-destination "$FILES_PACKET_DIR/launch-opentoonz.sh" "$INSTALL_PACKET_DIR/bin" || return 1 + cp --remove-destination $BUILD_PACKET_DIR/$PK_DIRNAME/thirdparty/tiff-4.0.3/libtiff/.libs/libtiff.so* "$INSTALL_PACKET_DIR/lib" || return 1 + cp --remove-destination $BUILD_PACKET_DIR/$PK_DIRNAME/thirdparty/tiff-4.0.3/libtiff/.libs/libtiffxx.so* "$INSTALL_PACKET_DIR/lib" || return 1 + + copy_system_lib libudev "$APPDIR/usr/lib/" || return 1 + copy_system_lib libgfortran "$APPDIR/usr/lib/" || return 1 + copy_system_lib libpng12 "$APPDIR/usr/lib/" || return 1 } diff --git a/docker-builder-data/build/script/packet/synfigstudio-appimage.sh b/docker-builder-data/build/script/packet/synfigstudio-appimage.sh index f849238..3da848c 100644 --- a/docker-builder-data/build/script/packet/synfigstudio-appimage.sh +++ b/docker-builder-data/build/script/packet/synfigstudio-appimage.sh @@ -3,14 +3,6 @@ DEPS="appimagekit-master synfigstudio-master" PK_APPIMAGEKIT_DIR=$PACKET_DIR/appimagekit-master/ PK_APPDIR_NAME="synfigstudio" -pk_synfigstudio_appimage_cplib() { - cp --remove-destination /lib/x86_64-linux-gnu/$1* "$2" \ - || cp --remove-destination /lib/i386-linux-gnu/$1* "$2" \ - || cp --remove-destination /usr/lib/x86_64-linux-gnu/$1* "$2" \ - || cp --remove-destination /usr/lib/i386-linux-gnu/$1* "$2" \ - || return 1 -} - pkinstall() { # copy files from envdeps (install requires envdeps explicit) @@ -21,17 +13,19 @@ pkinstall() { cp --remove-destination "$ENVDEPS_PACKET_DIR/bin/AppRun" "$APPDIR/" || return 1 cp --remove-destination "$ENVDEPS_PACKET_DIR/bin/desktopintegration" "$APPDIR/usr/bin/synfigstudio.wrapper"|| return 1 - cp --remove-destination "$FILES_PACKET_DIR/synfigstudio.desktop" "$APPDIR/" || return 1 - cp --remove-destination "$FILES_PACKET_DIR/synfigstudio.png" "$APPDIR/" || return 1 - cp --remove-destination "$FILES_PACKET_DIR/launch.sh" "$APPDIR/usr/bin/" || return 1 - pk_synfigstudio_appimage_cplib libudev "$APPDIR/usr/lib/" || return 1 - pk_synfigstudio_appimage_cplib libgfortran "$APPDIR/usr/lib/" || return 1 - pk_synfigstudio_appimage_cplib libffi "$APPDIR/usr/lib/" || return 1 - pk_synfigstudio_appimage_cplib libdb "$APPDIR/usr/lib/" || return 1 - pk_synfigstudio_appimage_cplib libpcre "$APPDIR/usr/lib/" || return 1 - pk_synfigstudio_appimage_cplib libdirect "$APPDIR/usr/lib/" || return 1 - pk_synfigstudio_appimage_cplib libfusion "$APPDIR/usr/lib/" || return 1 + cp --remove-destination "$FILES_PACKET_DIR/synfigstudio.desktop" "$APPDIR/" || return 1 + cp --remove-destination "$FILES_PACKET_DIR/synfigstudio.png" "$APPDIR/" || return 1 + cp --remove-destination "$FILES_PACKET_DIR/launch.sh" "$APPDIR/usr/bin/" || return 1 + + copy_system_lib libudev "$APPDIR/usr/lib/" || return 1 + copy_system_lib libgfortran "$APPDIR/usr/lib/" || return 1 + copy_system_lib libpng12 "$APPDIR/usr/lib/" || return 1 + copy_system_lib libffi "$APPDIR/usr/lib/" || return 1 + copy_system_lib libdb "$APPDIR/usr/lib/" || return 1 + copy_system_lib libpcre "$APPDIR/usr/lib/" || return 1 + copy_system_lib libdirect "$APPDIR/usr/lib/" || return 1 + copy_system_lib libfusion "$APPDIR/usr/lib/" || return 1 } pkinstall_release() {