From c613a1c95820c0e6aaa8bc44d94b26c516780575 Mon Sep 17 00:00:00 2001 From: swirl Date: Thu, 30 Dec 2021 11:53:17 -0500 Subject: [PATCH] add .desktop file --- CMakeLists.txt | 25 ++++++++++++++----------- README.md | 2 +- program_info/CMakeLists.txt | 1 + program_info/polymc.desktop | 11 +++++++++++ 4 files changed, 27 insertions(+), 12 deletions(-) create mode 100644 program_info/polymc.desktop diff --git a/CMakeLists.txt b/CMakeLists.txt index ab7fc7bd..27b37c97 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -200,20 +200,23 @@ elseif(Launcher_LAYOUT_REAL STREQUAL "lin-nodeps") install(PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/LauncherScript" DESTINATION ${BUNDLE_DEST_DIR} RENAME ${Launcher_Name}) elseif(Launcher_LAYOUT_REAL STREQUAL "lin-system") - set(Launcher_APP_BINARY_NAME "polymc" CACHE STRING "Name of the Launcher binary") - set(Launcher_BINARY_DEST_DIR "bin" CACHE STRING "Path to the binary directory") - set(Launcher_LIBRARY_DEST_DIR "lib${LIB_SUFFIX}" CACHE STRING "Path to the library directory") - set(Launcher_SHARE_DEST_DIR "share/polymc" CACHE STRING "Path to the shard data directory") - set(JARS_DEST_DIR "${Launcher_SHARE_DEST_DIR}/jars") + set(Launcher_APP_BINARY_NAME "polymc" CACHE STRING "Name of the Launcher binary") + set(Launcher_BINARY_DEST_DIR "bin" CACHE STRING "Path to the binary directory") + set(Launcher_LIBRARY_DEST_DIR "lib${LIB_SUFFIX}" CACHE STRING "Path to the library directory") + set(Launcher_SHARE_DEST_DIR "share/polymc" CACHE STRING "Path to the shared data directory") + set(JARS_DEST_DIR "${Launcher_SHARE_DEST_DIR}/jars") + set(Launcher_DESKTOP_DEST_DIR "share/applications" CACHE STRING "Path to the desktop file directory") - set(BINARY_DEST_DIR ${Launcher_BINARY_DEST_DIR}) - set(LIBRARY_DEST_DIR ${Launcher_LIBRARY_DEST_DIR}) + set(BINARY_DEST_DIR ${Launcher_BINARY_DEST_DIR}) + set(LIBRARY_DEST_DIR ${Launcher_LIBRARY_DEST_DIR}) - MESSAGE(STATUS "Compiling for linux system with ${Launcher_SHARE_DEST_DIR} and LAUNCHER_LINUX_DATADIR") - SET(Launcher_APP_BINARY_DEFS "-DMULTIMC_JARS_LOCATION=${CMAKE_INSTALL_PREFIX}/${JARS_DEST_DIR}" "-DLAUNCHER_LINUX_DATADIR") + MESSAGE(STATUS "Compiling for linux system with ${Launcher_SHARE_DEST_DIR} and LAUNCHER_LINUX_DATADIR") + SET(Launcher_APP_BINARY_DEFS "-DMULTIMC_JARS_LOCATION=${CMAKE_INSTALL_PREFIX}/${JARS_DEST_DIR}" "-DLAUNCHER_LINUX_DATADIR") - # install as bundle with no dependencies included - set(INSTALL_BUNDLE "nodeps") + install(FILES ${Launcher_Desktop} DESTINATION ${Launcher_DESKTOP_DEST_DIR}) + + # install as bundle with no dependencies included + set(INSTALL_BUNDLE "nodeps") elseif(Launcher_LAYOUT_REAL STREQUAL "win-bundle") set(BINARY_DEST_DIR ".") diff --git a/README.md b/README.md index d3d3f95d..e01d18a4 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Several source build packages are available, along with experimental pre-built g - Last build status: https://jenkins.polymc.org/job/PolyMC/lastBuild/ - [Linux (AMD64) System](https://packages.polymc.org/latest/lin64-system/lin64-system.tar.zst) ([SHA256](https://packages.polymc.org/latest/lin64-system/lin64-system.tar.zst.sha256)) - this is a generic system package intended to be used as a base for making distro-specific packages. - [Windows (32-bit)](https://packages.polymc.org/latest/win32/win32.zip) ([SHA256](https://packages.polymc.org/latest/win32/win32.zip.sha256)) - this is a portable package, you can extract it anywhere and run it. This package needs testing. -- [Debian (AMD64](https://packages.polymc.org/latest/deb/polymc-amd64.deb) ([SHA256](https://packages.polymc.org/latest/deb/polymc-amd64.deb.sha256)) - this is intended to be installed with `dpkg -i`. Alternatively, you may build the `.deb` yourself, by going to `packages/debian` and running `./makedeb.sh`. +- [Debian (AMD64)](https://packages.polymc.org/latest/deb/polymc-amd64.deb) ([SHA256](https://packages.polymc.org/latest/deb/polymc-amd64.deb.sha256)) - this is intended to be installed with `dpkg -i`. Alternatively, you may build the `.deb` yourself, by going to `packages/debian` and running `./makedeb.sh`. - MacOS currently does not have any packages. We are still working on setting up MacOS packaging. ## Development diff --git a/program_info/CMakeLists.txt b/program_info/CMakeLists.txt index c1711201..dd120ab3 100644 --- a/program_info/CMakeLists.txt +++ b/program_info/CMakeLists.txt @@ -8,6 +8,7 @@ set(Launcher_UserAgent "${Launcher_CommonName}/5.0" PARENT_SCOPE) set(Launcher_ConfigFile "polymc.cfg" PARENT_SCOPE) set(Launcher_Git "https://github.com/PolyMC/PolyMC" PARENT_SCOPE) +set(Launcher_Desktop "program_info/polymc.desktop" PARENT_SCOPE) set(Launcher_Branding_ICNS "program_info/Launcher.icns" PARENT_SCOPE) set(Launcher_Branding_WindowsRC "program_info/launcher.rc" PARENT_SCOPE) set(Launcher_Branding_LogoQRC "program_info/logo.qrc" PARENT_SCOPE) diff --git a/program_info/polymc.desktop b/program_info/polymc.desktop new file mode 100644 index 00000000..3d637e6e --- /dev/null +++ b/program_info/polymc.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Version=1.0 +Name=PolyMC +Comment=A custom launcher for Minecraft that allows you to easily manage multiple installations of Minecraft at once. +Type=Application +Terminal=false +Exec=PolyMC +StartupNotify=true +Icon=null +Categories=Game; +Keywords=game;minecraft;launcher;