Skip to content

Instantly share code, notes, and snippets.

@quantenschaum
Created August 8, 2018 09:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save quantenschaum/65d5fd5f47bdfe062849db179cb3c8c9 to your computer and use it in GitHub Desktop.
Save quantenschaum/65d5fd5f47bdfe062849db179cb3c8c9 to your computer and use it in GitHub Desktop.
create appimage of ausweisapp2
#!/bin/bash -e
DIR="$(pwd)"
APP="$DIR/AusweisApp2"
TOOLS="$APP-Tools"
BUILD="$APP-Build"
IMAGE="$APP-Image"
git clone https://github.com/Governikus/AusweisApp2.git $APP
# https://github.com/Governikus/AusweisApp2/tree/community/libs#macos
mkdir $TOOLS && cd $TOOLS
cmake -DCMAKE_BUILD_TYPE=release -DPACKAGES_DIR=$TOOLS $APP/libs
make -j
# https://github.com/Governikus/AusweisApp2/tree/community#build
mkdir $BUILD && cd $BUILD
cmake -DCMAKE_BUILD_TYPE=release -DCMAKE_PREFIX_PATH=$TOOLS/dist $APP
make -j && make install
# launch app
export LD_LIBRARY_PATH="$TOOLS/dist/lib"
export QT_PLUGIN_PATH="$TOOLS/dist/plugins"
$BUILD/src/AusweisApp2
# create appimage
mkdir $IMAGE && cd $IMAGE
cp -rv $TOOLS/dist/* $BUILD/dist/* $APP/resources/images/npa.svg .
mv npa.svg AusweisApp2.svg
cat <<EOF >AusweisApp2.desktop
[Desktop Entry]
Version=1.0
Type=Application
Name=AusweisApp2
Exec=AusweisApp2
Icon=AusweisApp2
StartupNotify=true
Terminal=false
Categories=Network;Utility;
Keywords=nPA,eID,eAT,Personalausweis,Aufenthaltstitel,Identity,Card
EOF
cat <<EOF >AppRun
#!/bin/sh
HERE="\$(dirname "\$(readlink -f "\${0}")")"
export PATH="\${HERE}/bin/:\${PATH}"
export LD_LIBRARY_PATH="\${HERE}/lib/"
export QT_PLUGIN_PATH="\${HERE}/plugins/"
export XDG_DATA_DIRS="\${HERE}/share/:\${XDG_DATA_DIRS}"
EXEC=\$(grep -e '^Exec=.*' "\${HERE}"/*.desktop | head -n 1 | cut -d "=" -f 2 | cut -d " " -f 1)
exec "\${EXEC}" "\$@"
EOF
chmod +x AppRun
appimagetool .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment