Skip to content

Commit

Permalink
Merge from master
Browse files Browse the repository at this point in the history
  • Loading branch information
sirjuddington committed Apr 24, 2024
2 parents 590f069 + 7a65573 commit c8a3f8c
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 7 deletions.
1 change: 0 additions & 1 deletion .github/workflows/continuous_integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ jobs:
- {
name: "macOS",
os: macos-12,
extra_options: "-DBUILD_PK3=ON",
deps_cmdline: "brew install fluidsynth freeimage ftgl glm lua mpg123 sfml wxwidgets"
}
- {
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ endif()
# Build options
OPTION(NO_LUA "Disable Lua/Scripting features to reduce compile time" OFF)
OPTION(NO_FLUIDSYNTH "Disable FluidSynth MIDI playback" OFF)
OPTION(BUILD_PK3 "Build the SLADE pk3 file from dist/res" OFF)
OPTION(BUILD_PK3 "Build the SLADE pk3 file from dist/res" ON)

# c++17 is required to compile
set(CMAKE_CXX_STANDARD 17)
Expand Down
6 changes: 3 additions & 3 deletions cmake/unix.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,9 @@ if (BUILD_PK3)
)
endif()

install(FILES "${PROJECT_SOURCE_DIR}/dist/res/logo_icon.png"
DESTINATION share/icons/
RENAME net.mancubus.SLADE.png
install(FILES "${PROJECT_SOURCE_DIR}/dist/res/icons/general/logo.svg"
DESTINATION share/icons/hicolor/scalable/apps/
RENAME net.mancubus.SLADE.svg
)

install(FILES "${PROJECT_SOURCE_DIR}/net.mancubus.SLADE.desktop"
Expand Down
26 changes: 26 additions & 0 deletions dist/7z_command.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
set(7ZIP_COMMAND "${ZIPTOOL_7Z_EXECUTABLE}" a -tzip -mtc- -mcu+ -mx=9 -r "${PK3_DESTINATION}/slade.pk3" .)

if(EXISTS "${PK3_DESTINATION}/slade.pk3")
if(WIN32)
set(PLATFORM_GREP_COMMAND findstr "/c:SHA256 for data and names:")
else()
set(PLATFORM_GREP_COMMAND grep "SHA256 for data and names:")
endif()
execute_process(COMMAND "${ZIPTOOL_7Z_EXECUTABLE}" h -scrcsha256 .
COMMAND ${PLATFORM_GREP_COMMAND}
OUTPUT_VARIABLE FOLDER_SHA256
)
execute_process(COMMAND "${ZIPTOOL_7Z_EXECUTABLE}" t -scrcsha256 "${PK3_DESTINATION}/slade.pk3"
COMMAND ${PLATFORM_GREP_COMMAND}
OUTPUT_VARIABLE PK3_SHA256
)
if(FOLDER_SHA256 STREQUAL PK3_SHA256)
message(STATUS "slade.pk3 is already up to date.")
else()
file(REMOVE "${PK3_DESTINATION}/slade.pk3")
message(STATUS "Regenerating slade.pk3...")
execute_process(COMMAND ${7ZIP_COMMAND})
endif()
else()
execute_process(COMMAND ${7ZIP_COMMAND})
endif()
4 changes: 2 additions & 2 deletions dist/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ set(PK3_DESTINATION ${CMAKE_BINARY_DIR})
endif()

if(ZIPTOOL_7Z_EXECUTABLE)
set(ZIP_COMMAND "${ZIPTOOL_7Z_EXECUTABLE}" u -tzip -mtc- -mcu+ -mx=9 -r "${PK3_DESTINATION}/slade.pk3" .)
set(ZIP_COMMAND "${CMAKE_COMMAND}" "-DZIPTOOL_7Z_EXECUTABLE=${ZIPTOOL_7Z_EXECUTABLE}" "-DPK3_DESTINATION=${PK3_DESTINATION}" -P "${CMAKE_CURRENT_SOURCE_DIR}/7z_command.cmake")
elseif(ZIPTOOL_ZIP_EXECUTABLE)
if(NOT APPLE)
set(ZIP_COMMAND_CHARSET "-UN=UTF8")
endif()
set(ZIP_COMMAND "${ZIPTOOL_ZIP_EXECUTABLE}" -X ${ZIP_COMMAND_CHARSET} -9 -r "${PK3_DESTINATION}/slade.pk3" .)
set(ZIP_COMMAND "${ZIPTOOL_ZIP_EXECUTABLE}" -X ${ZIP_COMMAND_CHARSET} -9 -FS -r "${PK3_DESTINATION}/slade.pk3" .)
else()
message(STATUS "no zip executable, slade.pk3 won't build")
endif()
Expand Down
6 changes: 6 additions & 0 deletions dist/res/config/entry_types/text.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ animdefs : text
text_language = "z_animdefs";
}
complvl : text
{
name = "Compatibility level";
match_name = "complvl";
}
cvarinfo : text
{
name = "Console var defs";
Expand Down

0 comments on commit c8a3f8c

Please sign in to comment.