Skip to content
Extraits de code Groupes Projets
Vérifiée Valider 0697c38b rédigé par Kubat's avatar Kubat
Parcourir les fichiers

[build] update rules to build AppImages

parent 02edd8ed
Branches
Aucune étiquette associée trouvée
1 requête de fusion!2Rework build process
Ce commit fait partie de la requête de fusion !2. Les commentaires créés ici seront créés dans le contexte de cette requête de fusion.
...@@ -21,6 +21,7 @@ LIB := $(LIB) ...@@ -21,6 +21,7 @@ LIB := $(LIB)
# PLATFORM SETTINGS # PLATFORM SETTINGS
################### ###################
BUILD_DARWIN = @build_darwin@ BUILD_DARWIN = @build_darwin@
BUILD_LINUX = @build_linux@
####### #######
# FLAGS # FLAGS
......
ifneq (yes, $(INCLUDING_CHILD_MAKEFILES)) ifneq (yes, $(INCLUDING_CHILD_MAKEFILES))
COMMANDS := all install clean distclean test depclean osx-bundle osx-dmg test-automation test-libaegisub style tags appimage COMMANDS := all install clean distclean test depclean osx-bundle osx-dmg test-automation test-libaegisub style tags
ifeq (yes, $(BUILD_LINUX))
COMMANDS := $(COMMANDS) appimage
endif
.PHONY: $(COMMANDS) .PHONY: $(COMMANDS)
.DEFAULT_GOAL := all .DEFAULT_GOAL := all
...@@ -41,10 +44,9 @@ endef ...@@ -41,10 +44,9 @@ endef
$(foreach target,$(LIB),$(eval $(call set_target_flags,$(target),$(TOP)lib/lib$(target).a))) $(foreach target,$(LIB),$(eval $(call set_target_flags,$(target),$(TOP)lib/lib$(target).a)))
$(foreach target,$(PROGRAM),$(eval $(call set_target_flags,$(notdir $(target)),$(target)))) $(foreach target,$(PROGRAM),$(eval $(call set_target_flags,$(notdir $(target)),$(target))))
# Create the build and install targets for programs # Create the build and install targets for programs. Not done with a pattern
# Not done with a pattern rule since the pattern would be just %: and doing that # rule since the pattern would be just %: and doing that leads to make trying
# leads to make trying to use gcc to make any nonexistent targets rather than # to use gcc to make any nonexistent targets rather than erroring
# erroring
define create_program_targets define create_program_targets
ifdef $1_INSTALLNAME ifdef $1_INSTALLNAME
install: $(DESTDIR)$(P_BINDIR)/$($1_INSTALLNAME) install: $(DESTDIR)$(P_BINDIR)/$($1_INSTALLNAME)
...@@ -80,6 +82,7 @@ all: $(LIB_TARGETS) ...@@ -80,6 +82,7 @@ all: $(LIB_TARGETS)
clean: clean:
$(BIN_RM) -f $(OBJ) $(CLEANFILES) $(LIB_TARGETS) $(BIN_RM) -f $(OBJ) $(CLEANFILES) $(LIB_TARGETS)
$(BIN_RM) -rf $(CLEANDIRS)
distclean: clean distclean: clean
$(BIN_RM) -rf $(DISTCLEANFILES) $(DEP) $(BIN_RM) -rf $(DISTCLEANFILES) $(DEP)
...@@ -90,12 +93,12 @@ depclean: clean ...@@ -90,12 +93,12 @@ depclean: clean
install: install:
style: style:
./tools/astyle.bash $(TOP)tools/astyle.bash
tags: tags:
./tools/tags.bash $(TOP)tools/tags.bash
appimage: src/aegisub packages/desktop/Aegisub.desktop packages/desktop/aegisub.png appimage: src/aegisub packages/desktop/Aegisub.desktop packages/desktop/aegisub.png install
$(TOOL_LINUXDEPLOY) --appdir Aegisub --desktop-file packages/desktop/Aegisub.desktop --icon-file packages/desktop/aegisub.png --executable src/aegisub $(TOOL_LINUXDEPLOY) --appdir Aegisub --desktop-file packages/desktop/Aegisub.desktop --icon-file packages/desktop/aegisub.png --executable src/aegisub
$(TOOL_APPIMAGE) Aegisub $(TOOL_APPIMAGE) Aegisub
...@@ -119,9 +122,9 @@ POST_FLAGS = $($@_FLAGS) -c -o $@ $< ...@@ -119,9 +122,9 @@ POST_FLAGS = $($@_FLAGS) -c -o $@ $<
.SECONDEXPANSION: .SECONDEXPANSION:
# Libraries contain all object files they depend on (but they may depend on other files) # Libraries contain all object files they depend on (but they may depend on
# Not using libtool on OS X because it has an unsilenceable warning about a # other files). Not using libtool on OS X because it has an unsilenceable
# compatibility issue with BSD 4.3 (wtf) # warning about a compatibility issue with BSD 4.3 (wtf)
lib%.a: $$($$*_OBJ) lib%.a: $$($$*_OBJ)
@$(BIN_MKDIR_P) $(dir $@) @$(BIN_MKDIR_P) $(dir $@)
$(BIN_AR) cru $@ $(filter %.o,$^) $(BIN_AR) cru $@ $(filter %.o,$^)
......
...@@ -62,7 +62,7 @@ Once all the dependencies are installed, run: ...@@ -62,7 +62,7 @@ Once all the dependencies are installed, run:
```bash ```bash
autoreconf autoreconf
./configure --enable-debug --with-libpulse ./configure --enable-debug --enable-debug-exceptions --with-libpulse --disable-update-checker --enable-silent-rules --without-system-luajit
make -j$(nproc) make -j$(nproc)
make install make install
``` ```
...@@ -83,31 +83,15 @@ will also need to download the appimagetool binary and save it to the ...@@ -83,31 +83,15 @@ 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 [tools](tools) folder. If you don't do it manually, it will be done for you at
some point by the build scripts. some point by the build scripts.
```bash To build the AppImage, juste use the following commands:
wget https://github.com/probonopd/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage \
-O tools/appimagetool.AppImage
```
Then, build normally aegisub, but with the appimage options:
```bash ```bash
autoreconf autoreconf
./configure --enable-debug --with-libpulse --enable-appimage ./configure --with-libpulse --enable-silent-rules --disable-update-checker --without-system-luajit --enable-appimage
make -j$(nproc) make -j$(nproc)
make appimage 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 ### Windows
Prerequisites: Prerequisites:
......
...@@ -41,6 +41,7 @@ AS_CASE([$host], ...@@ -41,6 +41,7 @@ AS_CASE([$host],
[*-*-linux*], [build_linux="yes"]) [*-*-linux*], [build_linux="yes"])
AC_SUBST(build_darwin) AC_SUBST(build_darwin)
AC_SUBST(build_linux)
######################## ########################
# Configurable variables # Configurable variables
...@@ -75,6 +76,39 @@ AC_SUBST(P_ICON) ...@@ -75,6 +76,39 @@ AC_SUBST(P_ICON)
# set it to $ac_default_prefix if it hasn't been supplied. # set it to $ac_default_prefix if it hasn't been supplied.
AS_CASE([x$prefix], [xNONE | x], [prefix="$ac_default_prefix"], []) AS_CASE([x$prefix], [xNONE | x], [prefix="$ac_default_prefix"], [])
# Build with appimage support
# Do this here because we will override the install path
AC_ARG_ENABLE([appimage],
[AS_HELP_STRING([--enable-appimage], [Build Aegisub as an AppImage. Defaults to no])],
[AEGISUB_APPIMAGE_ENABLED=$enableval],
[AEGISUB_APPIMAGE_ENABLED=no])
AS_IF([test "x$AEGISUB_APPIMAGE_ENABLED" = "xyes"], [
# 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])
])
# Override prefix
prefix="$PWD/Aegisub/usr"
], [
AC_MSG_NOTICE([Don't build with AppImage support])
])
# Install prefix used by wxStandardPaths::SetInstallPrefix. # Install prefix used by wxStandardPaths::SetInstallPrefix.
AC_DEFINE_UNQUOTED([INSTALL_PREFIX], ["$prefix"], [Default install prefix, or --prefix.]) AC_DEFINE_UNQUOTED([INSTALL_PREFIX], ["$prefix"], [Default install prefix, or --prefix.])
...@@ -182,37 +216,6 @@ AC_CHECK_HEADERS([sys/time.h]) ...@@ -182,37 +216,6 @@ AC_CHECK_HEADERS([sys/time.h])
AC_ARG_ENABLE(sanity-checks, AC_ARG_ENABLE(sanity-checks,
AS_HELP_STRING([--disable-sanity-checks],[Skip verifying that found libraries work.])) AS_HELP_STRING([--disable-sanity-checks],[Skip verifying that found libraries work.]))
#############################
# Build with appimage support
#############################
AC_ARG_ENABLE([appimage],
[AS_HELP_STRING([--enable-appimage], [Build Aegisub as an AppImage. Defaults to no])],
[AEGISUB_APPIMAGE_ENABLED=$enableval],
[AEGISUB_APPIMAGE_ENABLED=no])
AS_IF([test "x$AEGISUB_APPIMAGE_ENABLED" = "xyes"], [
# 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])
])
############################## ##############################
# Program Support and Features # Program Support and Features
############################## ##############################
......
...@@ -39,10 +39,12 @@ DISTCLEANFILES += \ ...@@ -39,10 +39,12 @@ DISTCLEANFILES += \
$(TOP)aclocal.m4 \ $(TOP)aclocal.m4 \
CLEANFILES += \ CLEANFILES += \
$(TOP)Aegisub/usr/bin/aegisub \
$(wildcard $(TOP)Aegisub/usr/lib/*) \ $(wildcard $(TOP)Aegisub/usr/lib/*) \
$(TOP)Aegisub-x86_64.AppImage \ $(TOP)Aegisub-x86_64.AppImage \
CLEANDIRS += \
$(TOP)Aegisub \
define MKDIR_INSTALL define MKDIR_INSTALL
@$(BIN_MKDIR_P) $(dir $@) @$(BIN_MKDIR_P) $(dir $@)
$(BIN_INSTALL) -m644 $< $@ $(BIN_INSTALL) -m644 $< $@
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter