Skip to content

Commit d145f78

Browse files
authored
AppImage: Use fully qualified path when calling appimagetool (LMMS#7707)
AppImage: Use fully qualified path when calling appimagetool
1 parent e328a13 commit d145f78

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

cmake/linux/LinuxDeploy.cmake

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -57,19 +57,14 @@ file(GLOB cleanup "${CPACK_BINARY_DIR}/${lmms}-*.json"
5757
list(SORT cleanup)
5858
file(REMOVE ${cleanup})
5959

60-
# Download linuxdeploy, expose bundled appimagetool to PATH
60+
# Download and extract linuxdeploy
6161
download_binary(LINUXDEPLOY_BIN
6262
"https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-${ARCH}.AppImage"
6363
linuxdeploy-${ARCH}.AppImage
6464
FALSE)
6565

66-
# Symlink nested appimagetool
67-
set(_APPIMAGETOOL_LINK "${CPACK_CURRENT_BINARY_DIR}/appimagetool")
68-
if(NOT EXISTS "${_APPIMAGETOOL_LINK}")
69-
set(_APPIMAGETOOL "${CPACK_CURRENT_BINARY_DIR}/.linuxdeploy-${ARCH}.AppImage/squashfs-root/plugins/linuxdeploy-plugin-appimage/appimagetool-prefix/AppRun")
70-
message(STATUS "Creating a symbolic link ${_APPIMAGETOOL_LINK} which points to ${_APPIMAGETOOL}")
71-
create_symlink("${_APPIMAGETOOL}" "${_APPIMAGETOOL_LINK}")
72-
endif()
66+
# Guess the path to appimagetool
67+
set(APPIMAGETOOL_BIN "${CPACK_CURRENT_BINARY_DIR}/.linuxdeploy-${ARCH}.AppImage/squashfs-root/plugins/linuxdeploy-plugin-appimage/appimagetool-prefix/AppRun")
7368

7469
# Download linuxdeploy-plugin-qt
7570
download_binary(LINUXDEPLOY_PLUGIN_BIN
@@ -111,9 +106,6 @@ endif()
111106
get_filename_component(QTBIN "${CPACK_QMAKE_EXECUTABLE}" DIRECTORY)
112107
set(ENV{PATH} "${QTBIN}:$ENV{PATH}")
113108

114-
# Ensure "linuxdeploy-<arch>.AppImage" and "appimagetool" binaries are first on the PATH
115-
set(ENV{PATH} "${CPACK_CURRENT_BINARY_DIR}:$ENV{PATH}")
116-
117109
# Promote finding our own libraries first
118110
set(ENV{LD_LIBRARY_PATH} "${APP}/usr/lib/${lmms}/:${APP}/usr/lib/${lmms}/optional:$ENV{LD_LIBRARY_PATH}")
119111

@@ -171,6 +163,7 @@ execute_process(COMMAND "${LINUXDEPLOY_BIN}"
171163
${LIBRARIES}
172164
${SKIP_LIBRARIES}
173165
--verbosity ${VERBOSITY}
166+
WORKING_DIRECTORY "${CPACK_CURRENT_BINARY_DIR}"
174167
${OUTPUT_QUIET}
175168
COMMAND_ECHO ${COMMAND_ECHO}
176169
COMMAND_ERROR_IS_FATAL ANY)
@@ -278,7 +271,7 @@ if(CPACK_TOOL STREQUAL "appimagetool")
278271
# appimage plugin needs ARCH set when running in extracted form from squashfs-root / CI
279272
set(ENV{ARCH} "${ARCH}")
280273
message(STATUS "Finishing the AppImage...")
281-
execute_process(COMMAND ${CPACK_TOOL} "${APP}" "${APPIMAGE_FILE}"
274+
execute_process(COMMAND "${APPIMAGETOOL_BIN}" "${APP}" "${APPIMAGE_FILE}"
282275
${APPIMAGETOOL_VERBOSITY}
283276
${OUTPUT_QUIET}
284277
COMMAND_ECHO ${COMMAND_ECHO}

0 commit comments

Comments
 (0)