Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix malformed Exec key in installed .desktop file #5847

Merged
merged 2 commits into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 0 additions & 54 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -445,57 +445,3 @@ install(DIRECTORY data/models/
DESTINATION ${PIONEER_INSTALL_DATADIR}/data/models
FILES_MATCHING PATTERN "*.sgm" PATTERN "*.dds" PATTERN "*.png"
)

list(APPEND install_txt
"AUTHORS.txt"
"Changelog.txt"
"editor.txt"
"Quickstart.txt"
"README.md"
"NEWS.md"
)

install(FILES ${install_txt} DESTINATION ${PIONEER_INSTALL_DATADIR})

install(DIRECTORY ${CMAKE_SOURCE_DIR}/licenses
DESTINATION ${PIONEER_INSTALL_DATADIR})

if(APPIMAGE_BUILD)
set(PIONEER_EXECUTABLE init_pioneer.sh)
set(PIONEER_SH_FILE ${CMAKE_BINARY_DIR}/init_pioneer.sh)
configure_file(init_pioneer.sh.cmakein ${PIONEER_SH_FILE} @ONLY)
install(FILES ${PIONEER_SH_FILE}
DESTINATION ${PIONEER_INSTALL_BINDIR}
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE
)
else(APPIMAGE_BUILD)
set(PIONEER_EXECUTABLE ${PIONEER_INSTALL_BINDIR}/pioneer)
endif(APPIMAGE_BUILD)

if (WIN32)
configure_file(pioneer.iss.cmakein pioneer.iss @ONLY)
file(GLOB win_libs ../pioneer-thirdparty/win32/bin/${MSVC_ARCH}/vs2019/*.dll)
install(FILES ${win_libs} DESTINATION ${CMAKE_INSTALL_PREFIX})
if(NOT ISCC)
set(ISCC "C:/Program Files (x86)/Inno Setup 6/ISCC.exe")
endif(NOT ISCC)
add_custom_target(win-installer COMMAND ${ISCC} /Q pioneer.iss)
endif (WIN32)

if (UNIX AND NOT PIONEER_INSTALL_INPLACE)
set(PIONEER_DESKTOP_FILE ${CMAKE_BINARY_DIR}/metadata/net.pioneerspacesim.Pioneer.desktop)
configure_file(metadata/net.pioneerspacesim.Pioneer.desktop.cmakein ${PIONEER_DESKTOP_FILE} @ONLY)
install(FILES ${PIONEER_DESKTOP_FILE}
DESTINATION ${CMAKE_INSTALL_DATADIR}/applications
)
install(FILES metadata/net.pioneerspacesim.Pioneer.metainfo.xml
DESTINATION ${CMAKE_INSTALL_DATADIR}/metainfo
)

foreach(_i IN ITEMS 16 22 24 32 40 48 64 128 256)
install(FILES application-icon/pngs/pioneer-${_i}x${_i}.png
DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/${_i}x${_i}/apps
RENAME net.pioneerspacesim.Pioneer.png
)
endforeach()
endif (UNIX AND NOT PIONEER_INSTALL_INPLACE)
62 changes: 62 additions & 0 deletions cmake/InstallPioneer.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Setup script for Pioneer installation paths

# ==============================================================================
# Install Path Setup
# ==============================================================================

if (WIN32)
# We don't want a 'bin' folder on Windows
# Setup the variables we use from GNUInstallDirs on unix platforms
Expand Down Expand Up @@ -43,3 +47,61 @@ if (NOT PIONEER_DATA_DIR)
endif (NOT PIONEER_DATA_DIR)

file(TO_NATIVE_PATH ${PIONEER_DATA_DIR} PIONEER_DATA_RUNTIME_DIR)

# ==============================================================================
# Misc. Installation Steps
# ==============================================================================

list(APPEND install_txt
"AUTHORS.txt"
"Changelog.txt"
"editor.txt"
"Quickstart.txt"
"README.md"
"NEWS.md"
)

install(FILES ${install_txt} DESTINATION ${PIONEER_INSTALL_DATADIR})

install(DIRECTORY ${CMAKE_SOURCE_DIR}/licenses
DESTINATION ${PIONEER_INSTALL_DATADIR})

if(APPIMAGE_BUILD)
set(PIONEER_EXECUTABLE init_pioneer.sh)
set(PIONEER_SH_FILE ${CMAKE_BINARY_DIR}/init_pioneer.sh)
configure_file(init_pioneer.sh.cmakein ${PIONEER_SH_FILE} @ONLY)
install(FILES ${PIONEER_SH_FILE}
DESTINATION ${PIONEER_INSTALL_BINDIR}
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE
)
else(APPIMAGE_BUILD)
set(PIONEER_EXECUTABLE ${CMAKE_INSTALL_FULL_BINDIR}/pioneer)
endif(APPIMAGE_BUILD)

if (WIN32)
configure_file(pioneer.iss.cmakein pioneer.iss @ONLY)
file(GLOB win_libs ../pioneer-thirdparty/win32/bin/${MSVC_ARCH}/vs2019/*.dll)
install(FILES ${win_libs} DESTINATION ${CMAKE_INSTALL_PREFIX})
if(NOT ISCC)
set(ISCC "C:/Program Files (x86)/Inno Setup 6/ISCC.exe")
endif(NOT ISCC)
add_custom_target(win-installer COMMAND ${ISCC} /Q pioneer.iss)
endif (WIN32)

if (UNIX AND NOT PIONEER_INSTALL_INPLACE)
set(PIONEER_DESKTOP_FILE ${CMAKE_BINARY_DIR}/metadata/net.pioneerspacesim.Pioneer.desktop)
configure_file(metadata/net.pioneerspacesim.Pioneer.desktop.cmakein ${PIONEER_DESKTOP_FILE} @ONLY)
install(FILES ${PIONEER_DESKTOP_FILE}
DESTINATION ${CMAKE_INSTALL_DATADIR}/applications
)
install(FILES metadata/net.pioneerspacesim.Pioneer.metainfo.xml
DESTINATION ${CMAKE_INSTALL_DATADIR}/metainfo
)

foreach(_i IN ITEMS 16 22 24 32 40 48 64 128 256)
install(FILES application-icon/pngs/pioneer-${_i}x${_i}.png
DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/${_i}x${_i}/apps
RENAME net.pioneerspacesim.Pioneer.png
)
endforeach()
endif (UNIX AND NOT PIONEER_INSTALL_INPLACE)