-
-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #99 from morevnaproject-org/appimage
Script for generating Linux AppImage package
- Loading branch information
Showing
6 changed files
with
82 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
#!/bin/sh | ||
|
||
# https://github.com/AppImage/AppImageKit/wiki/Bundling-Python-apps | ||
|
||
SCRIPTPATH=$(cd `dirname "$0"`; pwd) | ||
SOURCES_DIR="${SCRIPTPATH}/../../" | ||
|
||
#PYTHON_APPIMAGE_URL="https://github.com/niess/python-appimage/releases/download/python3.10/python3.10.0-cp310-cp310-manylinux2010_x86_64.AppImage" | ||
PYTHON_APPIMAGE_URL="https://github.com/niess/python-appimage/releases/download/python3.7/python3.7.11-cp37-cp37m-manylinux2010_x86_64.AppImage" | ||
PYTHON_APPIMAGE_FILENAME=`basename "${PYTHON_APPIMAGE_URL}"` | ||
|
||
# Detect package management system. | ||
YUM=$(which yum 2>/dev/null) | ||
APT_GET=$(which apt-get 2>/dev/null) | ||
|
||
echo "Installing required build tools." | ||
# libffi is required by cffi python package, which in turn is required by sounddevice | ||
if [[ ! -z $YUM ]]; then | ||
sudo yum install -y gcc libffi-devel | ||
elif [[ ! -z $APT_GET ]]; then | ||
sudo apt-get install -y build-essential libffi-dev | ||
fi | ||
|
||
|
||
[ -d "${SCRIPTPATH}/build" ] || mkdir -p "${SCRIPTPATH}/build" | ||
cd "${SCRIPTPATH}/build" | ||
wget "${PYTHON_APPIMAGE_URL}" | ||
chmod +x "${PYTHON_APPIMAGE_FILENAME}" | ||
"./${PYTHON_APPIMAGE_FILENAME}" --appimage-extract | ||
|
||
#export PATH="$(pwd)/squashfs-root/usr/bin:$PATH" | ||
./squashfs-root/AppRun -m pip install torch==1.9.0+cpu -f https://download.pytorch.org/whl/torch_stable.html | ||
./squashfs-root/AppRun -m pip install -r "${SOURCES_DIR}requirements.txt" | ||
#./squashfs-root/AppRun -m pip install $(grep -ivE "allosaurus" "${SOURCES_DIR}requirements.txt") | ||
|
||
|
||
#find "${SOURCES_DIR}" -type f -not -iname '*/not-from-here/*' -exec cp -rf '{}' '/dest/{}' ';' | ||
rsync -av --progress "${SOURCES_DIR}" "squashfs-root/opt/papagayo-ng" --exclude build | ||
|
||
cp "${SCRIPTPATH}/files/papagayo-ng" squashfs-root/usr/bin/ | ||
rm squashfs-root/usr/share/applications/*.desktop | ||
rm squashfs-root/*.desktop | ||
cp "${SCRIPTPATH}/files/papagayo-ng.desktop" squashfs-root/usr/share/applications/ | ||
cp "${SCRIPTPATH}/files/papagayo-ng.desktop" squashfs-root/ | ||
cp "${SOURCES_DIR}/rsrc/papagayo-ng.png" squashfs-root/ | ||
rm squashfs-root/usr/share/metainfo/* | ||
|
||
# Change AppRun so that it launches papagayo-ng | ||
sed -i -e 's|/opt/python3.7/bin/python3.7|/usr/bin/papagayo-ng|g' ./squashfs-root/AppRun | ||
|
||
# Convert back into an AppImage | ||
wget -c https://github.com/$(wget -q https://github.com/probonopd/go-appimage/releases -O - | grep "appimagetool-.*-x86_64.AppImage" | head -n 1 | cut -d '"' -f 2) | ||
chmod +x appimagetool-*.AppImage | ||
# | ||
# The following line does not work quite yet due to https://github.com/probonopd/go-appimage/issues/30 | ||
# ./appimagetool-*-x86_64.AppImage deploy squashfs-root/usr/share/applications/taguette.desktop | ||
./appimagetool-*-x86_64.AppImage squashfs-root/ # Replace "1" with the actual version/build number | ||
mv Papagayo_NG-*-x86_64.AppImage ../ | ||
cd .. | ||
rm -rf build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
|
||
SCRIPT_DIR=$(cd `dirname "$0"`; pwd) | ||
cd "$SCRIPT_DIR/../../opt/papagayo-ng" | ||
"$SCRIPT_DIR/python" ./papagayo-ng.py "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[Desktop Entry] | ||
Encoding=UTF-8 | ||
Name=Papagayo NG | ||
Comment=Lipsync tool | ||
Exec=papagayo-ng | ||
Icon=papagayo-ng | ||
Terminal=false | ||
Type=Application | ||
Categories=Graphics;Application; | ||
MimeType=application/x-papagayo;application/x-extension-pgo; | ||
X-Desktop-File-Install-Version=0.15 | ||
X-AppImage-Version=bf4caf5 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,5 @@ anytree | |
PySide2 | ||
audioread | ||
allosaurus >= 1.0.1 | ||
appdirs | ||
appdirs | ||
pyyaml |
This file was deleted.
Oops, something went wrong.