Add a script to generate an AppImage from aegisub

This commit is contained in:
Kubat 2021-02-09 15:47:13 +01:00
parent 25f851be7d
commit e90e3aa5da
No known key found for this signature in database
GPG Key ID: 22432F7DB6FDCA05
3 changed files with 47 additions and 4 deletions

8
.gitignore vendored
View File

@ -12,15 +12,19 @@ tests/*.json
tools/osx-bundle.sed tools/osx-bundle.sed
tools/repack-thes-dict tools/repack-thes-dict
tools/repack-thes-dict.dSYM tools/repack-thes-dict.dSYM
*.AppImage
# IDE-specific # IDE-specific
.nuget .nuget
.vs .vs
.kdev4/ .kdev4/
*.kdev4 *.kdev4
cscope.files
tags
# Platform-specific # Platform-specific
.DS_Store .DS_Store
AppImage
# Meson # Meson
build*/ build*/
@ -37,8 +41,6 @@ subprojects/ffmpeg
subprojects/ffms2* subprojects/ffms2*
subprojects/boost* subprojects/boost*
# Build and tag files # Build files
cscope.files
git_version.h git_version.h
git_version.xml git_version.xml
tags

View File

@ -293,7 +293,7 @@ bool AegisubApp::OnInit() {
// Open main frame // Open main frame
StartupLog("Create main window"); StartupLog("Create main window");
NewProjectContext(); NewProjectContext(); // XXX Criticals and errors generated on `Show();`, a widget has a width of -17 (GtkSpinButton)
// Version checker // Version checker
StartupLog("Possibly perform automatic updates check"); StartupLog("Possibly perform automatic updates check");

41
tools/appimage.bash Executable file
View File

@ -0,0 +1,41 @@
#!/bin/bash
URL_APPIMAGETOOL="https://github.com/probonopd/AppImageKit/releases/download/continuous/appimagetool-`arch`.AppImage"
URL_LINUXDEPLOY="https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-`arch`.AppImage"
APPIMAGETOOL="tools/appimagetool-`arch`.AppImage"
LINUXDEPLOY="tools/linuxdeploy-`arch`.AppImage"
echo "You will need patchelf and wget." \
"The linuxdeploy and appimagetool dependencies will be downloaded." \
"Aegisub also needs to be in your path."
WGET=`which wget 2>/dev/null`
[ $? -ne 0 ] && exit 1
echo "wget: $WGET"
PATCHELF=`which patchelf 2>/dev/null`
[ $? -ne 0 ] && exit 1
echo "patchelf: $PATCHELF"
AEGISUB=`which aegisub 2>/dev/null`
[ $? -ne 0 ] && exit 1
echo "Aegisub: $AEGISUB"
# DL
[ -e "$APPIMAGETOOL" ] || { wget "$URL_APPIMAGETOOL" -O "$APPIMAGETOOL" || exit 1; }
[ -e "$LINUXDEPLOY" ] || { wget "$URL_LINUXDEPLOY" -O "$LINUXDEPLOY" || exit 1; }
chmod +x "$APPIMAGETOOL" "$LINUXDEPLOY"
# Setup & deploy
[ -d "AppImage/Aegisub" ] || { mkdir -p "AppImage/Aegisub" || exit 1; }
cp packages/desktop/aegisub.desktop.template.in AppImage/aegisub.desktop || exit 1;
cp packages/desktop/64x64.png AppImage/aegisub.png || exit 1;
sed -i -e 's/@AEGISUB_COMMAND@/aegisub/g' AppImage/aegisub.desktop || exit 1;
$LINUXDEPLOY \
--appdir AppImage/Aegisub \
--icon-file AppImage/aegisub.png \
--desktop-file AppImage/aegisub.desktop \
--executable "$AEGISUB" || exit 1;
$APPIMAGETOOL AppImage/Aegisub