From 14407d4dcd943a83cca016de8cdec8d7776b6fcc Mon Sep 17 00:00:00 2001 From: Alexander Akulich Date: Sat, 29 Jul 2023 17:32:16 +0300 Subject: [PATCH] WIP on linux packaging/branding --- CMakeLists.txt | 22 +++++++----- other/{ddnet.desktop => app.desktop.in} | 8 ++--- other/infclass.appdata.xml | 46 +++++++++++++++++++++++++ 3 files changed, 64 insertions(+), 12 deletions(-) rename other/{ddnet.desktop => app.desktop.in} (60%) create mode 100644 other/infclass.appdata.xml diff --git a/CMakeLists.txt b/CMakeLists.txt index 10593facfa6..215ccf5462d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2916,6 +2916,12 @@ function(regex_inverted VAR) set(${VAR} ${RESULT} PARENT_SCOPE) endfunction() +string(TOLOWER "${PROJECT_NAME}" LOWERED_NAME) +set(CLIENT_ICON_NAME ${LOWERED_NAME}) +if(TARGET_OS STREQUAL "linux") + configure_file("other/app.desktop.in" "${LOWERED_NAME}.desktop") +endif() + set(CPACK_PACKAGE_NAME ${PROJECT_NAME}) set(CPACK_GENERATOR TGZ TXZ) set(CPACK_ARCHIVE_COMPONENT_INSTALL ON) @@ -3048,28 +3054,28 @@ endif() if(NOT DEV) include(GNUInstallDirs) - install(DIRECTORY data DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/ddnet COMPONENT data) + install(DIRECTORY data DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${LOWERED_NAME} COMPONENT data) if(TARGET game-client) install(TARGETS game-client DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT client) endif() if(STEAMAPI_KIND STREQUAL SHARED) - install(TARGETS ${TARGET_STEAMAPI} DESTINATION ${CMAKE_INSTALL_LIBDIR}/ddnet COMPONENT client) + install(TARGETS ${TARGET_STEAMAPI} DESTINATION ${CMAKE_INSTALL_LIBDIR}/${LOWERED_NAME} COMPONENT client) endif() if(TARGET game-server) install(TARGETS game-server DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT server) endif() if(ANTIBOT) - install(TARGETS ${TARGET_ANTIBOT} DESTINATION ${CMAKE_INSTALL_LIBDIR}/ddnet COMPONENT server) + install(TARGETS ${TARGET_ANTIBOT} DESTINATION ${CMAKE_INSTALL_LIBDIR}/${LOWERED_NAME} COMPONENT server) endif() - install(TARGETS ${TARGETS_TOOLS} DESTINATION ${CMAKE_INSTALL_LIBDIR}/ddnet COMPONENT tools) - install(FILES other/ddnet.desktop DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications COMPONENT client) - install(FILES other/ddnet.appdata.xml DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/metainfo COMPONENT client) + install(TARGETS ${TARGETS_TOOLS} DESTINATION ${CMAKE_INSTALL_LIBDIR}/${LOWERED_NAME} COMPONENT tools) + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${LOWERED_NAME}.desktop" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/applications/" COMPONENT client) + install(FILES other/${LOWERED_NAME}.appdata.xml DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/metainfo/ COMPONENT client) foreach(SIZE 16 32 48 256) - install(FILES other/icons/DDNet_${SIZE}x${SIZE}x32.png DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/${SIZE}x${SIZE}/apps RENAME ddnet.png COMPONENT client) + install(FILES other/icons/DDNet_${SIZE}x${SIZE}x32.png DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/${SIZE}x${SIZE}/apps RENAME ${CLIENT_ICON_NAME}.png COMPONENT client) install(FILES other/icons/DDNet-Server_${SIZE}x${SIZE}x32.png DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/${SIZE}x${SIZE}/apps RENAME ddnet-server.png COMPONENT server) endforeach() foreach(file ${VULKAN_SHADER_FILE_LIST}) - install(FILES ${PROJECT_BINARY_DIR}/${file} DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/ddnet/data/shader/vulkan COMPONENT client) + install(FILES ${PROJECT_BINARY_DIR}/${file} DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${LOWERED_NAME}/data/shader/vulkan COMPONENT client) endforeach() endif() diff --git a/other/ddnet.desktop b/other/app.desktop.in similarity index 60% rename from other/ddnet.desktop rename to other/app.desktop.in index ab497ae4d0f..283ed172f02 100644 --- a/other/ddnet.desktop +++ b/other/app.desktop.in @@ -1,11 +1,11 @@ [Desktop Entry] Type=Application -Name=DDNet +Name=${PROJECT_NAME} GenericName=Platform Game -Exec=DDNet %u -Icon=ddnet +Exec=${CLIENT_EXECUTABLE} %u +Icon=${CLIENT_ICON_NAME} Terminal=false Keywords=game;multiplayer; Categories=Game;ArcadeGame; MimeType=x-scheme-handler/ddnet; -Comment=Launch DDNet +Comment=Launch ${PROJECT_NAME} diff --git a/other/infclass.appdata.xml b/other/infclass.appdata.xml new file mode 100644 index 00000000000..bf104ed7084 --- /dev/null +++ b/other/infclass.appdata.xml @@ -0,0 +1,46 @@ + + + infclass.desktop + CC0-1.0 + CC-BY-SA-3.0 and Apache-2.0 + Infclass + + Infclass client is a DDNet-based teeworlds client with infclass features + + +

+ Infclass client is a fork of DDNet teeworlds client with mod-specific + features, such as enhanced kill messages, various indicators, binds, + and custom graphics. + The client is intentionally identical to DDNet on non-infclass servers. +

+
+ + + https://ddnet.org/screenshots/1.png + + + https://ddnet.org/screenshots/2.png + + + https://ddnet.org/screenshots/3.png + + + + multiplayer + teeworlds + game + + + moderate + intense + + + + + https://infclass.github.io/ + https://github.com/infclass/infclass-client/issues + + Infclass + +