mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
Add native installer packaging to CI for all platforms
Linux: DEB with /opt/wowee prefix and /usr/local/bin/wowee wrapper script Windows x86-64: NSIS installer with DLL bundling and Start Menu shortcut Windows ARM64: ZIP archive with bundled DLLs macOS ARM64: .app bundle via dylibbundler + DMG via hdiutil Assets are bundled into all packages (Original Music excluded). StormLib is installed where available so asset_extract is included in packages.
This commit is contained in:
parent
456aa90eda
commit
5b3b6df544
2 changed files with 179 additions and 14 deletions
|
|
@ -389,6 +389,29 @@ install(TARGETS wowee
|
|||
ARCHIVE DESTINATION lib
|
||||
)
|
||||
|
||||
# Install tools alongside main binary
|
||||
foreach(_tool dbc_to_csv blp_convert auth_probe auth_login_probe)
|
||||
if(TARGET ${_tool})
|
||||
install(TARGETS ${_tool} RUNTIME DESTINATION bin)
|
||||
endif()
|
||||
endforeach()
|
||||
if(STORMLIB_LIBRARY AND STORMLIB_INCLUDE_DIR)
|
||||
install(TARGETS asset_extract RUNTIME DESTINATION bin)
|
||||
endif()
|
||||
|
||||
# Install built-in assets (exclude proprietary music)
|
||||
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/assets
|
||||
DESTINATION bin
|
||||
PATTERN "Original Music" EXCLUDE)
|
||||
|
||||
# On Windows, install any DLLs that were bundled into the build output dir
|
||||
# (populated by the CI workflow's DLL-bundling step before cpack runs)
|
||||
if(WIN32)
|
||||
install(DIRECTORY "${CMAKE_BINARY_DIR}/bin/"
|
||||
DESTINATION bin
|
||||
FILES_MATCHING PATTERN "*.dll")
|
||||
endif()
|
||||
|
||||
# Linux desktop integration (launcher + icon)
|
||||
if(UNIX AND NOT APPLE)
|
||||
set(WOWEE_LINUX_ICON_PATH "${CMAKE_INSTALL_FULL_DATAROOTDIR}/icons/hicolor/256x256/apps/wowee.png")
|
||||
|
|
@ -512,3 +535,66 @@ message(STATUS " SDL2: ${SDL2_VERSION}")
|
|||
message(STATUS " OpenSSL: ${OPENSSL_VERSION}")
|
||||
message(STATUS " ImGui: ${IMGUI_DIR}")
|
||||
message(STATUS "")
|
||||
|
||||
# ---- CPack packaging ----
|
||||
set(CPACK_PACKAGE_NAME "wowee")
|
||||
set(CPACK_PACKAGE_VERSION "${PROJECT_VERSION}")
|
||||
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "World of Warcraft client emulator")
|
||||
set(CPACK_PACKAGE_VENDOR "Wowee")
|
||||
set(CPACK_PACKAGE_INSTALL_DIRECTORY "Wowee")
|
||||
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
|
||||
|
||||
if(WIN32)
|
||||
set(CPACK_GENERATOR "NSIS")
|
||||
set(CPACK_NSIS_DISPLAY_NAME "Wowee")
|
||||
set(CPACK_NSIS_PACKAGE_NAME "Wowee")
|
||||
set(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES64")
|
||||
set(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL ON)
|
||||
# Run wowee from bin/ so that ./assets/ resolves correctly.
|
||||
# SetOutPath sets the shortcut's working directory in NSIS.
|
||||
set(CPACK_NSIS_CREATE_ICONS_EXTRA
|
||||
"SetOutPath '$INSTDIR\\bin'\nCreateShortCut '$SMPROGRAMS\\$STARTMENU_FOLDER\\Wowee.lnk' '$INSTDIR\\bin\\wowee.exe'")
|
||||
set(CPACK_NSIS_DELETE_ICONS_EXTRA
|
||||
"Delete '$SMPROGRAMS\\$STARTMENU_FOLDER\\Wowee.lnk'")
|
||||
elseif(APPLE)
|
||||
set(CPACK_GENERATOR "DragNDrop")
|
||||
else()
|
||||
# Linux — generate postinst/prerm wrapper scripts
|
||||
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/packaging)
|
||||
# postinst: write a wrapper script at /usr/local/bin/wowee that cd's to
|
||||
# the install dir so ./assets/ resolves correctly.
|
||||
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/packaging/postinst
|
||||
[[#!/bin/sh
|
||||
cat > /usr/local/bin/wowee << 'WOWEE_WRAPPER'
|
||||
#!/bin/sh
|
||||
cd /opt/wowee/bin
|
||||
exec ./wowee "$@"
|
||||
WOWEE_WRAPPER
|
||||
chmod +x /usr/local/bin/wowee
|
||||
]])
|
||||
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/packaging/prerm
|
||||
"#!/bin/sh\nrm -f /usr/local/bin/wowee\n")
|
||||
file(CHMOD
|
||||
${CMAKE_CURRENT_BINARY_DIR}/packaging/postinst
|
||||
${CMAKE_CURRENT_BINARY_DIR}/packaging/prerm
|
||||
PERMISSIONS
|
||||
OWNER_EXECUTE OWNER_WRITE OWNER_READ
|
||||
GROUP_EXECUTE GROUP_READ
|
||||
WORLD_EXECUTE WORLD_READ)
|
||||
|
||||
set(CPACK_GENERATOR "DEB")
|
||||
set(CPACK_PACKAGING_INSTALL_PREFIX "/opt/wowee")
|
||||
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Wowee")
|
||||
set(CPACK_DEBIAN_PACKAGE_SECTION "games")
|
||||
set(CPACK_DEBIAN_PACKAGE_DEPENDS
|
||||
"libsdl2-2.0-0, libglew2.2 | libglew2.1, libssl3, zlib1g")
|
||||
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/packaging/postinst;${CMAKE_CURRENT_BINARY_DIR}/packaging/prerm")
|
||||
if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|AMD64")
|
||||
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64")
|
||||
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|ARM64")
|
||||
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "arm64")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
include(CPack)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue