From: "Miroslav Šulc" <fordfrog@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: media-gfx/inkscape/files/, media-gfx/inkscape/
Date: Mon, 11 Nov 2019 09:41:36 +0000 (UTC) [thread overview]
Message-ID: <1573465287.9a5708b39fd019e2425efea931da5d3b3d2331da.fordfrog@gentoo> (raw)
commit: 9a5708b39fd019e2425efea931da5d3b3d2331da
Author: Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
AuthorDate: Mon Nov 11 09:41:00 2019 +0000
Commit: Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
CommitDate: Mon Nov 11 09:41:27 2019 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9a5708b3
media-gfx/inkscape-1.0_beta1: fix #699618
avoid reordering of CMAKE_CXX_FLAGS
Closes: https://bugs.gentoo.org/699618
Package-Manager: Portage-2.3.79, Repoman-2.3.18
Signed-off-by: Miroslav Šulc <fordfrog <AT> gentoo.org>
....0_beta1-avoid-reordering-cmake-cxx-flags.patch | 130 +++++++++++++++++++++
media-gfx/inkscape/inkscape-1.0_beta1.ebuild | 1 +
2 files changed, 131 insertions(+)
diff --git a/media-gfx/inkscape/files/inkscape-1.0_beta1-avoid-reordering-cmake-cxx-flags.patch b/media-gfx/inkscape/files/inkscape-1.0_beta1-avoid-reordering-cmake-cxx-flags.patch
new file mode 100644
index 00000000000..bd78bc58232
--- /dev/null
+++ b/media-gfx/inkscape/files/inkscape-1.0_beta1-avoid-reordering-cmake-cxx-flags.patch
@@ -0,0 +1,130 @@
+From 09319f688e10d47f9fc9be2b6feb831fb132660a Mon Sep 17 00:00:00 2001
+From: Patrick Storz <eduard.braun2@gmx.de>
+Date: Sat, 12 Oct 2019 15:56:14 +0200
+Subject: [PATCH] CMake: Avoid reordering CMAKE_CXX_FLAGS
+
+Order matters; the reordering caused the _FORTIFY_SOURCE flag to be
+always undefined (as we flipped a "-U" and "-D")
+
+Also skip removing duplicates to avoid similar pitfalls (we kept
+only the first occurrence but should've kept the last)
+It did not work properly anyway (we still had duplicates in the end)
+and was only required as we wrote the final CMAKE_CXX_FLAGS back to
+cache and consequently appended new flags with every run of CMAKE.
+---
+ CMakeLists.txt | 13 -----------
+ CMakeScripts/CanonicalizeFlagsVar.cmake | 11 ----------
+ CMakeScripts/DefineDependsandFlags.cmake | 28 ++++++++++++++----------
+ 3 files changed, 17 insertions(+), 35 deletions(-)
+ delete mode 100644 CMakeScripts/CanonicalizeFlagsVar.cmake
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index b30f013f38..aa14e13e01 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -207,19 +207,6 @@ if(GMOCK_PRESENT)
+ endif()
+ endif()
+
+-# -----------------------------------------------------------------------------
+-# Canonicalize the flags to speed up recompilation using ccache/etc.
+-# This should be the last thing we do:
+-# -----------------------------------------------------------------------------
+-include(CMakeScripts/CanonicalizeFlagsVar.cmake)
+-canonicalize_flags_var("${CMAKE_CXX_FLAGS}" _new_cxx)
+-set(CMAKE_CXX_FLAGS "${_new_cxx}" CACHE STRING "" FORCE)
+-canonicalize_flags_var("${CMAKE_CXX_FLAGS_DEBUG}" _new_cxx)
+-set(CMAKE_CXX_FLAGS_DEBUG "${_new_cxx}" CACHE STRING "" FORCE)
+-# message(FATAL_ERROR "CMAKE_CXX_FLAGS = <${CMAKE_CXX_FLAGS}>")
+-
+-
+-
+
+ # -----------------------------------------------------------------------------
+ # Clean Targets
+diff --git a/CMakeScripts/CanonicalizeFlagsVar.cmake b/CMakeScripts/CanonicalizeFlagsVar.cmake
+deleted file mode 100644
+index ddc5b7b5d3..0000000000
+--- a/CMakeScripts/CanonicalizeFlagsVar.cmake
++++ /dev/null
+@@ -1,11 +0,0 @@
+-# This file is copyright by Shlomi Fish, 2016.
+-#
+-# This file is licensed under the MIT/X11 license:
+-# https://opensource.org/licenses/mit-license.php
+-
+-macro (canonicalize_flags_var in_val out_var)
+- string(REPLACE " " ";" _c "${in_val}")
+- list(REMOVE_DUPLICATES _c)
+- list(SORT _c)
+- string(REPLACE ";" " " "${out_var}" "${_c}")
+-endmacro()
+diff --git a/CMakeScripts/DefineDependsandFlags.cmake b/CMakeScripts/DefineDependsandFlags.cmake
+index 996100b4d7..9dd7f7785f 100644
+--- a/CMakeScripts/DefineDependsandFlags.cmake
++++ b/CMakeScripts/DefineDependsandFlags.cmake
+@@ -2,6 +2,7 @@ set(INKSCAPE_LIBS "")
+ set(INKSCAPE_INCS "")
+ set(INKSCAPE_INCS_SYS "")
+ set(INKSCAPE_CXX_FLAGS "")
++set(INKSCAPE_CXX_FLAGS_DEBUG "")
+
+ list(APPEND INKSCAPE_INCS ${PROJECT_SOURCE_DIR}
+ ${PROJECT_SOURCE_DIR}/src
+@@ -98,7 +99,7 @@ list(APPEND INKSCAPE_INCS_SYS ${INKSCAPE_DEP_INCLUDE_DIRS})
+ add_definitions(${INKSCAPE_DEP_CFLAGS_OTHER})
+
+ find_package(DoubleConversion REQUIRED) # lib2geom dependency
+-
++
+ if(WITH_JEMALLOC)
+ find_package(JeMalloc)
+ if (JEMALLOC_FOUND)
+@@ -369,14 +370,6 @@ sanitize_ldflags_for_libs(SIGC++_LDFLAGS)
+ list(APPEND INKSCAPE_LIBS ${SIGC++_LDFLAGS})
+ list(APPEND INKSCAPE_CXX_FLAGS ${SIGC++_CFLAGS_OTHER})
+
+-list(REMOVE_DUPLICATES INKSCAPE_CXX_FLAGS)
+-foreach(flag ${INKSCAPE_CXX_FLAGS})
+- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}" CACHE STRING "" FORCE)
+-endforeach()
+-foreach(flag ${INKSCAPE_CXX_FLAGS_DEBUG})
+- set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${flag}" CACHE STRING "" FORCE)
+-endforeach()
+-
+ # Some linkers, like gold, don't find symbols recursively. So we have to link against X11 explicitly
+ find_package(X11)
+ if(X11_FOUND)
+@@ -386,14 +379,27 @@ endif(X11_FOUND)
+
+ # end Dependencies
+
++
++
++# Set include directories and CXX flags
++# (INKSCAPE_LIBS are set as target_link_libraries for inkscape_base in src/CMakeLists.txt)
++
++foreach(flag ${INKSCAPE_CXX_FLAGS})
++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}")
++endforeach()
++foreach(flag ${INKSCAPE_CXX_FLAGS_DEBUG})
++ set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${flag}")
++endforeach()
++
+ list(REMOVE_DUPLICATES INKSCAPE_LIBS)
+ list(REMOVE_DUPLICATES INKSCAPE_INCS_SYS)
+
+-# C/C++ Flags
+ include_directories(${INKSCAPE_INCS})
+ include_directories(SYSTEM ${INKSCAPE_INCS_SYS})
+
+-include(${CMAKE_CURRENT_LIST_DIR}/ConfigChecks.cmake)
++include(${CMAKE_CURRENT_LIST_DIR}/ConfigChecks.cmake) # TODO: Check if this needs to be "hidden" here
+
+ unset(INKSCAPE_INCS)
+ unset(INKSCAPE_INCS_SYS)
++unset(INKSCAPE_CXX_FLAGS)
++unset(INKSCAPE_CXX_FLAGS_DEBUG)
+--
+2.22.0
+
diff --git a/media-gfx/inkscape/inkscape-1.0_beta1.ebuild b/media-gfx/inkscape/inkscape-1.0_beta1.ebuild
index 759c5313e03..eb490840c8e 100644
--- a/media-gfx/inkscape/inkscape-1.0_beta1.ebuild
+++ b/media-gfx/inkscape/inkscape-1.0_beta1.ebuild
@@ -102,6 +102,7 @@ PATCHES=(
"${FILESDIR}"/${P}-detect-imagemagick.patch
"${FILESDIR}"/${P}-do-not-compress-man.patch
"${FILESDIR}"/${P}-poppler-0.82.patch
+ "${FILESDIR}"/${P}-avoid-reordering-cmake-cxx-flags.patch
)
pkg_pretend() {
next reply other threads:[~2019-11-11 9:41 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-11 9:41 Miroslav Šulc [this message]
-- strict thread matches above, loose matches on Subject: below --
2025-09-19 18:01 [gentoo-commits] repo/gentoo:master commit in: media-gfx/inkscape/files/, media-gfx/inkscape/ Andreas K. Hüttel
2025-06-09 15:37 Andreas Sturmlechner
2025-04-08 20:57 Andreas Sturmlechner
2025-01-13 17:12 Andreas Sturmlechner
2024-11-04 9:51 David Seifert
2024-05-31 16:08 David Seifert
2024-05-30 13:59 Andreas Sturmlechner
2023-05-01 7:32 Sam James
2022-09-03 1:42 Sam James
2022-09-02 4:38 Sam James
2022-05-26 1:12 Sam James
2022-03-18 21:30 Andreas K. Hüttel
2021-09-25 15:59 Andreas K. Hüttel
2021-09-25 15:59 Andreas K. Hüttel
2021-04-14 19:01 Mikle Kolyada
2020-08-26 6:49 Mikle Kolyada
2020-07-02 8:18 Mikle Kolyada
2020-05-08 7:42 Miroslav Šulc
2019-11-16 13:25 Andreas K. Hüttel
2019-11-09 8:57 Andreas Sturmlechner
2019-11-06 21:07 Miroslav Šulc
2019-07-24 20:57 Andreas Sturmlechner
2019-04-24 13:18 Lars Wendler
2018-09-15 21:46 Andreas Hüttel
2018-05-18 6:31 Lars Wendler
2018-05-07 12:59 Lars Wendler
2017-05-12 19:41 Andreas Hüttel
2016-06-29 20:29 Patrick McLean
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1573465287.9a5708b39fd019e2425efea931da5d3b3d2331da.fordfrog@gentoo \
--to=fordfrog@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox