commit:     46e66ec519600c8fbd110a0bb93a02730ebf1757
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Wed Dec 15 10:36:52 2021 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Wed Dec 15 11:28:05 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=46e66ec5

kde-frameworks/breeze-icons: Upstream backport request

See also:
https://mail.kde.org/pipermail/distributions/2021-December/001100.html

Package-Manager: Portage-3.0.30, Repoman-3.0.3
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 .../breeze-icons/breeze-icons-5.89.0-r1.ebuild     |  61 ++++++++++
 .../breeze-icons-5.89.0-fix-icon_files-list.patch  |  41 +++++++
 ....0-improv-install-of-light-fallback-icons.patch | 125 +++++++++++++++++++++
 3 files changed, 227 insertions(+)

diff --git a/kde-frameworks/breeze-icons/breeze-icons-5.89.0-r1.ebuild 
b/kde-frameworks/breeze-icons/breeze-icons-5.89.0-r1.ebuild
new file mode 100644
index 000000000000..86ca0137188a
--- /dev/null
+++ b/kde-frameworks/breeze-icons/breeze-icons-5.89.0-r1.ebuild
@@ -0,0 +1,61 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PVCUT=$(ver_cut 1-2)
+PYTHON_COMPAT=( python3_{8..10} )
+inherit cmake kde.org python-any-r1 xdg-utils
+
+DESCRIPTION="Breeze SVG icon theme"
+
+LICENSE="LGPL-3"
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~riscv ~x86"
+IUSE="test"
+
+RESTRICT="!test? ( test )"
+
+DEPEND="test? ( dev-qt/qttest:5 )"
+BDEPEND="${PYTHON_DEPS}
+       $(python_gen_any_dep 'dev-python/lxml[${PYTHON_USEDEP}]')
+       dev-qt/qtcore:5
+       >=kde-frameworks/extra-cmake-modules-${PVCUT}:5
+       test? ( app-misc/fdupes )
+"
+
+PATCHES=(
+       "${FILESDIR}"/${P}-improv-install-of-light-fallback-icons.patch
+       "${FILESDIR}"/${P}-fix-icon_files-list.patch
+)
+
+python_check_deps() {
+       has_version "dev-python/lxml[${PYTHON_USEDEP}]"
+}
+
+src_prepare() {
+       cmake_src_prepare
+       use test || cmake_comment_add_subdirectory autotests
+}
+
+src_configure() {
+       local mycmakeargs=(
+               -DPython_EXECUTABLE="${PYTHON}"
+               -DBINARY_ICONS_RESOURCE=OFF
+       )
+       cmake_src_configure
+}
+
+src_install() {
+       cmake_src_install
+       # bug 770988
+       find "${ED}"/usr/share/icons/ -type d -empty -delete || die
+       find "${ED}"/usr/share/icons/ -xtype l -delete || die
+}
+
+pkg_postinst() {
+       xdg_icon_cache_update
+}
+
+pkg_postrm() {
+       xdg_icon_cache_update
+}

diff --git 
a/kde-frameworks/breeze-icons/files/breeze-icons-5.89.0-fix-icon_files-list.patch
 
b/kde-frameworks/breeze-icons/files/breeze-icons-5.89.0-fix-icon_files-list.patch
new file mode 100644
index 000000000000..b294711e3aac
--- /dev/null
+++ 
b/kde-frameworks/breeze-icons/files/breeze-icons-5.89.0-fix-icon_files-list.patch
@@ -0,0 +1,41 @@
+From 08bf45db9b883b4201ac3cbb666821472f17ad97 Mon Sep 17 00:00:00 2001
+From: Rodney Dawes <[email protected]>
+Date: Mon, 6 Dec 2021 15:13:22 -0500
+Subject: [PATCH] Include "*@*" in the icon_files list for installation
+
+As some of the directories of the theme are symlinks for scaled sizes
+we need to include them in the list of files to install as well.
+---
+ icons-dark/CMakeLists.txt | 2 +-
+ icons/CMakeLists.txt      | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/icons-dark/CMakeLists.txt b/icons-dark/CMakeLists.txt
+index ab582c13..6ceddc5c 100644
+--- a/icons-dark/CMakeLists.txt
++++ b/icons-dark/CMakeLists.txt
+@@ -22,7 +22,7 @@ if(NOT WIN32)
+ endif()
+ 
+ if(NOT SKIP_INSTALL_ICONS)
+-    file(GLOB_RECURSE icon_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} 
"${CMAKE_CURRENT_SOURCE_DIR}/*.svg")
++    file(GLOB_RECURSE icon_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} 
"${CMAKE_CURRENT_SOURCE_DIR}/*.svg" "${CMAKE_CURRENT_SOURCE_DIR}/*@*")
+     foreach (icon_file ${icon_files})
+         install(FILES ${icon_file} DESTINATION ${BREEZE_INSTALL_DIR} RENAME 
${icon_file})
+     endforeach()
+diff --git a/icons/CMakeLists.txt b/icons/CMakeLists.txt
+index 8f31db4a..b48852eb 100644
+--- a/icons/CMakeLists.txt
++++ b/icons/CMakeLists.txt
+@@ -23,7 +23,7 @@ endif()
+ 
+ if(NOT SKIP_INSTALL_ICONS)
+     # collect all our icons we need to install, will be used by dark icon set 
as fallback icons if not there, too
+-    file(GLOB_RECURSE icon_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} 
"${CMAKE_CURRENT_SOURCE_DIR}/*.svg")
++    file(GLOB_RECURSE icon_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} 
"${CMAKE_CURRENT_SOURCE_DIR}/*.svg" "${CMAKE_CURRENT_SOURCE_DIR}/*@*")
+     set(BREEZE_LIGHT_ICONS ${icon_files} PARENT_SCOPE)
+     foreach (icon_file ${icon_files})
+         install(FILES ${icon_file} DESTINATION ${BREEZE_INSTALL_DIR} RENAME 
${icon_file})
+-- 
+GitLab
+

diff --git 
a/kde-frameworks/breeze-icons/files/breeze-icons-5.89.0-improv-install-of-light-fallback-icons.patch
 
b/kde-frameworks/breeze-icons/files/breeze-icons-5.89.0-improv-install-of-light-fallback-icons.patch
new file mode 100644
index 000000000000..30bc17dd60be
--- /dev/null
+++ 
b/kde-frameworks/breeze-icons/files/breeze-icons-5.89.0-improv-install-of-light-fallback-icons.patch
@@ -0,0 +1,125 @@
+From 05f11af435edc57650d0221ed8a74ecfb997e576 Mon Sep 17 00:00:00 2001
+From: Christoph Cullmann <[email protected]>
+Date: Mon, 6 Dec 2021 18:12:46 +0000
+Subject: [PATCH] improve installation of light fallback icons
+
+icon install works now like this:
+
+* collect all light icons
+* install them just for light theme
+
+* install dark icons
+* install all missing ones from light theme we collected before
+---
+ icons-dark/CMakeLists.txt | 45 +++++++++++----------------------------
+ icons/CMakeLists.txt      | 18 ++++++----------
+ 2 files changed, 20 insertions(+), 43 deletions(-)
+
+diff --git a/icons-dark/CMakeLists.txt b/icons-dark/CMakeLists.txt
+index 40590a8b..ab582c13 100644
+--- a/icons-dark/CMakeLists.txt
++++ b/icons-dark/CMakeLists.txt
+@@ -4,10 +4,6 @@ endif()
+ 
+ ########### install files ###############
+ 
+-set(breeze_icon_dark_dirs
+-    actions animations applets apps devices emblems
+-    mimetypes places status)
+-
+ set(BREEZE_INSTALL_DIR ${KDE_INSTALL_FULL_ICONDIR}/breeze-dark)
+ 
+ if(WITH_ICON_GENERATION)
+@@ -26,36 +22,21 @@ if(NOT WIN32)
+ endif()
+ 
+ if(NOT SKIP_INSTALL_ICONS)
+-    # In order to ensure the dark icons are copied over the light icons which
+-    # are installed into the dark theme for BUG:444095, we need to execute the
+-    # copy command ourselves rather than using CMake's internal copy mechanism
+-    # used by the normal install command, so we use CODE mode of install to
+-    # execute_process and print an appropriate status message.
+-    # See https://bugs.kde.org/show_bug.cgi?id=445489
+-    set(COPY_CMD "cp -a")
+-    set(XCOPY_ARGS "")
+-    if(WIN32)
+-        set(COPY_CMD "xcopy")
+-        set(XCOPY_ARGS "/q /e /y")
+-    endif(WIN32)
+-    install(CODE "cmake_policy(VERSION 3.6)
+-        foreach(CAT_DIR ${breeze_icon_dark_dirs})
+-            execute_process(COMMAND ${COPY_CMD} \${CAT_DIR} 
\$ENV{DESTDIR}${BREEZE_INSTALL_DIR} ${XCOPY_ARGS} ERROR_QUIET WORKING_DIRECTORY 
${CMAKE_CURRENT_SOURCE_DIR})
+-        endforeach()
+-        file(GLOB_RECURSE ICON_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} 
LIST_DIRECTORIES false ${CMAKE_CURRENT_SOURCE_DIR}/*.svg)
+-        foreach(ICON_FILE IN LISTS ICON_FILES)
+-            message(STATUS \"Installing: 
\$ENV{DESTDIR}${BREEZE_INSTALL_DIR}/\${ICON_FILE}\")
+-        endforeach()")
++    file(GLOB_RECURSE icon_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} 
"${CMAKE_CURRENT_SOURCE_DIR}/*.svg")
++    foreach (icon_file ${icon_files})
++        install(FILES ${icon_file} DESTINATION ${BREEZE_INSTALL_DIR} RENAME 
${icon_file})
++    endforeach()
++
++    # install for all missing icons the light icons as fallback
++    foreach (icon_file ${BREEZE_LIGHT_ICONS})
++        if (NOT ${icon_file} IN_LIST icon_files)
++            install(FILES ${CMAKE_SOURCE_DIR}/icons/${icon_file} DESTINATION 
${BREEZE_INSTALL_DIR} RENAME ${icon_file})
++        endif()
++    endforeach()
++
+     install(FILES index.theme DESTINATION ${BREEZE_INSTALL_DIR})
+     if(WITH_ICON_GENERATION)
+-        install(CODE "cmake_policy(VERSION 3.6)
+-            foreach(GEN_DIR ${breeze_icon_dark_dirs})
+-                execute_process(COMMAND ${COPY_CMD} \${GEN_DIR} 
\$ENV{DESTDIR}${BREEZE_INSTALL_DIR} ${XCOPY_ARGS} ERROR_QUIET WORKING_DIRECTORY 
${CMAKE_CURRENT_BINARY_DIR}/generated)
+-            endforeach()
+-            file(GLOB_RECURSE ICON_FILES RELATIVE 
${CMAKE_CURRENT_BINARY_DIR}/generated LIST_DIRECTORIES false 
${CMAKE_CURRENT_BINARY_DIR}/generated/*.svg)
+-            foreach(ICON_FILE IN LISTS ICON_FILES)
+-                message(STATUS \"Installing: 
\$ENV{DESTDIR}${BREEZE_INSTALL_DIR}/\${ICON_FILE}\")
+-            endforeach()")
++        install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/generated/ DESTINATION 
${BREEZE_INSTALL_DIR})
+     endif()
+ endif()
+ 
+diff --git a/icons/CMakeLists.txt b/icons/CMakeLists.txt
+index 220b81e9..8f31db4a 100644
+--- a/icons/CMakeLists.txt
++++ b/icons/CMakeLists.txt
+@@ -4,10 +4,6 @@ endif()
+ 
+ ########### install files ###############
+ 
+-set(breeze_icon_dirs
+-    actions animations applets apps categories preferences devices emblems
+-    emotes mimetypes places status)
+-
+ set(BREEZE_INSTALL_DIR ${KDE_INSTALL_FULL_ICONDIR}/breeze)
+ 
+ if(WITH_ICON_GENERATION)
+@@ -26,17 +22,17 @@ if(NOT WIN32)
+ endif()
+ 
+ if(NOT SKIP_INSTALL_ICONS)
+-    install(DIRECTORY ${breeze_icon_dirs} DESTINATION ${BREEZE_INSTALL_DIR})
++    # collect all our icons we need to install, will be used by dark icon set 
as fallback icons if not there, too
++    file(GLOB_RECURSE icon_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} 
"${CMAKE_CURRENT_SOURCE_DIR}/*.svg")
++    set(BREEZE_LIGHT_ICONS ${icon_files} PARENT_SCOPE)
++    foreach (icon_file ${icon_files})
++        install(FILES ${icon_file} DESTINATION ${BREEZE_INSTALL_DIR} RENAME 
${icon_file})
++    endforeach()
++
+     install(FILES index.theme DESTINATION ${BREEZE_INSTALL_DIR})
+     if(WITH_ICON_GENERATION)
+         install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/generated/ DESTINATION 
${BREEZE_INSTALL_DIR})
+     endif()
+-
+-    # Install the colored icon sizes into breeze-dark theme as well, to ensure
+-    # that icons are available on alternate environments which do not support
+-    # colorized symbolic icons which are not named as "-symbolic"
+-    # NOTE: icons-dark will install /some/ files over top of these
+-    install(DIRECTORY ${breeze_icon_dirs} DESTINATION 
${BREEZE_INSTALL_DIR}-dark)
+ endif()
+ 
+ gtk_update_icon_cache(${BREEZE_INSTALL_DIR})
+-- 
+GitLab
+

Reply via email to