Skip to content

Commit

Permalink
Fix makeself installer script
Browse files Browse the repository at this point in the history
  • Loading branch information
tresf committed Jun 1, 2024
1 parent 9171f10 commit 0769ad4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
8 changes: 4 additions & 4 deletions cmake/linux/LinuxDeploy.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ if(CPACK_TOOL STREQUAL "makeself" OR "$ENV{CPACK_TOOL}" STREQUAL "makeself")
message(STATUS "Finishing the .run file using ${MAKESELF_BIN}...")
string(REPLACE ".AppImage" ".run" RUN_FILE "${APPIMAGE_FILE}")
configure_file(
"${CPACK_SOURCE_DIR}/cmake/linux/makeself_setup.sh.in" "${CPACK_CURRENT_BINARY_DIR}/setup.sh" @ONLY
"${CPACK_SOURCE_DIR}/cmake/linux/makeself_setup.sh.in" "${APP}/setup.sh" @ONLY
FILE_PERMISSIONS
OWNER_EXECUTE OWNER_WRITE OWNER_READ
GROUP_EXECUTE GROUP_WRITE GROUP_READ
Expand All @@ -215,16 +215,16 @@ if(CPACK_TOOL STREQUAL "makeself" OR "$ENV{CPACK_TOOL}" STREQUAL "makeself")
set(ERROR_QUIET ERROR_QUIET)
endif()

file(REMOVE "${RUN_FILE}")

# makeself.sh [args] archive_dir file_name label startup_script [script_args]
file(REMOVE "${RUN_FILE}")
execute_process(COMMAND makeself
--keep-umask
--nox11
${MAKESELF_QUIET}
"${APP}"
"${RUN_FILE}"
"${LMMS} Installer"
"${CPACK_CURRENT_BINARY_DIR}/setup.sh"
"./setup.sh"
${OUTPUT_QUIET}
COMMAND_ECHO ${COMMAND_ECHO}
COMMAND_ERROR_IS_FATAL ANY)
Expand Down
7 changes: 4 additions & 3 deletions cmake/linux/makeself_setup.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@ fi
mkdir -p "${DESTDIR}"
unalias cp &> /dev/null || true
cp -rf ./* "${DESTDIR}"
rm -f "${DESTDIR}/setup.sh"
mv "${DESTDIR}/AppRun" "${DESTDIR}/lmms"

# Test LMMS
LMMS="${DESTDIR}/usr/bin/@CPACK_PROJECT_NAME@"
echo "Installation complete... Testing \"$LMMS\"..."
"$LMMS" --version
"${DESTDIR}/lmms" --allowroot --version &> /dev/null

# TODO: Register file associations, desktop icon, etc

echo "@CPACK_PROJECT_NAME_UCASE@ was installed successfully to ${DESTDIR}. To run:"
echo " $LMMS"
echo " ${DESTDIR}/lmms"

0 comments on commit 0769ad4

Please sign in to comment.