diff --git a/.gitignore b/.gitignore index 45da259866ebbcb381427b67b1110f719cfca72d..87455408f01f988aeb205cd55da6ced3d5ef1fb7 100644 --- a/.gitignore +++ b/.gitignore @@ -68,8 +68,7 @@ packages/desktop/aegisub.desktop packages/desktop/aegisub.desktop.template packages/win_installer/vendor src/aegisub -Aegisub/aegisub -Aegisub/usr/bin/aegisub +Aegisub/ src/libresrc/bitmap.cpp src/libresrc/bitmap.h src/libresrc/default_config.cpp @@ -79,6 +78,7 @@ svn-revision.h svn_revision tests/*.json tests/run +tools/linuxdeploy tools/osx-bundle-restart-helper tools/osx-bundle.sed tools/repack-thes-dict diff --git a/Aegisub/AppRun b/Aegisub/AppRun deleted file mode 100755 index 27f3ec957763def5b0499550b8f622378b73b0fa..0000000000000000000000000000000000000000 --- a/Aegisub/AppRun +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -HERE=$(dirname $(readlink -f "$0")) -export LC_ALL="en_US.UTF-8" -export LD_LIBRARY_PATH="$HERE/usr/lib" -EXEC=$(grep -e '^Exec=.*' "$HERE"/*.desktop | head -n 1 | cut -d "=" -f 2 | cut -d " " -f 1) -ldd $(which $EXEC) -export PATH="$HERE/usr/bin" -exec $EXEC $@ diff --git a/Aegisub/aegisub-icon.png b/Aegisub/aegisub-icon.png deleted file mode 100644 index fbbd14dc9f46796622c457b781c1388d45353788..0000000000000000000000000000000000000000 Binary files a/Aegisub/aegisub-icon.png and /dev/null differ diff --git a/Aegisub/usr/bin/.gitkeep b/Aegisub/usr/bin/.gitkeep deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/Aegisub/usr/lib/.gitkeep b/Aegisub/usr/lib/.gitkeep deleted file mode 100755 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/Makefile.inc.in b/Makefile.inc.in index be9a686ff7ac642c3991953f269f830336c73e7a..911aa5a65991231ba6b8698e117d3fb9c00a1873 100644 --- a/Makefile.inc.in +++ b/Makefile.inc.in @@ -118,23 +118,29 @@ PRECOMPILED_HEADER = @enable_gcc_prec@ ########## # BINARIES ########## -BIN_AR = ar -BIN_RANLIB = ranlib -BIN_LN = ln -BIN_RM = rm -BIN_SHELL = @SHELL@ -BIN_MV = mv -BIN_SED = sed -BIN_INSTALL = @INSTALL@ -BIN_MSGMERGE = @MSGMERGE@ -BIN_XGETTEXT = @XGETTEXT@ -BIN_MSGFMT = @MSGFMT@ -BIN_CC = @CC@ -BIN_CXX = @CXX@ -BIN_CP = cp -BIN_MKDIR = mkdir -BIN_MKDIR_P = mkdir -p -BIN_ECHO = echo -BIN_TOUCH = touch -BIN_LUA = @LUA@ +BIN_AR = ar +BIN_RANLIB = ranlib +BIN_LN = ln +BIN_RM = rm +BIN_SHELL = @SHELL@ +BIN_MV = mv +BIN_SED = sed +BIN_INSTALL = @INSTALL@ +BIN_MSGMERGE = @MSGMERGE@ +BIN_XGETTEXT = @XGETTEXT@ +BIN_MSGFMT = @MSGFMT@ +BIN_CC = @CC@ +BIN_CXX = @CXX@ +BIN_CP = cp +BIN_MKDIR = mkdir +BIN_MKDIR_P = mkdir -p +BIN_ECHO = echo +BIN_TOUCH = touch +BIN_LUA = @LUA@ BIN_WX_CONFIG = @WX_CONFIG_PATH@ + +################ +# APPIMAGE TOOLS +################ +TOOL_LINUXDEPLOY = $(TOM)tools/linuxdeploy +TOOL_APPIMAGE = $(TOP)tools/appimagetool.AppImage diff --git a/Makefile.target b/Makefile.target index 202cb590de0a8ca7af88e2d55241784ba4d62743..6156fa8ebc063fd6008e52655c32b06417ddf5a4 100644 --- a/Makefile.target +++ b/Makefile.target @@ -95,10 +95,9 @@ style: tags: ./tools/tags.bash -appimage: src/aegisub - cp $^ Aegisub/usr/bin/aegisub - ./tools/copy-libs.lua Aegisub/usr/bin/aegisub Aegisub/usr/lib - ./tools/appimagetool.AppImage Aegisub +appimage: src/aegisub packages/desktop/Aegisub.desktop packages/desktop/aegisub.png + $(TOOL_LINUXDEPLOY) --appdir Aegisub --desktop-file packages/desktop/Aegisub.desktop --icon-file packages/desktop/aegisub.png --executable src/aegisub + $(TOOL_APPIMAGE) Aegisub # The actual build rules .SUFFIXES: diff --git a/README.md b/README.md index 499266b09ea46f06478996e84a1aeab226599942..dd9bed9599d73d8964251fd08c9c4f3df49cae12 100644 --- a/README.md +++ b/README.md @@ -76,9 +76,12 @@ You may also consider the following rules: ### Build an appimage -First download the appimagetool binary and save it to the [tools](tools) -folder. If you don't do it manually, it will be done for you at some point by -the build scripts. +First, install `patchelf` (`apt install patchelf` or similar for your distro) +and [linuxdeploy](https://github.com/linuxdeploy/linuxdeploy). An AppImage of +linuxdeploy can be found [here](https://martinm.iiens.net/linuxdeploy). You +will also need to download the appimagetool binary and save it to the +[tools](tools) folder. If you don't do it manually, it will be done for you at +some point by the build scripts. ```bash wget https://github.com/probonopd/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage \ @@ -94,6 +97,17 @@ make -j$(nproc) make appimage ``` +The command to build the AppImage is the following and is performed by the +`make appimage`: + +```bash +linuxdeploy \ + --appdir Aegisub \ + --desktop-file packages/desktop/Aegisub.desktop \ + --icon-file packages/desktop/aegisub.png \ + --executable src/aegisub +``` + ### Windows Prerequisites: diff --git a/configure.ac b/configure.ac index 658f066da08b2f5adaad20d23881ff7f028967be..a81fdfb0274f759f828297a57281d1615db109cf 100644 --- a/configure.ac +++ b/configure.ac @@ -190,15 +190,25 @@ AC_ARG_ENABLE([appimage], [AEGISUB_APPIMAGE_ENABLED=$enableval], [AEGISUB_APPIMAGE_ENABLED=no]) AS_IF([test "x$AEGISUB_APPIMAGE_ENABLED" = "xyes"], [ - AC_MSG_CHECKING([Downloading AppImage creation tool]) - wget https://github.com/probonopd/AppImageKit/releases/download/continuous/appimagetool-`arch`.AppImage \ - -O tools/appimagetool.AppImage -o config.wget.log - chmod 00700 tools/appimagetool.AppImage - AS_IF([test $? -eq 0 ], [ - AC_MSG_RESULT([done]) - ], [ - AC_MSG_FAILURE([failed]) - ]) + # Download the AppImage creation tool, transforms the AppDir into an AppImage + AC_MSG_CHECKING([Downloading AppImage creation tool]) + wget https://github.com/probonopd/AppImageKit/releases/download/continuous/appimagetool-`arch`.AppImage -O tools/appimagetool.AppImage -o config.wget.log + chmod 00700 tools/appimagetool.AppImage + AS_IF([test $? -eq 0 ], [ + AC_MSG_RESULT([done]) + ], [ + AC_MSG_FAILURE([failed]) + ]) + + # Downlaod the AppDir management tool, create the AppDir + AC_MSG_CHECKING([Downloading LinuxDeploy creation tool]) + wget https://martinm.iiens.net/linuxdeploy -O tools/linuxdeploy -a config.wget.log + chmod 00700 tools/linuxdeploy + AS_IF([test $? -eq 0 ], [ + AC_MSG_RESULT([done]) + ], [ + AC_MSG_FAILURE([failed]) + ]) ], [ AC_MSG_NOTICE([Don't build with AppImage support]) ]) diff --git a/header.mk b/header.mk index c82d739747dcf2bdb166a25dfa609b7f172cbb36..589122f68c5bb09e097ada8ed4fe2bf1e9670524 100644 --- a/header.mk +++ b/header.mk @@ -40,7 +40,8 @@ DISTCLEANFILES += \ CLEANFILES += \ $(TOP)Aegisub/usr/bin/aegisub \ - $(wildcard $(TOP)Aegisub/usr/lib/*) + $(wildcard $(TOP)Aegisub/usr/lib/*) \ + $(TOP)Aegisub-x86_64.AppImage \ define MKDIR_INSTALL @$(BIN_MKDIR_P) $(dir $@) diff --git a/Aegisub/Aegisub.desktop b/packages/desktop/Aegisub.desktop similarity index 95% rename from Aegisub/Aegisub.desktop rename to packages/desktop/Aegisub.desktop index c630bbaf8a0924fbe733b75393ccccf8da029136..e39d8570e59ae2516a7a70b16ba09cd95751908e 100644 --- a/Aegisub/Aegisub.desktop +++ b/packages/desktop/Aegisub.desktop @@ -2,7 +2,7 @@ Version=1.0 Type=Application Name=Aegisub -Icon=aegisub-icon +Icon=aegisub GenericName=Subtitle Editor Comment=Create and edit subtitles for film and videos. Keywords=subtitles;video;audio;text diff --git a/packages/desktop/aegisub.png b/packages/desktop/aegisub.png new file mode 120000 index 0000000000000000000000000000000000000000..078e90af053092ec5cfbd41bcabc28fbaa7eb43e --- /dev/null +++ b/packages/desktop/aegisub.png @@ -0,0 +1 @@ +64x64.png \ No newline at end of file