Produce AppImage from the leavings of the normal bz2. (#4039)

* Produce AppImage from the leavings of the normal bz2.
This commit is contained in:
Joseph Lenox 2017-06-21 22:19:26 -05:00 committed by GitHub
parent b6708e87f0
commit 26becd8b51
4 changed files with 97 additions and 46 deletions

View File

@ -14,7 +14,9 @@ script:
after_success:
- eval $(perl -Mlocal::lib=$TRAVIS_BUILD_DIR/local-lib)
- LD_LIBRARY_PATH=$WXDIR/lib package/linux/make_archive.sh linux-x64
- package/deploy/sftp.sh linux ~/slic3r-upload.rsa *.bz2
- package/linux/appimage.sh x86_64
- package/deploy/sftp.sh linux ~/slic3r-upload.rsa *.bz2 *.App*
- package/deploy/sftp.sh linux ~/slic3r-upload.rsa Slic3r*.AppImage
branches:
only:
- master

View File

@ -1,45 +0,0 @@
#!/bin/bash
WD=$(dirname $0)
source $(dirname $0)/../common/util.sh
set_version
set_app_name
LOWERAPP=${appname,,}
wget -q https://github.com/probonopd/AppImages/raw/master/functions.sh -O ./functions.sh
. ./functions.sh
srcfolder="$WD/${appname}"
if [ ! -e $srcfolder ]; then
echo "Run make_archive first."
exit 1
fi
cd $srcfolder
# make shell exec and call it Slic3r
mkdir -p /usr/{lib,bin}
mv -R Slic3r local-lib var perl-local slic3r.pl /usr/bin
mv -R bin/* /usr/lib
rm -rf bin
get_apprun
# Copy desktop and icon file to application root dir for Apprun to pick them up.
sed -e "s|SLIC3R_VERSION|$SLIC3R_VERSION|" -e"s|APPLICATION_NAME|$appname|" ../slic3r.desktop.in > ../slic3r.desktop
cp ../slic3r.desktop $LOWERAPP.desktop
cp ./var/Slic3r_192px_transparent.png ./slic3r.png
# archive directory has everything we need.
delete_blacklisted
get_desktopintegration $LOWERAPP
GLIBC_NEEDED=$(glibc_needed)
VERSION=git$GIT_REV-glibc$GLIBC_NEEDED
cd ..
mkdir -p out
generate_appimage
transfer ../out/*

93
package/linux/appimage.sh Executable file
View File

@ -0,0 +1,93 @@
#!/usr/bin/env bash
########################################################################
# Package the binaries built on Travis-CI as an AppImage
# By Joseph Lenox 2017
# For more information, see http://appimage.org/
# Assumes that the results from make_archive are present.
########################################################################
source $(dirname $0)/../common/util.sh
set_version
get_commit
set_build_id
set_branch
set_app_name
set_pr_id
WD=${PWD}/$(dirname $0)
srcfolder="$WD/${appname}"
export ARCH=$(arch)
APP=Slic3r
LOWERAPP=${APP,,}
mkdir -p $WD/${APP}.AppDir/usr/
wget -q https://github.com/probonopd/AppImages/raw/master/functions.sh -O ./functions.sh
. ./functions.sh
cd $WD/${APP}.AppDir
mkdir -p $WD/${APP}.AppDir/usr/bin
# Copy primary Slic3r script here and perl-local, as well as var
for i in {var,slic3r.pl,perl-local}; do
cp -R $srcfolder/$i $WD/${APP}.AppDir/usr/bin/
done
mkdir -p ${WD}/${APP}.AppDir/usr/lib
# copy Slic3r local-lib here
for i in $(ls $srcfolder/bin); do
install -v $srcfolder/bin/$i ${WD}/${APP}.AppDir/usr/lib
done
cp -R $srcfolder/local-lib ${WD}/${APP}.AppDir/usr/lib/local-lib
cat > $WD/${APP}.AppDir/AppRun << 'EOF'
#!/usr/bin/env bash
# some magic to find out the real location of this script dealing with symlinks
DIR=`readlink "$0"` || DIR="$0";
DIR=`dirname "$DIR"`;
cd "$DIR"
DIR=`pwd`
cd - > /dev/null
# disable parameter expansion to forward all arguments unprocessed to the VM
set -f
# run the VM and pass along all arguments as is
LD_LIBRARY_PATH="$DIR/usr/lib" "${DIR}/usr/bin/perl-local" -I"${DIR}/usr/lib/local-lib/lib/perl5" "${DIR}/usr/bin/slic3r.pl" "$@"
EOF
chmod +x AppRun
cp ${WD}/${APP}.AppDir/usr/bin/var/Slic3r_192px_transparent.png $WD/${APP}.AppDir/${APP}.png
cat > $WD/${APP}.AppDir/${APP}.desktop <<EOF
[Desktop Entry]
Type=Application
Name=$APP
Icon=$APP
Exec=AppRun
Categories=Graphics;
Version=$SLIC3R_VERSION
Comment=Prepare 3D Models for Printing
EOF
cd ..
wget "https://github.com/probonopd/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage"
chmod a+x appimagetool-x86_64.AppImage
./appimagetool-x86_64.AppImage Slic3r.AppDir
# If we're on a branch, add the branch name to the app name.
if [ "$current_branch" == "master" ]; then
if [ ! -z ${PR_ID+x} ]; then
outfile=Slic3r-${SLIC3R_BUILD_ID}-PR${PR_ID}-${1}.AppImage
else
outfile=Slic3r-${SLIC3R_BUILD_ID}-${1}-x86_64.AppImage
fi
else
outfile=Slic3r-${SLIC3R_BUILD_ID}-${current_branch}-${1}.AppImage
fi
mv Slic3r-x86_64.AppImage ${WD}/../../${outfile}

View File

@ -97,6 +97,7 @@ ${PP_BIN} wxextension .0 \
-M attributes -M base -M bytes -M B -M POSIX \
-M FindBin -M Unicode::Normalize -M Tie::Handle \
-M Time::Local -M Math::Trig -M IO::Socket -M Errno \
-M Storable \
-M lib -M overload \
-M warnings -M local::lib \
-M strict -M utf8 -M parent \