diff options
author | Haelwenn (lanodan) Monnier <contact@hacktivis.me> | 2021-03-29 17:49:06 +0200 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2022-05-26 02:10:45 +0100 |
commit | e6873fa9fe5ae8d9e3057f4d4d1204ff2e40122f (patch) | |
tree | 7ff04e2c9e34c150844f1e54c243b1cc6d861c54 /media-gfx | |
parent | sys-auth/seatd: Version bump, 0.7.0 (diff) | |
download | gentoo-e6873fa9fe5ae8d9e3057f4d4d1204ff2e40122f.tar.gz gentoo-e6873fa9fe5ae8d9e3057f4d4d1204ff2e40122f.tar.bz2 gentoo-e6873fa9fe5ae8d9e3057f4d4d1204ff2e40122f.zip |
media-gfx/inkscape: Fix automagic dependency on libX11
Related: https://gitlab.com/inkscape/inkscape/-/merge_requests/3208
Closes: https://bugs.gentoo.org/768663
Signed-off-by: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Closes: https://github.com/gentoo/gentoo/pull/20181
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'media-gfx')
-rw-r--r-- | media-gfx/inkscape/files/inkscape-1.0.2-automagic-libX11.patch | 181 | ||||
-rw-r--r-- | media-gfx/inkscape/inkscape-1.1.2-r2.ebuild | 191 | ||||
-rw-r--r-- | media-gfx/inkscape/inkscape-9999.ebuild | 7 |
3 files changed, 376 insertions, 3 deletions
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 new file mode 100644 index 000000000000..b8f93642088d --- /dev/null +++ b/media-gfx/inkscape/files/inkscape-1.0.2-automagic-libX11.patch @@ -0,0 +1,181 @@ +From 6d0ace0518f0da18c7e81be1edecd50d997230b1 Mon Sep 17 00:00:00 2001 +From: "Haelwenn (lanodan) Monnier" <contact@hacktivis.me> +Date: Tue, 11 May 2021 10:43:27 +0200 +Subject: [PATCH] CMake: Fix automagic dependency on X11 + +Related: https://bugs.gentoo.org/768663 +Related: https://github.com/gentoo/gentoo/pull/20181 +--- + CMakeLists.txt | 3 +++ + CMakeScripts/DefineDependsandFlags.cmake | 13 +++++++---- + src/ege-color-prof-tracker.cpp | 28 ++++++++++++------------ + 3 files changed, 26 insertions(+), 18 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c5cb3f7fbd..2a04d86fbf 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -36,6 +36,7 @@ project(inkscape) + set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME inkscape) # needs to be before any install() commands + + include(CMakeScripts/ConfigPaths.cmake) ++include(CMakeDependentOption) + + set(PROJECT_NAME inkscape) + +@@ -127,6 +128,7 @@ option(WITH_LIBWPG "Compile with support of libwpg for WordPerfect Graphics" ON) + option(WITH_NLS "Compile with Native Language Support (using gettext)" ON) + option(WITH_JEMALLOC "Compile with JEMALLOC support" OFF) + option(WITH_ASAN "Compile with Clang's AddressSanitizer (for debugging purposes)" OFF) ++cmake_dependent_option(WITH_X11 "Compile with X11 support" ON "UNIX; NOT APPLE" OFF) + + option(WITH_FUZZ "Compile for fuzzing purpose (use 'make fuzz' only)" OFF) + mark_as_advanced(WITH_FUZZ) +@@ -284,6 +286,7 @@ message("WITH_LIBWPG: ${WITH_LIBWPG}") + message("WITH_NLS: ${WITH_NLS}") + message("WITH_OPENMP: ${WITH_OPENMP}") + message("WITH_JEMALLOC: ${WITH_JEMALLOC}") ++message("WITH_X11: ${WITH_X11}") + + message("WITH_PROFILING: ${WITH_PROFILING}") + message("BUILD_TESTING: ${BUILD_TESTING}") +diff --git a/CMakeScripts/DefineDependsandFlags.cmake b/CMakeScripts/DefineDependsandFlags.cmake +index 1b5ed0d349..ef3f321977 100644 +--- a/CMakeScripts/DefineDependsandFlags.cmake ++++ b/CMakeScripts/DefineDependsandFlags.cmake +@@ -384,12 +384,17 @@ sanitize_ldflags_for_libs(SIGC++_LDFLAGS) + list(APPEND INKSCAPE_LIBS ${SIGC++_LDFLAGS}) + list(APPEND INKSCAPE_CXX_FLAGS ${SIGC++_CFLAGS_OTHER}) + +-# Some linkers, like gold, don't find symbols recursively. So we have to link against X11 explicitly +-find_package(X11) +-if(X11_FOUND) ++if(WITH_X11) ++ find_package(X11 REQUIRED) + list(APPEND INKSCAPE_INCS_SYS ${X11_INCLUDE_DIRS}) + list(APPEND INKSCAPE_LIBS ${X11_LIBRARIES}) +-endif(X11_FOUND) ++ add_definitions(-DHAVE_X11) ++ ++ pkg_get_variable(GTK3_TARGETS gtk+-3.0 targets) ++ if(NOT("${GTK3_TARGETS}" MATCHES "x11")) ++ message(FATAL_ERROR "GTK+3 doesn't targets X11, this is required for WITH_X11") ++ endif() ++endif(WITH_X11) + + # end Dependencies + +diff --git a/src/ege-color-prof-tracker.cpp b/src/ege-color-prof-tracker.cpp +index 0b118f1a57..6fb721c2f3 100644 +--- a/src/ege-color-prof-tracker.cpp ++++ b/src/ege-color-prof-tracker.cpp +@@ -46,11 +46,11 @@ + + #include <gtk/gtk.h> + +-#ifdef GDK_WINDOWING_X11 ++#ifdef HAVE_X11 + #include <X11/Xlib.h> + + #include <gdk/gdkx.h> +-#endif /* GDK_WINDOWING_X11 */ ++#endif /* HAVE_X11 */ + + #include "ege-color-prof-tracker.h" + #include "helper/sp-marshal.h" +@@ -68,24 +68,24 @@ static void ege_color_prof_tracker_set_property( GObject* obj, guint propId, con + + class ScreenTrack { + public: +-#ifdef GDK_WINDOWING_X11 ++#ifdef HAVE_X11 + gboolean zeroSeen; + gboolean otherSeen; +-#endif /* GDK_WINDOWING_X11 */ ++#endif /* HAVE_X11 */ + std::vector<EgeColorProfTracker *> *trackers; + GPtrArray* profiles; + ~ScreenTrack(){ delete trackers; } + }; + + +-#ifdef GDK_WINDOWING_X11 ++#ifdef HAVE_X11 + GdkFilterReturn x11_win_filter(GdkXEvent *xevent, GdkEvent *event, gpointer data); + void handle_property_change(GdkScreen* screen, const gchar* name); + void add_x11_tracking_for_screen(GdkScreen* screen); + static void fire(gint monitor); + static void clear_profile( guint monitor ); + static void set_profile( guint monitor, const guint8* data, guint len ); +-#endif /* GDK_WINDOWING_X11 */ ++#endif /* HAVE_X11 */ + + static guint signals[LAST_SIGNAL] = {0}; + +@@ -296,10 +296,10 @@ void track_screen( GdkScreen* screen, EgeColorProfTracker* tracker ) + + int numMonitors = gdk_display_get_n_monitors(display); + +-#ifdef GDK_WINDOWING_X11 ++#ifdef HAVE_X11 + tracked_screen->zeroSeen = FALSE; + tracked_screen->otherSeen = FALSE; +-#endif /* GDK_WINDOWING_X11 */ ++#endif /* HAVE_X11 */ + tracked_screen->trackers= new std::vector<EgeColorProfTracker *>; + tracked_screen->trackers->push_back(tracker ); + tracked_screen->profiles = g_ptr_array_new(); +@@ -309,14 +309,14 @@ void track_screen( GdkScreen* screen, EgeColorProfTracker* tracker ) + + g_signal_connect( G_OBJECT(screen), "size-changed", G_CALLBACK( screen_size_changed_cb ), tracker ); + +-#ifdef GDK_WINDOWING_X11 ++#ifdef HAVE_X11 + if (GDK_IS_X11_DISPLAY (display) ) { + // printf( "track_screen: Display is using X11\n" ); + add_x11_tracking_for_screen(screen); + } else { + // printf( "track_screen: Display is not using X11\n" ); + } +-#endif // GDK_WINDOWING_X11 ++#endif // HAVE_X11 + } + } + +@@ -408,13 +408,13 @@ void screen_size_changed_cb(GdkScreen* screen, gpointer user_data) + if ( numMonitors > (gint)tracked_screen->profiles->len ) { + for ( guint i = tracked_screen->profiles->len; i < (guint)numMonitors; i++ ) { + g_ptr_array_add( tracked_screen->profiles, nullptr ); +-#ifdef GDK_WINDOWING_X11 ++#ifdef HAVE_X11 + if (GDK_IS_X11_DISPLAY (display) ) { + gchar* name = g_strdup_printf( "_ICC_PROFILE_%d", i ); + handle_property_change( screen, name ); + g_free(name); + } +-#endif /* GDK_WINDOWING_X11 */ ++#endif /* HAVE_X11 */ + } + } else if ( numMonitors < (gint)tracked_screen->profiles->len ) { + /* g_message("The count of monitors decreased, remove some"); */ +@@ -422,7 +422,7 @@ void screen_size_changed_cb(GdkScreen* screen, gpointer user_data) + } + } + +-#ifdef GDK_WINDOWING_X11 ++#ifdef HAVE_X11 + GdkFilterReturn x11_win_filter(GdkXEvent *xevent, + GdkEvent *event, + gpointer data) +@@ -615,7 +615,7 @@ static void set_profile( guint monitor, const guint8* data, guint len ) + } + } + } +-#endif /* GDK_WINDOWING_X11 */ ++#endif /* HAVE_X11 */ + /* + Local Variables: + mode:c++ +-- +2.26.3 + diff --git a/media-gfx/inkscape/inkscape-1.1.2-r2.ebuild b/media-gfx/inkscape/inkscape-1.1.2-r2.ebuild new file mode 100644 index 000000000000..bbf39788284b --- /dev/null +++ b/media-gfx/inkscape/inkscape-1.1.2-r2.ebuild @@ -0,0 +1,191 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{8..10} ) +PYTHON_REQ_USE="xml" +MY_P="${P/_/}" +inherit cmake flag-o-matic xdg toolchain-funcs python-single-r1 + +if [[ ${PV} = 9999* ]]; then + inherit git-r3 + EGIT_REPO_URI="https://gitlab.com/inkscape/inkscape.git" +else + SRC_URI="https://media.inkscape.org/dl/resources/file/${P}.tar.xz" + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~riscv ~sparc ~x86" +fi + +DESCRIPTION="SVG based generic vector-drawing program" +HOMEPAGE="https://inkscape.org/" + +LICENSE="GPL-2 LGPL-2.1" +SLOT="0" +IUSE="cdr dbus dia exif graphicsmagick imagemagick inkjar jemalloc jpeg +openmp postscript readline spell svg2 test visio wpg X" + +REQUIRED_USE="${PYTHON_REQUIRED_USE}" + +BDEPEND=" + dev-util/glib-utils + >=dev-util/intltool-0.40 + >=sys-devel/gettext-0.17 + virtual/pkgconfig + test? ( virtual/imagemagick-tools ) +" +COMMON_DEPEND="${PYTHON_DEPS} + >=app-text/poppler-0.57.0:=[cairo] + >=dev-cpp/cairomm-1.12:0 + >=dev-cpp/glibmm-2.54.1:2 + dev-cpp/gtkmm:3.0 + >=dev-cpp/pangomm-2.40:1.4 + >=dev-libs/boehm-gc-7.1:= + >=dev-libs/boost-1.65:= + dev-libs/double-conversion:= + >=dev-libs/glib-2.41 + >=dev-libs/libsigc++-2.8:2 + >=dev-libs/libxml2-2.7.4 + >=dev-libs/libxslt-1.1.25 + dev-libs/gdl:3 + dev-libs/popt + media-gfx/potrace + media-libs/fontconfig + media-libs/freetype:2 + media-libs/lcms:2 + media-libs/libpng:0= + net-libs/libsoup:2.4 + sci-libs/gsl:= + >=x11-libs/pango-1.37.2 + x11-libs/gtk+:3[X?] + X? ( x11-libs/libX11 ) + $(python_gen_cond_dep ' + dev-python/lxml[${PYTHON_USEDEP}] + media-gfx/scour[${PYTHON_USEDEP}] + ') + cdr? ( + app-text/libwpg:0.3 + dev-libs/librevenge + media-libs/libcdr + ) + dbus? ( dev-libs/dbus-glib ) + exif? ( media-libs/libexif ) + imagemagick? ( + !graphicsmagick? ( media-gfx/imagemagick:=[cxx] ) + graphicsmagick? ( media-gfx/graphicsmagick:=[cxx] ) + ) + jemalloc? ( dev-libs/jemalloc ) + jpeg? ( media-libs/libjpeg-turbo:= ) + readline? ( sys-libs/readline:= ) + spell? ( app-text/gspell ) + visio? ( + app-text/libwpg:0.3 + dev-libs/librevenge + media-libs/libvisio + ) + wpg? ( + app-text/libwpg:0.3 + dev-libs/librevenge + ) +" +# These only use executables provided by these packages +# See share/extensions for more details. inkscape can tell you to +# install these so we could of course just not depend on those and rely +# on that. +RDEPEND="${COMMON_DEPEND} + $(python_gen_cond_dep ' + dev-python/numpy[${PYTHON_USEDEP}] + ') + dia? ( app-office/dia ) + postscript? ( app-text/ghostscript-gpl ) +" +DEPEND="${COMMON_DEPEND} + test? ( dev-cpp/gtest ) +" + +RESTRICT="!test? ( test )" + +S="${WORKDIR}/${MY_P}" + +# automagic-libX11 (merged before 1.2): https://gitlab.com/inkscape/inkscape/-/merge_requests/3208 +PATCHES=( + "${FILESDIR}/${PN}-1.1.2-r1-poppler-22.03.0.patch" # bug 835424 + "${FILESDIR}/${PN}-1.1.2-r1-poppler-22.04.0.patch" # bug 835661 / bug 843275 + "${FILESDIR}/inkscape-1.0.2-automagic-libX11.patch" # bug 768663 +) + +pkg_pretend() { + [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp +} + +pkg_setup() { + [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp + python-single-r1_pkg_setup +} + +src_unpack() { + if [[ ${PV} = 9999* ]]; then + git-r3_src_unpack + else + default + fi + [[ -d "${S}" ]] || mv -v "${WORKDIR}/${P}_202"?-??-* "${S}" || die +} + +src_prepare() { + cmake_src_prepare + sed -i "/install.*COPYING/d" CMakeScripts/ConfigCPack.cmake || die +} + +src_configure() { + # aliasing unsafe wrt #310393 + append-flags -fno-strict-aliasing + + local mycmakeargs=( + # -DWITH_LPETOOL # Compile with LPE Tool and experimental LPEs enabled + -DWITH_NLS=ON + -DENABLE_POPPLER=ON + -DENABLE_POPPLER_CAIRO=ON + -DWITH_PROFILING=OFF + -DWITH_INTERNAL_2GEOM=ON + -DBUILD_TESTING=$(usex test) + -DWITH_LIBCDR=$(usex cdr) + -DWITH_DBUS=$(usex dbus) + -DWITH_IMAGE_MAGICK=$(usex imagemagick $(usex !graphicsmagick)) # requires ImageMagick 6, only IM must be enabled + -DWITH_GRAPHICS_MAGICK=$(usex graphicsmagick $(usex imagemagick)) # both must be enabled to use GraphicsMagick + -DWITH_GNU_READLINE=$(usex readline) + -DWITH_GSPELL=$(usex spell) + -DWITH_JEMALLOC=$(usex jemalloc) + -DENABLE_LCMS=ON + -DWITH_OPENMP=$(usex openmp) + -DBUILD_SHARED_LIBS=ON + -DWITH_SVG2=$(usex svg2) + -DWITH_LIBVISIO=$(usex visio) + -DWITH_LIBWPG=$(usex wpg) + -DWITH_X11=$(usex X) + ) + + cmake_src_configure +} + +src_test() { + cmake_build -j1 check +} + +src_install() { + cmake_src_install + + find "${ED}" -type f -name "*.la" -delete || die + + find "${ED}"/usr/share/man -type f -maxdepth 3 -name '*.bz2' -exec bzip2 -d {} \; || die + + find "${ED}"/usr/share/man -type f -maxdepth 3 -name '*.gz' -exec gzip -d {} \; || die + + local extdir="${ED}"/usr/share/${PN}/extensions + + if [[ -e "${extdir}" ]] && [[ -n $(find "${extdir}" -mindepth 1) ]]; then + python_optimize "${ED}"/usr/share/${PN}/extensions + fi + + # Empty directory causes sandbox issues, see bug #761915 + rm -r "${ED}/usr/share/inkscape/fonts" || die "Failed to remove fonts directory." +} diff --git a/media-gfx/inkscape/inkscape-9999.ebuild b/media-gfx/inkscape/inkscape-9999.ebuild index 8e02f6c2278e..76be9a5c187a 100644 --- a/media-gfx/inkscape/inkscape-9999.ebuild +++ b/media-gfx/inkscape/inkscape-9999.ebuild @@ -22,7 +22,7 @@ HOMEPAGE="https://inkscape.org/" LICENSE="GPL-2 LGPL-2.1" SLOT="0" IUSE="cdr dbus dia exif graphicsmagick imagemagick inkjar jemalloc jpeg -openmp postscript readline spell svg2 test visio wpg" +openmp postscript readline spell svg2 test visio wpg X" REQUIRED_USE="${PYTHON_REQUIRED_USE}" @@ -55,9 +55,9 @@ COMMON_DEPEND="${PYTHON_DEPS} media-libs/libpng:0= net-libs/libsoup:2.4 sci-libs/gsl:= - x11-libs/libX11 >=x11-libs/pango-1.37.2 - x11-libs/gtk+:3 + x11-libs/gtk+:3[X?] + X? ( x11-libs/libX11 ) $(python_gen_cond_dep ' dev-python/lxml[${PYTHON_USEDEP}] media-gfx/scour[${PYTHON_USEDEP}] @@ -154,6 +154,7 @@ src_configure() { -DWITH_SVG2=$(usex svg2) -DWITH_LIBVISIO=$(usex visio) -DWITH_LIBWPG=$(usex wpg) + -DWITH_X11=$(usex X) ) cmake_src_configure |