Skip to content

Commit

Permalink
WIP on linux packaging/branding
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaffeine committed Oct 6, 2023
1 parent 9165928 commit 14407d4
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 12 deletions.
22 changes: 14 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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()

Expand Down
8 changes: 4 additions & 4 deletions other/ddnet.desktop → other/app.desktop.in
Original file line number Diff line number Diff line change
@@ -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}
46 changes: 46 additions & 0 deletions other/infclass.appdata.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop-application">
<id>infclass.desktop</id>
<metadata_license>CC0-1.0</metadata_license>
<project_license>CC-BY-SA-3.0 and Apache-2.0</project_license>
<name>Infclass</name>
<summary>
Infclass client is a DDNet-based teeworlds client with infclass features
</summary>
<description>
<p>
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.
</p>
</description>
<screenshots>
<screenshot type="default">
<image>https://ddnet.org/screenshots/1.png</image>
</screenshot>
<screenshot>
<image>https://ddnet.org/screenshots/2.png</image>
</screenshot>
<screenshot>
<image>https://ddnet.org/screenshots/3.png</image>
</screenshot>
</screenshots>
<keywords>
<keyword>multiplayer</keyword>
<keyword>teeworlds</keyword>
<keyword>game</keyword>
</keywords>
<content_rating type="oars-1.1">
<content_attribute id="violence-cartoon">moderate</content_attribute>
<content_attribute id="social-chat">intense</content_attribute>
</content_rating>
<releases>
<release date="2023-06-25" version="0.1.7"/>
</releases>
<url type="homepage">https://infclass.github.io/</url>
<url type="bugtracker">https://github.com/infclass/infclass-client/issues</url>
<provides>
<binary>Infclass</binary>
</provides>
</component>

0 comments on commit 14407d4

Please sign in to comment.