Skip to content

Commit

Permalink
Fix appimage
Browse files Browse the repository at this point in the history
  • Loading branch information
raoulh committed Jun 6, 2018
1 parent d3186ab commit 10b424d
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 17 deletions.
6 changes: 3 additions & 3 deletions data/moolticute.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ EOF
$SUDO_BIN sh -c "$INSTALL_COMMAND"
;;
'gksudo')
$SUDO_BIN -m "$SUDO_MSG" "sh -c '$INSTALL_COMMAND'"
LD_LIBRARY_PATH="" $SUDO_BIN -m "$SUDO_MSG" "sh -c '$INSTALL_COMMAND'"
;;
'kdesudo')
$SUDO_BIN -i moolticute --comment "$SUDO_MSG" -c "$INSTALL_COMMAND"
LD_LIBRARY_PATH="" $SUDO_BIN -i moolticute --comment "$SUDO_MSG" -c "$INSTALL_COMMAND"
;;
'kdesu')
$SUDO_BIN -c "$INSTALL_COMMAND" --noignorebutton
LD_LIBRARY_PATH="" $SUDO_BIN -c "$INSTALL_COMMAND" --noignorebutton
;;
esac

Expand Down
14 changes: 13 additions & 1 deletion scripts/ci/linux/appimage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,17 @@ apt-get install -f -y
mkdir -p $TARGET_DIR/lib/x86_64-linux-gnu/qt5/plugins/platforms/
cp -r /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/* $TARGET_DIR/lib/x86_64-linux-gnu/qt5/plugins/platforms/

#Copy openssl

#TOFIX: Actually copying openssl is not working. SSL is going to try to load root certificates from the system
# and the path differs from all distro...
# More information here:
# https://github.com/AppImage/AppImageKit/wiki/Desktop-Linux-Platform-Issues#certificates

#mkdir -p $APPDIR/lib/x86_64-linux-gnu/
#cp /lib/x86_64-linux-gnu/libcrypto* /lib/x86_64-linux-gnu/libssl* $APPDIR/lib/x86_64-linux-gnu/
#cp -r /usr/lib/x86_64-linux-gnu/openssl* $TARGET_DIR/lib/x86_64-linux-gnu/

# copy deps recursively
old_list=""
list=$(find .)
Expand Down Expand Up @@ -123,7 +134,8 @@ echo "new version $VERSION"
# Patch away absolute paths; it would be nice if they were relative
########################################################################

find usr/ -type f -exec sed -i -e 's|/usr|././|g' {} \;
#Prevent our moolticute.sh and moolticute.sh.wrapper to be patched
find usr/ -type f ! -path "usr/bin/moolticute.sh*" -exec sed -i -e 's|/usr|././|g' {} \;
find usr/ -type f -exec sed -i -e 's@././/bin/env@/usr/bin/env@g' {} \;

########################################################################
Expand Down
58 changes: 45 additions & 13 deletions scripts/ci/linux/appimage_functions.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
# This file is supposed to be sourced by each Recipe
# that wants to use the functions contained herein
# like so:
# wget -q https://github.com/AppImage/AppImages/raw/master/functions.sh -O ./functions.sh
# wget -q https://github.com/AppImage/AppImages/raw/${PKG2AICOMMIT}/functions.sh -O ./functions.sh
# . ./functions.sh

# RECIPE=$(realpath "$0")

# Specify a certain commit if you do not want to use master
# by using:
# export PKG2AICOMMIT=<git sha>
if [ -z "$PKG2AICOMMIT" ] ; then
PKG2AICOMMIT=master
fi

# Options for apt-get to use local files rather than the system ones
OPTIONS="-o Debug::NoLocking=1
-o APT::Cache-Limit=125829120
Expand Down Expand Up @@ -34,7 +41,7 @@ case "$(uname -i)" in
# arm*)
# echo "ARM system architecture"
# SYSTEM_ARCH="";;
unknown)
unknown|AuthenticAMD|GenuineIntel)
# uname -i not answer on debian, then:
case "$(uname -m)" in
x86_64|amd64)
Expand Down Expand Up @@ -108,7 +115,7 @@ move_lib()
# Delete blacklisted files
delete_blacklisted()
{
BLACKLISTED_FILES=$(cat_file_from_url https://github.com/AppImage/AppImages/raw/master/excludelist | sed 's|#.*||g')
BLACKLISTED_FILES=$(cat_file_from_url https://github.com/AppImage/AppImages/raw/${PKG2AICOMMIT}/excludelist | sed 's|#.*||g')
echo $BLACKLISTED_FILES
for FILE in $BLACKLISTED_FILES ; do
FILES="$(find . -name "${FILE}" -not -path "./usr/optional/*")"
Expand All @@ -127,7 +134,8 @@ delete_blacklisted()
# Echo highest glibc version needed by the executable files in the current directory
glibc_needed()
{
find . -name *.so -or -name *.so.* -or -type f -executable -exec readelf -s '{}' 2>/dev/null \; | sed -n 's/.*@GLIBC_//p'| awk '{print $1}' | sort --version-sort | tail -n 1
find . -name *.so -or -name *.so.* -or -type f -executable -exec strings {} \; | grep ^GLIBC_2 | sed s/GLIBC_//g | sort --version-sort | uniq | tail -n 1
# find . -name *.so -or -name *.so.* -or -type f -executable -exec readelf -s '{}' 2>/dev/null \; | sed -n 's/.*@GLIBC_//p'| awk '{print $1}' | sort --version-sort | tail -n 1
}
# Add desktop integration
# Usage: get_desktopintegration name_of_desktop_file_and_exectuable
Expand Down Expand Up @@ -176,11 +184,15 @@ generate_appimage()

mkdir -p ../out || true
rm ../out/$APP"-"$VERSION".glibc"$GLIBC_NEEDED"-"$ARCH".AppImage" 2>/dev/null || true
GLIBC_NEEDED=${GLIBC_NEEDED:=$(glibc_needed)}
GLIBC_NEEDED=$(glibc_needed)
./AppImageAssistant ./$APP.AppDir/ ../out/$APP"-"$VERSION".glibc"$GLIBC_NEEDED"-"$ARCH".AppImage"
}

# Generate AppImage type 2
# Additional parameters given to this routine will be passed on to appimagetool
#
# If the environment variable NO_GLIBC_VERSION is set, the required glibc version
# will not be added to the AppImage filename
generate_type2_appimage()
{
# Get the ID of the last successful build on Travis CI
Expand All @@ -194,22 +206,42 @@ generate_type2_appimage()
URL="https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-${SYSTEM_ARCH}.AppImage"
wget -c "$URL" -O appimagetool
chmod a+x ./appimagetool
appimagetool=$(readlink -f appimagetool)

if [ "$DOCKER_BUILD" ]; then
appimagetool_tempdir=$(mktemp -d)
mv appimagetool "$appimagetool_tempdir"
pushd "$appimagetool_tempdir" &>/dev/null
./appimagetool --appimage-extract
rm appimagetool
appimagetool=$(readlink -f squashfs-root/AppRun)
popd &>/dev/null
_appimagetool_cleanup() { [ -d "$appimagetool_tempdir" ] && rm -r "$appimagetool_tempdir"; }
trap _appimagetool_cleanup EXIT
fi

if [ -z ${NO_GLIBC_VERSION+true} ]; then
GLIBC_NEEDED=$(glibc_needed)
VERSION_EXPANDED=$VERSION.glibc$GLIBC_NEEDED
else
VERSION_EXPANDED=$VERSION
fi

set +x
GLIBC_NEEDED=$(glibc_needed)
if ( [ ! -z "$KEY" ] ) && ( ! -z "$TRAVIS" ) ; then
wget https://github.com/AppImage/AppImageKit/files/584665/data.zip -O data.tar.gz.gpg
( set +x ; echo $KEY | gpg2 --batch --passphrase-fd 0 --no-tty --skip-verify --output data.tar.gz --decrypt data.tar.gz.gpg )
tar xf data.tar.gz
sudo chown -R $USER .gnu*
mv $HOME/.gnu* $HOME/.gnu_old ; mv .gnu* $HOME/
GLIBC_NEEDED=${GLIBC_NEEDED:=$(glibc_needed)}
VERSION=$VERSION.glibc$GLIBC_NEEDED ./appimagetool -n -s --bintray-user $BINTRAY_USER --bintray-repo $BINTRAY_REPO -v ./$APP.AppDir/
VERSION=$VERSION_EXPANDED "$appimagetool" $@ -n -s --bintray-user $BINTRAY_USER --bintray-repo $BINTRAY_REPO -v ./$APP.AppDir/
else
GLIBC_NEEDED=${GLIBC_NEEDED:=$(glibc_needed)}
VERSION=$VERSION.glibc$GLIBC_NEEDED ./appimagetool -n --bintray-user $BINTRAY_USER --bintray-repo $BINTRAY_REPO -v ./$APP.AppDir/
VERSION=$VERSION_EXPANDED "$appimagetool" $@ -n --bintray-user $BINTRAY_USER --bintray-repo $BINTRAY_REPO -v ./$APP.AppDir/
fi
set -x
# mkdir -p ../out/ || true
# mv *.AppImage* ../out/
mkdir -p ../out/ || true
mv *.AppImage* ../out/
}

# Generate status file for use by apt-get; assuming that the recipe uses no newer
Expand All @@ -220,7 +252,7 @@ generate_status()
mkdir -p ./tmp/archives/
mkdir -p ./tmp/lists/partial
touch tmp/pkgcache.bin tmp/srcpkgcache.bin
wget -q -c "https://github.com/AppImage/AppImages/raw/master/excludedeblist"
wget -q -c "https://github.com/AppImage/AppImages/raw/${PKG2AICOMMIT}/excludedeblist"
rm status 2>/dev/null || true
for PACKAGE in $(cat excludedeblist | cut -d "#" -f 1) ; do
printf "Package: $PACKAGE\nStatus: install ok installed\nArchitecture: all\nVersion: 9:999.999.999\n\n" >> status
Expand Down Expand Up @@ -258,7 +290,7 @@ get_version()
if [ -z "$THEDEB" ] ; then
echo "Version could not be determined from the .deb; you need to determine it manually"
fi
VERSION=$(echo $THEDEB | cut -d "~" -f 1 | cut -d "_" -f 2 | cut -d "-" -f 1 | sed -e 's|1%3a||g' | sed -e 's|+dfsg||g' )
VERSION=$(echo $THEDEB | cut -d "~" -f 1 | cut -d "_" -f 2 | cut -d "-" -f 1 | sed -e 's|1%3a||g' | sed -e 's|.dfsg||g' )
echo $VERSION
}

Expand Down

0 comments on commit 10b424d

Please sign in to comment.