mirror of
https://github.com/LizardByte/Sunshine.git
synced 2025-01-30 03:32:43 +00:00
build(cmake): Use GNUInstallDirs to install data and lib directories (#1817)
This commit is contained in:
parent
44b34d1e23
commit
faeeb7ec57
@ -9,9 +9,9 @@ if(${SUNSHINE_BUILD_APPIMAGE} OR ${SUNSHINE_BUILD_FLATPAK})
|
||||
DESTINATION "${SUNSHINE_ASSETS_DIR}/systemd/user")
|
||||
else()
|
||||
install(FILES "${SUNSHINE_SOURCE_ASSETS_DIR}/linux/misc/85-sunshine.rules"
|
||||
DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/udev/rules.d")
|
||||
DESTINATION "${CMAKE_INSTALL_LIBDIR}/udev/rules.d")
|
||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/sunshine.service"
|
||||
DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/systemd/user")
|
||||
DESTINATION "${CMAKE_INSTALL_LIBDIR}/systemd/user")
|
||||
endif()
|
||||
|
||||
# Post install
|
||||
@ -63,19 +63,19 @@ set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS OFF)
|
||||
|
||||
# application icon
|
||||
install(FILES "${CMAKE_SOURCE_DIR}/sunshine.svg"
|
||||
DESTINATION "${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/scalable/apps")
|
||||
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/scalable/apps")
|
||||
|
||||
# tray icon
|
||||
if(${SUNSHINE_TRAY} STREQUAL 1)
|
||||
install(FILES "${CMAKE_SOURCE_DIR}/sunshine.svg"
|
||||
DESTINATION "${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/scalable/status"
|
||||
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/scalable/status"
|
||||
RENAME "sunshine-tray.svg")
|
||||
install(FILES "${SUNSHINE_SOURCE_ASSETS_DIR}/common/assets/web/public/images/sunshine-playing.svg"
|
||||
DESTINATION "${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/scalable/status")
|
||||
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/scalable/status")
|
||||
install(FILES "${SUNSHINE_SOURCE_ASSETS_DIR}/common/assets/web/public/images/sunshine-pausing.svg"
|
||||
DESTINATION "${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/scalable/status")
|
||||
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/scalable/status")
|
||||
install(FILES "${SUNSHINE_SOURCE_ASSETS_DIR}/common/assets/web/public/images/sunshine-locked.svg"
|
||||
DESTINATION "${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/scalable/status")
|
||||
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/scalable/status")
|
||||
|
||||
set(CPACK_DEBIAN_PACKAGE_DEPENDS "\
|
||||
${CPACK_DEBIAN_PACKAGE_DEPENDS}, \
|
||||
@ -89,17 +89,17 @@ endif()
|
||||
# desktop file
|
||||
# todo - validate desktop files with `desktop-file-validate`
|
||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/sunshine.desktop"
|
||||
DESTINATION "${CMAKE_INSTALL_PREFIX}/share/applications")
|
||||
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/applications")
|
||||
if(NOT ${SUNSHINE_BUILD_APPIMAGE})
|
||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/sunshine_terminal.desktop"
|
||||
DESTINATION "${CMAKE_INSTALL_PREFIX}/share/applications")
|
||||
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/applications")
|
||||
endif()
|
||||
if(${SUNSHINE_BUILD_FLATPAK})
|
||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/sunshine_kms.desktop"
|
||||
DESTINATION "${CMAKE_INSTALL_PREFIX}/share/applications")
|
||||
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/applications")
|
||||
endif()
|
||||
|
||||
# metadata file
|
||||
# todo - validate file with `appstream-util validate-relax`
|
||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/sunshine.appdata.xml"
|
||||
DESTINATION "${CMAKE_INSTALL_PREFIX}/share/metainfo")
|
||||
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/metainfo")
|
||||
|
@ -1,6 +1,8 @@
|
||||
# unix specific packaging
|
||||
# put anything here that applies to both linux and macos
|
||||
|
||||
include(GNUInstallDirs)
|
||||
|
||||
# return here if building a macos package
|
||||
if(SUNSHINE_PACKAGE_MACOS)
|
||||
return()
|
||||
|
@ -12,9 +12,9 @@ Actions=RunInTerminal;KMS;
|
||||
[Desktop Action RunInTerminal]
|
||||
Name=Run in Terminal
|
||||
Icon=application-x-executable
|
||||
Exec=gio launch @CMAKE_INSTALL_PREFIX@/share/applications/sunshine_terminal.desktop
|
||||
Exec=gio launch @CMAKE_INSTALL_DATAROOTDIR@/applications/sunshine_terminal.desktop
|
||||
|
||||
[Desktop Action KMS]
|
||||
Name=Run in Terminal (KMS)
|
||||
Icon=application-x-executable
|
||||
Exec=gio launch @CMAKE_INSTALL_PREFIX@/share/applications/sunshine_kms.desktop
|
||||
Exec=gio launch @CMAKE_INSTALL_DATAROOTDIR@/applications/sunshine_kms.desktop
|
||||
|
@ -12,4 +12,4 @@ Actions=RunInTerminal;
|
||||
[Desktop Action RunInTerminal]
|
||||
Name=Run in Terminal
|
||||
Icon=application-x-executable
|
||||
Exec=gio launch @CMAKE_INSTALL_PREFIX@/share/applications/sunshine_terminal.desktop
|
||||
Exec=gio launch @CMAKE_INSTALL_DATAROOTDIR@/applications/sunshine_terminal.desktop
|
||||
|
Loading…
x
Reference in New Issue
Block a user