From 54593bdb1ac8ab4e242a5e9d6e499a8f1617283e Mon Sep 17 00:00:00 2001 From: boombatower Date: Sat, 1 Nov 2014 21:28:18 -0500 Subject: [PATCH] Add .desktop file and generate placeholder icon. --- CMakeLists.txt | 1 + dist/CMakeLists.txt | 13 +++++++++++++ dist/README.md | 15 +++++++++++++++ dist/openage.desktop | 10 ++++++++++ 4 files changed, 39 insertions(+) create mode 100644 dist/CMakeLists.txt create mode 100644 dist/README.md create mode 100644 dist/openage.desktop diff --git a/CMakeLists.txt b/CMakeLists.txt index f8ab3afa7c..876008a279 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -52,6 +52,7 @@ configure_file(py/openage/config.py.in "${CMAKE_SOURCE_DIR}/py/openage/config.py doxygen_configure(cpp/ py/) add_subdirectory(cpp/) +add_subdirectory(dist/) add_subdirectory(py/) # process the included python sources, generate setup.py diff --git a/dist/CMakeLists.txt b/dist/CMakeLists.txt new file mode 100644 index 0000000000..7cab3b2d3c --- /dev/null +++ b/dist/CMakeLists.txt @@ -0,0 +1,13 @@ +message("Cropping gaben.png to create placeholder desktop icon...") + +file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/dist") +execute_process(COMMAND python3 -c " +import PIL.Image; +cropped=PIL.Image.open('${GLOBAL_ASSET_DIR}/gaben.png').crop((92,137,604,649)); +cropped.save('${CMAKE_BINARY_DIR}/dist/openage.png')") + +install(FILES "${GLOBAL_ASSET_DIR}/dist/openage.desktop" + DESTINATION "${CMAKE_INSTALL_PREFIX}/usr/share/applications") + +install(FILES "${CMAKE_BINARY_DIR}/dist/openage.png" + DESTINATION "${CMAKE_INSTALL_PREFIX}/usr/share/pixmaps") diff --git a/dist/README.md b/dist/README.md new file mode 100644 index 0000000000..988035fec7 --- /dev/null +++ b/dist/README.md @@ -0,0 +1,15 @@ +# Distribution + +Contains files useful for package distribution. + +## Desktop file + +The [openage.desktop](openage.desktop) file can be found in this directory and will be installed at +`/usr/share/applications/openage.desktop`. + +## Desktop icon + +In lieu of a logo/icon for openage a cropped version of [assets/gaben.png](/assets/gaben.png) is +created instead. See [assets/CMakeLists.txt](/assets/CMakeLists.txt) for details on how the icon +is generated. The final icon will be installed at `/usr/share/pixmaps/openage.png` via +`make install`. diff --git a/dist/openage.desktop b/dist/openage.desktop new file mode 100644 index 0000000000..0ee06f2048 --- /dev/null +++ b/dist/openage.desktop @@ -0,0 +1,10 @@ +#!/usr/bin/env xdg-open +[Desktop Entry] +Name=openage +Comment=Free engine clone of Age of Empires II +Exec=openage --data=assets %u +Path=.openage +Terminal=true +Type=Application +Icon=openage +Categories=Game;StrategyGame;