Keep desktoptheme SVG files uncompressed in repo, install svgz
Summary:
The SVG format being based on plain text, storing the SVG in the repository
not as .svgz, but .svg, helps both VCS tools (patching, showing diffs) as
well as allows some developers to edit the SVG directly in any text editor,
not only those which support automatic conversion from/to gzip format.
While most artists will continue (and which shall be okay) to use GUI
editors like inkscape, which might rewrite the complete structure on saving,
using uncompressed format in the repo still allows the occasional direct
edit of the text, .e.g. to change a colour, which then is also easily seen
in the commit diff.
To still keep the svgz format when deployed, a build step is introduced,
which uses gzip to create svgz files in the build dir. This conversion can
be controlled using the option GZIP_DESKTOPTHEME_SVG (default: ON).
Test Plan: Themes are still working (with & without cache removed).
Reviewers: #plasma, #vdg, ngraham
Reviewed By: #vdg, ngraham
Subscribers: bruns, GB_2, ndavis, ngraham, fvogt, kde-frameworks-devel
Tags: #frameworks
Differential Revision: https://phabricator.kde.org/D20166
2019-04-01 13:55:56 +02:00
|
|
|
|
|
|
|
option(GZIP_DESKTOPTHEME_SVG "Install Desktop Theme SVG files as .svgz." ON)
|
|
|
|
|
|
|
|
if (GZIP_DESKTOPTHEME_SVG)
|
2019-04-12 22:09:10 +02:00
|
|
|
if(WIN32)
|
|
|
|
find_package(7z)
|
|
|
|
set_package_properties(7z PROPERTIES
|
|
|
|
TYPE REQUIRED
|
|
|
|
)
|
|
|
|
else()
|
|
|
|
find_package(gzip)
|
|
|
|
set_package_properties(gzip PROPERTIES
|
|
|
|
TYPE REQUIRED
|
|
|
|
)
|
|
|
|
endif()
|
Keep desktoptheme SVG files uncompressed in repo, install svgz
Summary:
The SVG format being based on plain text, storing the SVG in the repository
not as .svgz, but .svg, helps both VCS tools (patching, showing diffs) as
well as allows some developers to edit the SVG directly in any text editor,
not only those which support automatic conversion from/to gzip format.
While most artists will continue (and which shall be okay) to use GUI
editors like inkscape, which might rewrite the complete structure on saving,
using uncompressed format in the repo still allows the occasional direct
edit of the text, .e.g. to change a colour, which then is also easily seen
in the commit diff.
To still keep the svgz format when deployed, a build step is introduced,
which uses gzip to create svgz files in the build dir. This conversion can
be controlled using the option GZIP_DESKTOPTHEME_SVG (default: ON).
Test Plan: Themes are still working (with & without cache removed).
Reviewers: #plasma, #vdg, ngraham
Reviewed By: #vdg, ngraham
Subscribers: bruns, GB_2, ndavis, ngraham, fvogt, kde-frameworks-devel
Tags: #frameworks
Differential Revision: https://phabricator.kde.org/D20166
2019-04-01 13:55:56 +02:00
|
|
|
endif()
|
|
|
|
|
|
|
|
# Helper function, private for now
|
|
|
|
# Once it has matured and proven, add to public macros
|
|
|
|
function(PLASMA_INSTALL_DESKTOPTHEME_SVGS theme_name)
|
|
|
|
set(options
|
|
|
|
)
|
|
|
|
set(oneValueArgs
|
|
|
|
SUBPATH
|
|
|
|
)
|
|
|
|
set(multiValueArgs
|
|
|
|
FILES
|
|
|
|
)
|
|
|
|
|
|
|
|
cmake_parse_arguments(PIDS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
|
|
|
|
|
|
|
if(NOT DEFINED PIDS_SUBPATH)
|
|
|
|
message(FATAL_ERROR "SUBPATH needs to be defined when calling plasma_install_desktoptheme_svgs.")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(NOT PIDS_FILES)
|
|
|
|
message(FATAL_ERROR "No files passed when calling plasma_install_desktoptheme_svgs.")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
set(_target_name "${theme_name}_desktoptheme_graphics_${PIDS_SUBPATH}")
|
|
|
|
string(REPLACE "/" "_" _target_name "${_target_name}")
|
|
|
|
|
|
|
|
set(desktoptheme_COMPONENTDIR "${theme_name}/${PIDS_SUBPATH}")
|
|
|
|
set(desktoptheme_INSTALLDIR ${PLASMA_DATA_INSTALL_DIR}/desktoptheme/${desktoptheme_COMPONENTDIR})
|
|
|
|
|
|
|
|
if (GZIP_DESKTOPTHEME_SVG)
|
|
|
|
set(desktoptheme_GZIPDIR "${theme_name}.gzipped/${PIDS_SUBPATH}")
|
|
|
|
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${desktoptheme_GZIPDIR}")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
set(_install_files)
|
|
|
|
|
|
|
|
foreach(_src_file ${PIDS_FILES})
|
|
|
|
if (NOT IS_ABSOLUTE ${_src_file})
|
|
|
|
set(_src_file "${CMAKE_CURRENT_SOURCE_DIR}/${_src_file}")
|
|
|
|
endif()
|
|
|
|
if (NOT EXISTS ${_src_file})
|
|
|
|
message(FATAL_ERROR "No such file found: ${_src_file}")
|
|
|
|
endif()
|
|
|
|
get_filename_component(_fileName "${_src_file}" NAME)
|
|
|
|
|
|
|
|
if (GZIP_DESKTOPTHEME_SVG)
|
|
|
|
set(_gzipped_file_displayname "${desktoptheme_COMPONENTDIR}/${_fileName}z")
|
|
|
|
set(_gzipped_file "${CMAKE_CURRENT_BINARY_DIR}/${desktoptheme_GZIPDIR}/${_fileName}z")
|
2019-04-12 22:09:10 +02:00
|
|
|
if(WIN32)
|
|
|
|
add_custom_command(
|
|
|
|
OUTPUT ${_gzipped_file}
|
|
|
|
COMMAND ${7z_EXECUTABLE}
|
|
|
|
ARGS
|
|
|
|
a
|
|
|
|
-tgzip
|
|
|
|
${_gzipped_file} ${_src_file}
|
|
|
|
DEPENDS ${_src_file}
|
|
|
|
COMMENT "Gzipping ${_gzipped_file_displayname}"
|
|
|
|
)
|
|
|
|
else()
|
|
|
|
add_custom_command(
|
|
|
|
OUTPUT ${_gzipped_file}
|
|
|
|
COMMAND ${gzip_EXECUTABLE}
|
|
|
|
ARGS
|
|
|
|
-9
|
|
|
|
-c
|
|
|
|
${_src_file} > ${_gzipped_file}
|
|
|
|
DEPENDS ${_src_file}
|
|
|
|
COMMENT "Gzipping ${_gzipped_file_displayname}"
|
|
|
|
)
|
|
|
|
endif()
|
Keep desktoptheme SVG files uncompressed in repo, install svgz
Summary:
The SVG format being based on plain text, storing the SVG in the repository
not as .svgz, but .svg, helps both VCS tools (patching, showing diffs) as
well as allows some developers to edit the SVG directly in any text editor,
not only those which support automatic conversion from/to gzip format.
While most artists will continue (and which shall be okay) to use GUI
editors like inkscape, which might rewrite the complete structure on saving,
using uncompressed format in the repo still allows the occasional direct
edit of the text, .e.g. to change a colour, which then is also easily seen
in the commit diff.
To still keep the svgz format when deployed, a build step is introduced,
which uses gzip to create svgz files in the build dir. This conversion can
be controlled using the option GZIP_DESKTOPTHEME_SVG (default: ON).
Test Plan: Themes are still working (with & without cache removed).
Reviewers: #plasma, #vdg, ngraham
Reviewed By: #vdg, ngraham
Subscribers: bruns, GB_2, ndavis, ngraham, fvogt, kde-frameworks-devel
Tags: #frameworks
Differential Revision: https://phabricator.kde.org/D20166
2019-04-01 13:55:56 +02:00
|
|
|
else()
|
|
|
|
set(_gzipped_file "${_src_file}")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
list(APPEND _install_files "${_gzipped_file}")
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
add_custom_target(${_target_name} ALL DEPENDS ${_install_files})
|
|
|
|
|
|
|
|
install(FILES ${_install_files} DESTINATION "${desktoptheme_INSTALLDIR}" )
|
|
|
|
endfunction()
|
|
|
|
|
|
|
|
|
2013-01-30 18:18:31 +01:00
|
|
|
add_subdirectory( oxygen )
|
|
|
|
add_subdirectory( air )
|
2014-03-25 11:48:07 +01:00
|
|
|
add_subdirectory( breeze )
|
2014-03-31 20:36:37 +02:00
|
|
|
add_subdirectory( breeze-dark )
|
2016-02-16 11:01:48 +01:00
|
|
|
add_subdirectory( breeze-light )
|