Blame env-builder-data/build/script/packet/synfigstudio-appimage.sh

d6a2c8
DEPS="synfigstudio-master"
d6a2c8
DEPS_NATIVE="appimagekit-master"
1d4d1c
1d4d1c
PK_APPIMAGEKIT_DIR=$PACKET_DIR/appimagekit-master/
1d4d1c
PK_APPDIR_NAME="synfigstudio"
1d4d1c
1d4d1c
pkinstall() {
8ef679
    # copy files from envdeps (install requires envdeps explicit)
8ef679
8ef679
    local APPDIR="$INSTALL_PACKET_DIR/$PK_APPDIR_NAME.AppDir"
8ef679
    mkdir -p "$APPDIR/usr"
8ef679
    mkdir -p "$APPDIR/usr/bin"
8ef679
    mkdir -p "$APPDIR/usr/lib"
8ef679
8ef679
    cp --remove-destination "$ENVDEPS_PACKET_DIR/bin/AppRun" "$APPDIR/" || return 1
8ef679
    cp --remove-destination "$ENVDEPS_PACKET_DIR/bin/desktopintegration" "$APPDIR/usr/bin/synfigstudio.wrapper"|| return 1
8ef679
8ef679
    cp --remove-destination "$FILES_PACKET_DIR/synfigstudio.desktop" "$APPDIR/" || return 1
8ef679
    cp --remove-destination "$FILES_PACKET_DIR/synfigstudio.png" "$APPDIR/" || return 1
8ef679
    cp --remove-destination "$FILES_PACKET_DIR/launch.sh" "$APPDIR/usr/bin/" || return 1
1d4d1c
}
1d4d1c
1d4d1c
pkinstall_release() {
1d4d1c
    if ! copy "$INSTALL_PACKET_DIR" "$INSTALL_RELEASE_PACKET_DIR"; then
1d4d1c
        return 1
1d4d1c
    fi
1d4d1c
8ef679
    # copy files from envdeps_release (install_release requires envdeps_release explicit)
8ef679
8ef679
    local APPDIR="$INSTALL_RELEASE_PACKET_DIR/$PK_APPDIR_NAME.AppDir"
8ef679
    copy "$ENVDEPS_RELEASE_PACKET_DIR" "$APPDIR/usr" || return 1
c79eb4
    
c79eb4
    mkdir -p "$APPDIR/usr/share/icons/default/128x128/apps/"
c79eb4
    cp "$ENVDEPS_RELEASE_PACKET_DIR/share/pixmaps/synfig_icon.png" "$APPDIR/usr/share/icons/default/128x128/apps/synfigstudio.png" || return 1
c79eb4
    mkdir -p "$APPDIR/usr/share/icons/default/128x128/mimetypes/"
c79eb4
    cp "$ENVDEPS_RELEASE_PACKET_DIR/share/pixmaps/sif_icon.png" "$APPDIR/usr/share/icons/default/128x128/mimetypes/application-x-sif.png" || return 1
8ef679
8ef679
    # clean bin
8ef679
    #rm -f "$APPDIR/usr/bin/"* || return 1
8ef679
    #cp "$INSTALL_PACKET_DIR/$PK_APPDIR_NAME.AppDir/usr/bin/"*       "$APPDIR/usr/bin/" || return 1
8ef679
    #cp "$ENVDEPS_RELEASE_PACKET_DIR/bin/melt"                       "$APPDIR/usr/bin/" || return 1
8ef679
    #cp "$ENVDEPS_RELEASE_PACKET_DIR/bin/identify"                   "$APPDIR/usr/bin/" || return 1
8ef679
    #cp "$ENVDEPS_RELEASE_PACKET_DIR/bin/ffmpeg"                     "$APPDIR/usr/bin/" || return 1
8ef679
    #cp "$ENVDEPS_RELEASE_PACKET_DIR/bin/synfig"                     "$APPDIR/usr/bin/" || return 1
8ef679
    #cp "$ENVDEPS_RELEASE_PACKET_DIR/bin/synfigstudio"               "$APPDIR/usr/bin/" || return 1
8ef679
8ef679
    # clean boost
8ef679
    rm -f "$APPDIR/usr/lib/libboost_"* || return 1
8ef679
    cp "$ENVDEPS_RELEASE_PACKET_DIR/lib/libboost_chrono."*          "$APPDIR/usr/lib/" || return 1
8ef679
    cp "$ENVDEPS_RELEASE_PACKET_DIR/lib/libboost_filesystem."*      "$APPDIR/usr/lib/" || return 1
8ef679
    cp "$ENVDEPS_RELEASE_PACKET_DIR/lib/libboost_program_options."* "$APPDIR/usr/lib/" || return 1
8ef679
    cp "$ENVDEPS_RELEASE_PACKET_DIR/lib/libboost_system."*          "$APPDIR/usr/lib/" || return 1
8ef679
8ef679
    # clean examples
8ef679
    rm -rf "$APPDIR/share/synfig/examples" || return 1
1bf3b3
1bf3b3
	# move jack
1bf3b3
	mkdir -p "$APPDIR/usr/lib.extra/jack"
1bf3b3
	(cp "$ENVDEPS_RELEASE_PACKET_DIR/lib/libjack"* "$APPDIR/usr/lib.extra/jack" &> /dev/null) \
1bf3b3
	|| (cp "$ENVDEPS_RELEASE_PACKET_DIR/lib64/libjack"* "$APPDIR/usr/lib.extra/jack" &> /dev/null)
1bf3b3
    rm -f "$APPDIR/usr/bin/jack"*
1bf3b3
	rm -f "$APPDIR/usr/lib/libjack"*
1bf3b3
	rm -f "$APPDIR/usr/lib64/libjack"*
1bf3b3
	
8ef679
    cd "$INSTALL_RELEASE_PACKET_DIR" || return 1
8ef679
    rm -f "$PK_APPDIR_NAME.tar.gz" || return 1
8ef679
    tar -czf "$PK_APPDIR_NAME.tar.gz" "$PK_APPDIR_NAME.AppDir" || return 1
8ef679
    rm -f "$INSTALL_RELEASE_PACKET_DIR/$PK_APPDIR_NAME.appimage" || return 1
8ef679
    AppImageAssistant "$APPDIR" "$INSTALL_RELEASE_PACKET_DIR/$PK_APPDIR_NAME.appimage" || return 1
8ef679
8ef679
    rm -rf "$APPDIR"
1d4d1c
}