Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,13 @@ if (ENABLE_ASAN)
message(STATUS "dusklight: Enabled AddressSanitizer")
endif ()

if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(DUSK_APP_ID_DEFAULT "dev.twilitrealm.Dusklight")
else ()
set(DUSK_APP_ID_DEFAULT "dev.twilitrealm.dusk")
endif ()
set(DUSK_APP_ID "${DUSK_APP_ID_DEFAULT}" CACHE STRING "Override platform ID")

if (CMAKE_SYSTEM_NAME STREQUAL Linux)
set(DAWN_USE_WAYLAND ON CACHE BOOL "Enable support for Wayland surface" FORCE)
endif ()
Expand Down Expand Up @@ -344,7 +351,7 @@ elseif (CMAKE_SYSTEM_NAME STREQUAL Darwin)
set(PLATFORM_NAME macos)
endif ()
else ()
string(TOLOWER CMAKE_SYSTEM_NAME PLATFORM_NAME)
string(TOLOWER ${CMAKE_SYSTEM_NAME} PLATFORM_NAME)
endif ()

configure_file(${CMAKE_SOURCE_DIR}/version.h.in ${CMAKE_BINARY_DIR}/version.h)
Expand All @@ -354,7 +361,7 @@ include(files.cmake)
# TODO: version handling for res includes

set(DUSK_BUNDLE_NAME Dusklight)
set(DUSK_BUNDLE_IDENTIFIER dev.twilitrealm.dusk)
set(DUSK_BUNDLE_IDENTIFIER "${DUSK_APP_ID}")
set(DUSK_COMPANY_NAME "Twilit Realm")
set(DUSK_FILE_DESCRIPTION "Dusklight")
set(DUSK_PRODUCT_NAME "Dusklight")
Expand Down Expand Up @@ -452,7 +459,8 @@ endif ()

if (DUSK_PACKAGE_INSTALL)
include(GNUInstallDirs)
list(APPEND GAME_COMPILE_DEFS DUSK_ASSET_DIR="${CMAKE_INSTALL_FULL_DATADIR}/dusklight/")
include(cmake/LinuxPackageInstall.cmake)
list(APPEND GAME_COMPILE_DEFS DUSK_ASSET_DIR="${CMAKE_INSTALL_FULL_DATADIR}/${DUSK_APP_ID}/")
endif ()

if (DUSK_GFX_DEBUG_GROUPS)
Expand Down Expand Up @@ -682,14 +690,15 @@ if (TARGET crashpad_handler)
list(APPEND EXTRA_TARGETS crashpad_handler)
endif ()
if (DUSK_PACKAGE_INSTALL)
set_target_properties(dusklight PROPERTIES OUTPUT_NAME "${DUSK_APP_ID}")
install(TARGETS ${BINARY_TARGETS} ${EXTRA_TARGETS} DESTINATION ${CMAKE_INSTALL_BINDIR})
else()
install(TARGETS ${BINARY_TARGETS} ${EXTRA_TARGETS} DESTINATION ${CMAKE_INSTALL_PREFIX})
endif()
aurora_install_runtime_dlls(dusklight ${CMAKE_INSTALL_PREFIX})
if (NOT APPLE)
if (DUSK_PACKAGE_INSTALL)
install(DIRECTORY ${CMAKE_SOURCE_DIR}/res DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/dusklight)
install(DIRECTORY ${CMAKE_SOURCE_DIR}/res DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${DUSK_APP_ID})
else()
install(DIRECTORY ${CMAKE_SOURCE_DIR}/res DESTINATION ${CMAKE_INSTALL_PREFIX})
endif()
Expand Down
7 changes: 5 additions & 2 deletions ci/build-appimage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,11 @@ for install_path in build/install/*; do
[[ "$(basename "$install_path")" == *.* ]] && continue
cp -r "$install_path" build/appdir/usr/bin
done
cp -r platforms/freedesktop/{16x16,32x32,48x48,64x64,128x128,256x256,512x512,1024x1024} build/appdir/usr/share/icons/hicolor
cp platforms/freedesktop/dev.twilitrealm.dusk.desktop build/appdir/usr/share/applications
cp -r platforms/freedesktop/{16x16,32x32,48x48,64x64,128x128,256x256,512x512} build/appdir/usr/share/icons/hicolor
find build/appdir/usr/share/icons/hicolor -name 'dusklight.png' -print -exec bash -c 'mv $0 ${0/dusklight.png/dev.twilitrealm.Dusklight.png}' {} \;
cp platforms/freedesktop/dusklight.desktop.in build/appdir/usr/share/applications/dev.twilitrealm.Dusklight.desktop
sed -i "s|@DUSK_APP_ID@|dev.twilitrealm.Dusklight|g" build/appdir/usr/share/applications/dev.twilitrealm.Dusklight.desktop
sed -i 's|Exec=.*|Exec=dusklight|' build/appdir/usr/share/applications/dev.twilitrealm.Dusklight.desktop

cd build/install
VERSION="$DUSK_VERSION" NO_STRIP=1 "$linuxdeploy" \
Expand Down
15 changes: 15 additions & 0 deletions cmake/LinuxPackageInstall.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
set(ASSET_SOURCE_DIR "${CMAKE_SOURCE_DIR}/platforms/freedesktop")

foreach(RES 16 32 48 64 128 256 512)
install (FILES ${ASSET_SOURCE_DIR}/${RES}x${RES}/apps/dusklight.png
DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/${RES}x${RES}/apps
RENAME "${DUSK_APP_ID}.png")
endforeach()

configure_file(${ASSET_SOURCE_DIR}/dusklight.desktop.in ${CMAKE_BINARY_DIR}/${DUSK_APP_ID}.desktop)
install (FILES ${CMAKE_BINARY_DIR}/${DUSK_APP_ID}.desktop
DESTINATION ${CMAKE_INSTALL_DATADIR}/applications/)

configure_file(${ASSET_SOURCE_DIR}/dusklight.metainfo.xml.in ${CMAKE_BINARY_DIR}/${DUSK_APP_ID}.metainfo.xml)
install (FILES ${CMAKE_BINARY_DIR}/${DUSK_APP_ID}.metainfo.xml
DESTINATION ${CMAKE_INSTALL_DATADIR}/metainfo/)
12 changes: 7 additions & 5 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -260,11 +260,13 @@
runHook preInstall
install -Dm755 dusklight "$out/bin/dusklight"
cp -r "$src/res" "$out/bin/res"
install -Dm644 "$src/platforms/freedesktop/dev.twilitrealm.dusk.desktop" \
"$out/share/applications/dev.twilitrealm.dusk.desktop"
for size in 16 32 48 64 128 256 512 1024; do
install -Dm644 "$src/platforms/freedesktop/''${size}x''${size}/apps/dev.twilitrealm.dusk.png" \
"$out/share/icons/hicolor/''${size}x''${size}/apps/dev.twilitrealm.dusk.png"
install -Dm644 "$src/platforms/freedesktop/dusklight.desktop.in" \
"$out/share/applications/dev.twilitrealm.Dusklight.desktop"
sed -i "s|@DUSK_APP_ID@|dev.twilitrealm.Dusklight|g" "$out/share/applications/dev.twilitrealm.Dusklight.desktop"
sed -i 's|Exec=.*|Exec=dusklight|' "$out/share/applications/dev.twilitrealm.Dusklight.desktop"
for size in 16 32 48 64 128 256 512; do
install -Dm644 "$src/platforms/freedesktop/''${size}x''${size}/apps/dusklight.png" \
"$out/share/icons/hicolor/''${size}x''${size}/apps/dev.twilitrealm.Dusklight.png"
done
runHook postInstall
'';
Expand Down
5 changes: 5 additions & 0 deletions flatpak/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Flatpak-builder creates a bunch of directories that we don't want to commit. To make this easier to manage we ignore everything except what we explicitly want to track
*

!.gitignore
!dev.twilitrealm.Dusklight.yml
Loading
Loading