Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-gfx/inkscape/files/, media-gfx/inkscape/
Date: Thu, 26 May 2022 01:12:59
Message-Id: 1653527445.e6873fa9fe5ae8d9e3057f4d4d1204ff2e40122f.sam@gentoo
1 commit: e6873fa9fe5ae8d9e3057f4d4d1204ff2e40122f
2 Author: Haelwenn (lanodan) Monnier <contact <AT> hacktivis <DOT> me>
3 AuthorDate: Mon Mar 29 15:49:06 2021 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Thu May 26 01:10:45 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e6873fa9
7
8 media-gfx/inkscape: Fix automagic dependency on libX11
9
10 Related: https://gitlab.com/inkscape/inkscape/-/merge_requests/3208
11 Closes: https://bugs.gentoo.org/768663
12 Signed-off-by: Haelwenn (lanodan) Monnier <contact <AT> hacktivis.me>
13 Closes: https://github.com/gentoo/gentoo/pull/20181
14 Signed-off-by: Sam James <sam <AT> gentoo.org>
15
16 .../files/inkscape-1.0.2-automagic-libX11.patch | 181 +++++++++++++++++++++
17 ...kscape-9999.ebuild => inkscape-1.1.2-r2.ebuild} | 14 +-
18 media-gfx/inkscape/inkscape-9999.ebuild | 7 +-
19 3 files changed, 196 insertions(+), 6 deletions(-)
20
21 diff --git a/media-gfx/inkscape/files/inkscape-1.0.2-automagic-libX11.patch b/media-gfx/inkscape/files/inkscape-1.0.2-automagic-libX11.patch
22 new file mode 100644
23 index 000000000000..b8f93642088d
24 --- /dev/null
25 +++ b/media-gfx/inkscape/files/inkscape-1.0.2-automagic-libX11.patch
26 @@ -0,0 +1,181 @@
27 +From 6d0ace0518f0da18c7e81be1edecd50d997230b1 Mon Sep 17 00:00:00 2001
28 +From: "Haelwenn (lanodan) Monnier" <contact@×××××××××.me>
29 +Date: Tue, 11 May 2021 10:43:27 +0200
30 +Subject: [PATCH] CMake: Fix automagic dependency on X11
31 +
32 +Related: https://bugs.gentoo.org/768663
33 +Related: https://github.com/gentoo/gentoo/pull/20181
34 +---
35 + CMakeLists.txt | 3 +++
36 + CMakeScripts/DefineDependsandFlags.cmake | 13 +++++++----
37 + src/ege-color-prof-tracker.cpp | 28 ++++++++++++------------
38 + 3 files changed, 26 insertions(+), 18 deletions(-)
39 +
40 +diff --git a/CMakeLists.txt b/CMakeLists.txt
41 +index c5cb3f7fbd..2a04d86fbf 100644
42 +--- a/CMakeLists.txt
43 ++++ b/CMakeLists.txt
44 +@@ -36,6 +36,7 @@ project(inkscape)
45 + set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME inkscape) # needs to be before any install() commands
46 +
47 + include(CMakeScripts/ConfigPaths.cmake)
48 ++include(CMakeDependentOption)
49 +
50 + set(PROJECT_NAME inkscape)
51 +
52 +@@ -127,6 +128,7 @@ option(WITH_LIBWPG "Compile with support of libwpg for WordPerfect Graphics" ON)
53 + option(WITH_NLS "Compile with Native Language Support (using gettext)" ON)
54 + option(WITH_JEMALLOC "Compile with JEMALLOC support" OFF)
55 + option(WITH_ASAN "Compile with Clang's AddressSanitizer (for debugging purposes)" OFF)
56 ++cmake_dependent_option(WITH_X11 "Compile with X11 support" ON "UNIX; NOT APPLE" OFF)
57 +
58 + option(WITH_FUZZ "Compile for fuzzing purpose (use 'make fuzz' only)" OFF)
59 + mark_as_advanced(WITH_FUZZ)
60 +@@ -284,6 +286,7 @@ message("WITH_LIBWPG: ${WITH_LIBWPG}")
61 + message("WITH_NLS: ${WITH_NLS}")
62 + message("WITH_OPENMP: ${WITH_OPENMP}")
63 + message("WITH_JEMALLOC: ${WITH_JEMALLOC}")
64 ++message("WITH_X11: ${WITH_X11}")
65 +
66 + message("WITH_PROFILING: ${WITH_PROFILING}")
67 + message("BUILD_TESTING: ${BUILD_TESTING}")
68 +diff --git a/CMakeScripts/DefineDependsandFlags.cmake b/CMakeScripts/DefineDependsandFlags.cmake
69 +index 1b5ed0d349..ef3f321977 100644
70 +--- a/CMakeScripts/DefineDependsandFlags.cmake
71 ++++ b/CMakeScripts/DefineDependsandFlags.cmake
72 +@@ -384,12 +384,17 @@ sanitize_ldflags_for_libs(SIGC++_LDFLAGS)
73 + list(APPEND INKSCAPE_LIBS ${SIGC++_LDFLAGS})
74 + list(APPEND INKSCAPE_CXX_FLAGS ${SIGC++_CFLAGS_OTHER})
75 +
76 +-# Some linkers, like gold, don't find symbols recursively. So we have to link against X11 explicitly
77 +-find_package(X11)
78 +-if(X11_FOUND)
79 ++if(WITH_X11)
80 ++ find_package(X11 REQUIRED)
81 + list(APPEND INKSCAPE_INCS_SYS ${X11_INCLUDE_DIRS})
82 + list(APPEND INKSCAPE_LIBS ${X11_LIBRARIES})
83 +-endif(X11_FOUND)
84 ++ add_definitions(-DHAVE_X11)
85 ++
86 ++ pkg_get_variable(GTK3_TARGETS gtk+-3.0 targets)
87 ++ if(NOT("${GTK3_TARGETS}" MATCHES "x11"))
88 ++ message(FATAL_ERROR "GTK+3 doesn't targets X11, this is required for WITH_X11")
89 ++ endif()
90 ++endif(WITH_X11)
91 +
92 + # end Dependencies
93 +
94 +diff --git a/src/ege-color-prof-tracker.cpp b/src/ege-color-prof-tracker.cpp
95 +index 0b118f1a57..6fb721c2f3 100644
96 +--- a/src/ege-color-prof-tracker.cpp
97 ++++ b/src/ege-color-prof-tracker.cpp
98 +@@ -46,11 +46,11 @@
99 +
100 + #include <gtk/gtk.h>
101 +
102 +-#ifdef GDK_WINDOWING_X11
103 ++#ifdef HAVE_X11
104 + #include <X11/Xlib.h>
105 +
106 + #include <gdk/gdkx.h>
107 +-#endif /* GDK_WINDOWING_X11 */
108 ++#endif /* HAVE_X11 */
109 +
110 + #include "ege-color-prof-tracker.h"
111 + #include "helper/sp-marshal.h"
112 +@@ -68,24 +68,24 @@ static void ege_color_prof_tracker_set_property( GObject* obj, guint propId, con
113 +
114 + class ScreenTrack {
115 + public:
116 +-#ifdef GDK_WINDOWING_X11
117 ++#ifdef HAVE_X11
118 + gboolean zeroSeen;
119 + gboolean otherSeen;
120 +-#endif /* GDK_WINDOWING_X11 */
121 ++#endif /* HAVE_X11 */
122 + std::vector<EgeColorProfTracker *> *trackers;
123 + GPtrArray* profiles;
124 + ~ScreenTrack(){ delete trackers; }
125 + };
126 +
127 +
128 +-#ifdef GDK_WINDOWING_X11
129 ++#ifdef HAVE_X11
130 + GdkFilterReturn x11_win_filter(GdkXEvent *xevent, GdkEvent *event, gpointer data);
131 + void handle_property_change(GdkScreen* screen, const gchar* name);
132 + void add_x11_tracking_for_screen(GdkScreen* screen);
133 + static void fire(gint monitor);
134 + static void clear_profile( guint monitor );
135 + static void set_profile( guint monitor, const guint8* data, guint len );
136 +-#endif /* GDK_WINDOWING_X11 */
137 ++#endif /* HAVE_X11 */
138 +
139 + static guint signals[LAST_SIGNAL] = {0};
140 +
141 +@@ -296,10 +296,10 @@ void track_screen( GdkScreen* screen, EgeColorProfTracker* tracker )
142 +
143 + int numMonitors = gdk_display_get_n_monitors(display);
144 +
145 +-#ifdef GDK_WINDOWING_X11
146 ++#ifdef HAVE_X11
147 + tracked_screen->zeroSeen = FALSE;
148 + tracked_screen->otherSeen = FALSE;
149 +-#endif /* GDK_WINDOWING_X11 */
150 ++#endif /* HAVE_X11 */
151 + tracked_screen->trackers= new std::vector<EgeColorProfTracker *>;
152 + tracked_screen->trackers->push_back(tracker );
153 + tracked_screen->profiles = g_ptr_array_new();
154 +@@ -309,14 +309,14 @@ void track_screen( GdkScreen* screen, EgeColorProfTracker* tracker )
155 +
156 + g_signal_connect( G_OBJECT(screen), "size-changed", G_CALLBACK( screen_size_changed_cb ), tracker );
157 +
158 +-#ifdef GDK_WINDOWING_X11
159 ++#ifdef HAVE_X11
160 + if (GDK_IS_X11_DISPLAY (display) ) {
161 + // printf( "track_screen: Display is using X11\n" );
162 + add_x11_tracking_for_screen(screen);
163 + } else {
164 + // printf( "track_screen: Display is not using X11\n" );
165 + }
166 +-#endif // GDK_WINDOWING_X11
167 ++#endif // HAVE_X11
168 + }
169 + }
170 +
171 +@@ -408,13 +408,13 @@ void screen_size_changed_cb(GdkScreen* screen, gpointer user_data)
172 + if ( numMonitors > (gint)tracked_screen->profiles->len ) {
173 + for ( guint i = tracked_screen->profiles->len; i < (guint)numMonitors; i++ ) {
174 + g_ptr_array_add( tracked_screen->profiles, nullptr );
175 +-#ifdef GDK_WINDOWING_X11
176 ++#ifdef HAVE_X11
177 + if (GDK_IS_X11_DISPLAY (display) ) {
178 + gchar* name = g_strdup_printf( "_ICC_PROFILE_%d", i );
179 + handle_property_change( screen, name );
180 + g_free(name);
181 + }
182 +-#endif /* GDK_WINDOWING_X11 */
183 ++#endif /* HAVE_X11 */
184 + }
185 + } else if ( numMonitors < (gint)tracked_screen->profiles->len ) {
186 + /* g_message("The count of monitors decreased, remove some"); */
187 +@@ -422,7 +422,7 @@ void screen_size_changed_cb(GdkScreen* screen, gpointer user_data)
188 + }
189 + }
190 +
191 +-#ifdef GDK_WINDOWING_X11
192 ++#ifdef HAVE_X11
193 + GdkFilterReturn x11_win_filter(GdkXEvent *xevent,
194 + GdkEvent *event,
195 + gpointer data)
196 +@@ -615,7 +615,7 @@ static void set_profile( guint monitor, const guint8* data, guint len )
197 + }
198 + }
199 + }
200 +-#endif /* GDK_WINDOWING_X11 */
201 ++#endif /* HAVE_X11 */
202 + /*
203 + Local Variables:
204 + mode:c++
205 +--
206 +2.26.3
207 +
208
209 diff --git a/media-gfx/inkscape/inkscape-9999.ebuild b/media-gfx/inkscape/inkscape-1.1.2-r2.ebuild
210 similarity index 91%
211 copy from media-gfx/inkscape/inkscape-9999.ebuild
212 copy to media-gfx/inkscape/inkscape-1.1.2-r2.ebuild
213 index 8e02f6c2278e..bbf39788284b 100644
214 --- a/media-gfx/inkscape/inkscape-9999.ebuild
215 +++ b/media-gfx/inkscape/inkscape-1.1.2-r2.ebuild
216 @@ -22,7 +22,7 @@ HOMEPAGE="https://inkscape.org/"
217 LICENSE="GPL-2 LGPL-2.1"
218 SLOT="0"
219 IUSE="cdr dbus dia exif graphicsmagick imagemagick inkjar jemalloc jpeg
220 -openmp postscript readline spell svg2 test visio wpg"
221 +openmp postscript readline spell svg2 test visio wpg X"
222
223 REQUIRED_USE="${PYTHON_REQUIRED_USE}"
224
225 @@ -55,9 +55,9 @@ COMMON_DEPEND="${PYTHON_DEPS}
226 media-libs/libpng:0=
227 net-libs/libsoup:2.4
228 sci-libs/gsl:=
229 - x11-libs/libX11
230 >=x11-libs/pango-1.37.2
231 - x11-libs/gtk+:3
232 + x11-libs/gtk+:3[X?]
233 + X? ( x11-libs/libX11 )
234 $(python_gen_cond_dep '
235 dev-python/lxml[${PYTHON_USEDEP}]
236 media-gfx/scour[${PYTHON_USEDEP}]
237 @@ -106,6 +106,13 @@ RESTRICT="!test? ( test )"
238
239 S="${WORKDIR}/${MY_P}"
240
241 +# automagic-libX11 (merged before 1.2): https://gitlab.com/inkscape/inkscape/-/merge_requests/3208
242 +PATCHES=(
243 + "${FILESDIR}/${PN}-1.1.2-r1-poppler-22.03.0.patch" # bug 835424
244 + "${FILESDIR}/${PN}-1.1.2-r1-poppler-22.04.0.patch" # bug 835661 / bug 843275
245 + "${FILESDIR}/inkscape-1.0.2-automagic-libX11.patch" # bug 768663
246 +)
247 +
248 pkg_pretend() {
249 [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
250 }
251 @@ -154,6 +161,7 @@ src_configure() {
252 -DWITH_SVG2=$(usex svg2)
253 -DWITH_LIBVISIO=$(usex visio)
254 -DWITH_LIBWPG=$(usex wpg)
255 + -DWITH_X11=$(usex X)
256 )
257
258 cmake_src_configure
259
260 diff --git a/media-gfx/inkscape/inkscape-9999.ebuild b/media-gfx/inkscape/inkscape-9999.ebuild
261 index 8e02f6c2278e..76be9a5c187a 100644
262 --- a/media-gfx/inkscape/inkscape-9999.ebuild
263 +++ b/media-gfx/inkscape/inkscape-9999.ebuild
264 @@ -22,7 +22,7 @@ HOMEPAGE="https://inkscape.org/"
265 LICENSE="GPL-2 LGPL-2.1"
266 SLOT="0"
267 IUSE="cdr dbus dia exif graphicsmagick imagemagick inkjar jemalloc jpeg
268 -openmp postscript readline spell svg2 test visio wpg"
269 +openmp postscript readline spell svg2 test visio wpg X"
270
271 REQUIRED_USE="${PYTHON_REQUIRED_USE}"
272
273 @@ -55,9 +55,9 @@ COMMON_DEPEND="${PYTHON_DEPS}
274 media-libs/libpng:0=
275 net-libs/libsoup:2.4
276 sci-libs/gsl:=
277 - x11-libs/libX11
278 >=x11-libs/pango-1.37.2
279 - x11-libs/gtk+:3
280 + x11-libs/gtk+:3[X?]
281 + X? ( x11-libs/libX11 )
282 $(python_gen_cond_dep '
283 dev-python/lxml[${PYTHON_USEDEP}]
284 media-gfx/scour[${PYTHON_USEDEP}]
285 @@ -154,6 +154,7 @@ src_configure() {
286 -DWITH_SVG2=$(usex svg2)
287 -DWITH_LIBVISIO=$(usex visio)
288 -DWITH_LIBWPG=$(usex wpg)
289 + -DWITH_X11=$(usex X)
290 )
291
292 cmake_src_configure