From 6e5e934a358104bc9a3aa4e249c6c6ffd4ad6e8a Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Mon, 10 Feb 2025 20:49:52 +0100 Subject: [PATCH] gdk-pixbuf: drop static-lerc.patch This is no longer necessary since static libtiff no longer links with lerc. --- .../libraries/gdk-pixbuf/default.nix | 1 - .../libraries/gdk-pixbuf/static-lerc.patch | 79 ------------------- 2 files changed, 80 deletions(-) delete mode 100644 pkgs/development/libraries/gdk-pixbuf/static-lerc.patch diff --git a/pkgs/development/libraries/gdk-pixbuf/default.nix b/pkgs/development/libraries/gdk-pixbuf/default.nix index 8c1d6926bcb9..95a8e14497d9 100644 --- a/pkgs/development/libraries/gdk-pixbuf/default.nix +++ b/pkgs/development/libraries/gdk-pixbuf/default.nix @@ -53,7 +53,6 @@ stdenv.mkDerivation (finalAttrs: { ./installed-tests-path.patch ./static-deps.patch - ./static-lerc.patch ]; # gdk-pixbuf-thumbnailer is not wrapped therefore strictDeps will work diff --git a/pkgs/development/libraries/gdk-pixbuf/static-lerc.patch b/pkgs/development/libraries/gdk-pixbuf/static-lerc.patch deleted file mode 100644 index 737844a078ab..000000000000 --- a/pkgs/development/libraries/gdk-pixbuf/static-lerc.patch +++ /dev/null @@ -1,79 +0,0 @@ -From 3bca69d889fe545dda4ed9a8fab8ff3fe38ba487 Mon Sep 17 00:00:00 2001 -From: Alyssa Ross -Date: Wed, 5 Feb 2025 19:37:27 +0100 -Subject: [PATCH] build: fix linking with libtiff with lerc support - -Lerc is written in C++. When C and C++ objects are linked, a C++ -linker should be used to ensure C++-specific things are correctly -handled. See e.g. this comment in the Meson source for reference[1]. -One symptom of using a C linker to link with C++ objects is that -libstdc++ won't be linked when building static executables, causing -link failures. - -Unfortunately, Meson does not know whether dependencies found by -pkg-config are C++, and therefore require a C++ linker, so we have to -tell it ourselves to use a C++ linker. There's no way to check -whether libtiff is built with Lerc support, so we always use a C++ -linker if one is available and libtiff support is enabled. If a C++ -linker ends up being used to link only C objects, it shouldn't do any -harm. - -[1]: https://github.com/mesonbuild/meson/blob/9fd5281befe7881c9d1210c9e6865382bc0f2b08/mesonbuild/build.py#L1558-L1565 ---- -Link: https://gitlab.gnome.org/GNOME/gdk-pixbuf/-/merge_requests/181 - - gdk-pixbuf/meson.build | 6 ++++++ - meson.build | 6 ++++++ - 2 files changed, 12 insertions(+) - -diff --git a/gdk-pixbuf/meson.build b/gdk-pixbuf/meson.build -index 570625bfe..5cc11355f 100644 ---- a/gdk-pixbuf/meson.build -+++ b/gdk-pixbuf/meson.build -@@ -333,6 +333,11 @@ gdkpixbuf_bin = [ - [ 'gdk-pixbuf-query-loaders', [ 'queryloaders.c' ] ], - ] - -+bin_link_language = 'c' -+if loaders_cpp -+ bin_link_language = 'cpp' -+endif -+ - foreach bin: gdkpixbuf_bin - bin_name = bin[0] - bin_source = bin.get(1, bin_name + '.c') -@@ -342,6 +347,7 @@ foreach bin: gdkpixbuf_bin - dependencies: gdk_pixbuf_deps + [ gdkpixbuf_dep ], - include_directories: [ root_inc, gdk_pixbuf_inc ], - c_args: common_cflags + gdk_pixbuf_cflags, -+ link_language : bin_link_language, - install: true) - meson.override_find_program(bin_name, bin) - -diff --git a/meson.build b/meson.build -index f0d4812f4..31b3197fc 100644 ---- a/meson.build -+++ b/meson.build -@@ -345,6 +345,8 @@ endif - - # Don't check and build the tiff loader if native_windows_loaders is true - tiff_opt = get_option('tiff') -+tiff_dep = dependency('', required: false) -+loaders_cpp = false - if not tiff_opt.disabled() and not native_windows_loaders - # We currently don't have a fallback subproject, but this handles error - # reporting if tiff_opt is enabled. -@@ -353,6 +355,10 @@ if not tiff_opt.disabled() and not native_windows_loaders - if tiff_dep.found() - enabled_loaders += 'tiff' - loaders_deps += tiff_dep -+ -+ # If libtiff is built with LERC support, it should be linked with -+ # a C++ linker. -+ loaders_cpp = loaders_cpp or add_languages('cpp', required: false, native: false) - endif - endif - --- -GitLab -