Commit 41fefd1d authored by Friedrich W. H. Kossebau's avatar Friedrich W. H. Kossebau
Browse files

Install theme SVGs as SVGZs

parent 52c332f1
......@@ -12,7 +12,7 @@ set (QT_MIN_VERSION "5.15.0")
set (KF5_MIN_VERSION "5.90.0")
find_package(ECM ${KF5_MIN_VERSION} REQUIRED CONFIG)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH})
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${ECM_MODULE_PATH})
include(KDEInstallDirs)
include(KDECMakeSettings)
......@@ -23,6 +23,7 @@ include(ECMAddAppIcon)
include(ECMQtDeclareLoggingCategory)
include(ECMSetupVersion)
include(FeatureSummary)
include(InternalMacros)
find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS Gui Widgets)
find_package(Qt${QT_MAJOR_VERSION}QuickWidgets ${REQUIRED_QT_VERSION} CONFIG)
......
# SPDX-FileCopyrightText: 2021-2022 Friedrich W. H. Kossebau <kossebau@kde.org>
#
# SPDX-License-Identifier: BSD-3-Clause
if(WIN32)
find_package(7z)
set_package_properties(7z PROPERTIES
TYPE REQUIRED
PURPOSE "For installing SVG files as SVGZ"
)
else()
find_package(gzip)
set_package_properties(gzip PROPERTIES
TYPE REQUIRED
PURPOSE "For installing SVG files as SVGZ"
)
endif()
function(generate_svgz svg_file svgz_file target_prefix)
if (NOT IS_ABSOLUTE ${svg_file})
set(svg_file "${CMAKE_CURRENT_SOURCE_DIR}/${svg_file}")
endif()
if (NOT EXISTS ${svg_file})
message(FATAL_ERROR "No such file found: ${svg_file}")
endif()
get_filename_component(_fileName "${svg_file}" NAME)
get_filename_component(_svgzdir "${svgz_file}" DIRECTORY)
if(WIN32)
add_custom_command(
OUTPUT ${svgz_file}
COMMAND ${CMAKE_COMMAND} -E make_directory ${_svgzdir} # ensure output dir exists
COMMAND 7z::7z
ARGS
a
-tgzip
${svgz_file} ${svg_file}
DEPENDS ${svg_file}
COMMENT "Gzipping ${_fileName}"
)
else()
add_custom_command(
OUTPUT ${svgz_file}
COMMAND ${CMAKE_COMMAND} -E make_directory ${_svgzdir} # ensure output dir exists
COMMAND ${gzip_EXECUTABLE}
ARGS
-9n
-c
${svg_file} > ${svgz_file}
DEPENDS ${svg_file}
COMMENT "Gzipping ${_fileName}"
)
endif()
add_custom_target("${target_prefix}${_fileName}z" ALL DEPENDS ${svgz_file})
endfunction()
# SPDX-FileCopyrightText: 2022 Friedrich W. H. Kossebau <kossebau@kde.org>
#
# SPDX-License-Identifier: BSD-3-Clause
set(KGOLDRUNNER_INSTALL_THEMESDIR "${KDE_INSTALL_DATADIR}/kgoldrunner/themes")
function(install_theme id)
cmake_parse_arguments(ARG "" "" "FILES" ${ARGN})
install( FILES ${id}.desktop DESTINATION ${KGOLDRUNNER_INSTALL_THEMESDIR} )
foreach(_file ${ARG_FILES})
get_filename_component(_dir "${_file}" DIRECTORY)
get_filename_component(_extension "${_file}" EXT)
########### install files ###############
if (_extension STREQUAL ".svg")
set(svgz "${CMAKE_CURRENT_BINARY_DIR}/${_file}z")
generate_svgz("${_file}" "${svgz}" "theme-${_dir}-")
set(_file "${svgz}")
endif()
install( FILES ${_file} DESTINATION ${KGOLDRUNNER_INSTALL_THEMESDIR}/${_dir} )
endforeach()
endfunction()
install( FILES README
black-on-white.desktop
egypt.desktop
default.desktop
kgr_geek.desktop
nostalgia.desktop
nostalgia-blues.desktop
DESTINATION ${KDE_INSTALL_DATADIR}/kgoldrunner/themes )
install( FILES
default/set.svg default/actors.svg
install_theme(default
FILES
default/set.svg
default/actors.svg
default/default.png
default/gold.ogg default/falling.ogg default/step.wav default/climb.wav
default/dig.ogg default/ladder.ogg default/completed.ogg
default/death.ogg default/gameover.ogg default/victory.ogg
DESTINATION
${KDE_INSTALL_DATADIR}/kgoldrunner/themes/default )
install( FILES accessible/black-on-white-set.svg
accessible/black-on-white-actors.svg
accessible/black-on-white.png
DESTINATION ${KDE_INSTALL_DATADIR}/kgoldrunner/themes/accessible )
install( FILES kgr_geek/set.svgz kgr_geek/actors.svgz
kgr_geek/kgr_geek.png
DESTINATION ${KDE_INSTALL_DATADIR}/kgoldrunner/themes/kgr_geek )
install( FILES nostalgia/blue-set.svg nostalgia/blue-actors.svg
nostalgia/set.svg nostalgia/actors.svg
nostalgia/nostalgia.png
nostalgia/nostalgia-blues.png
DESTINATION ${KDE_INSTALL_DATADIR}/kgoldrunner/themes/nostalgia )
install( FILES egypt/egypt_kgr.svgz egypt/actors.svgz
egypt/egypt.png
DESTINATION ${KDE_INSTALL_DATADIR}/kgoldrunner/themes/egypt )
install( FILES kgoldrunner.knsrc DESTINATION ${KDE_INSTALL_DATADIR}/knsrcfiles )
default/climb.wav
default/completed.ogg
default/death.ogg
default/dig.ogg
default/falling.ogg
default/gameover.ogg
default/gold.ogg
default/ladder.ogg
default/step.wav
default/victory.ogg
)
install_theme(black-on-white
FILES
accessible/black-on-white-set.svg
accessible/black-on-white-actors.svg
accessible/black-on-white.png
)
install_theme(egypt
FILES
egypt/egypt_kgr.svgz
egypt/actors.svgz
egypt/egypt.png
)
install_theme(kgr_geek
FILES
kgr_geek/set.svgz
kgr_geek/actors.svgz
kgr_geek/kgr_geek.png
)
install_theme(nostalgia
FILES
nostalgia/set.svg
nostalgia/actors.svg
nostalgia/nostalgia.png
)
install_theme(nostalgia-blues
FILES
nostalgia/blue-set.svg
nostalgia/blue-actors.svg
nostalgia/nostalgia-blues.png
)
install( FILES README DESTINATION ${KGOLDRUNNER_INSTALL_THEMESDIR})
install( FILES kgoldrunner.knsrc DESTINATION ${KDE_INSTALL_DATADIR}/knsrcfiles )
......@@ -101,8 +101,8 @@ Description[x-test]=xxA monochrome, black on white theme for KGoldrunnerxx
Description[zh_CN]=KGoldrunner 黑白单色主题
Description[zh_TW]=KGoldrunner 黑白螢幕主題
Author=Luciano Montanaro
Set=accessible/black-on-white-set.svg
Actors=accessible/black-on-white-actors.svg
Set=accessible/black-on-white-set.svgz
Actors=accessible/black-on-white-actors.svgz
DrawCanvasBorder=0
BorderColor=#FFFFFF
TextColor=#000000
......
......@@ -104,8 +104,8 @@ Description[x-test]=xxA light and clean theme for KDE4xx
Description[zh_CN]=KDE4 的轻爽主题
Description[zh_TW]=簡單又乾淨的 KDE 主題
Author=Mauricio Piacentini
Set=default/set.svg
Actors=default/actors.svg
Set=default/set.svgz
Actors=default/actors.svgz
DrawCanvasBorder=1
BorderColor=#2C89A0
TextColor=#FFFFFF
......
......@@ -97,8 +97,8 @@ Description[x-test]=xxA theme for KGoldrunner that brings back that 8-bit look..
Description[zh_CN]=KGoldrunner 的主题, 带来经典的8-bit的外观... 现在是蓝色的!
Description[zh_TW]=KGoldrunner 的佈景主題,就像是八位元時代的畫面。
Author=Luciano Montanaro
Set=nostalgia/blue-set.svg
Actors=nostalgia/blue-actors.svg
Set=nostalgia/blue-set.svgz
Actors=nostalgia/blue-actors.svgz
DrawCanvasBorder=0
BorderColor=#000019
TextColor=#FFFFFF
......
......@@ -101,8 +101,8 @@ Description[x-test]=xxA scalable theme for KGoldrunner that brings back that 8-b
Description[zh_CN]=将您引回 8-bit 感官时代的可缩放 KGoldrunner 主题...
Description[zh_TW]=KGoldrunner 可調整的主題,就像是八位元時代的畫面。
Author=Luciano Montanaro
Set=nostalgia/set.svg
Actors=nostalgia/actors.svg
Set=nostalgia/set.svgz
Actors=nostalgia/actors.svgz
DrawCanvasBorder=1
BorderColor=#000000
TextColor=#FFFFFF
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment