Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libheif: Add gdk-pixbuf module #87033

Closed
jtojnar opened this issue May 6, 2020 · 6 comments · Fixed by #212842
Closed

libheif: Add gdk-pixbuf module #87033

jtojnar opened this issue May 6, 2020 · 6 comments · Fixed by #212842
Labels
0.kind: enhancement Add something new 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 6.topic: GNOME GNOME desktop environment and its underlying platform

Comments

@jtojnar
Copy link
Member

jtojnar commented May 6, 2020

This is required for HEIF/HEIC support in eog work.

Modules are trying to install to gdk-pixbuf prefix, even though the code looks the same as in librsvg (we are patching it in postConfigure) where it works. (That can be fixed using the pkg-config env var.)

But the loaders.cache file is not generated/installed so the setup hook cannot pick it up.

diff --git a/pkgs/desktops/gnome-3/core/eog/default.nix b/pkgs/desktops/gnome-3/core/eog/default.nix
index db15cf2555c..2d1d6197bee 100644
--- a/pkgs/desktops/gnome-3/core/eog/default.nix
+++ b/pkgs/desktops/gnome-3/core/eog/default.nix
@@ -1,5 +1,5 @@
 { fetchurl, stdenv, meson, ninja, gettext, itstool, pkgconfig, libxml2, libjpeg, libpeas, gnome3
-, gtk3, glib, gsettings-desktop-schemas, adwaita-icon-theme, gnome-desktop, lcms2, gdk-pixbuf, exempi
+, gtk3, glib, gsettings-desktop-schemas, adwaita-icon-theme, gnome-desktop, lcms2, gdk-pixbuf, exempi, libheif
 , shared-mime-info, wrapGAppsHook, librsvg, libexif, gobject-introspection, python3 }:
 
 let
@@ -16,7 +16,7 @@ in stdenv.mkDerivation rec {
   nativeBuildInputs = [ meson ninja pkgconfig gettext itstool wrapGAppsHook libxml2 gobject-introspection python3 ];
 
   buildInputs = [
-    libjpeg gtk3 gdk-pixbuf glib libpeas librsvg lcms2 gnome-desktop libexif exempi
+    libjpeg gtk3 gdk-pixbuf glib libpeas librsvg lcms2 gnome-desktop libexif exempi libheif
     gsettings-desktop-schemas shared-mime-info adwaita-icon-theme
   ];
 
diff --git a/pkgs/development/libraries/gdk-pixbuf/default.nix b/pkgs/development/libraries/gdk-pixbuf/default.nix
index 82fbbc967ef..92b5505c5a8 100644
--- a/pkgs/development/libraries/gdk-pixbuf/default.nix
+++ b/pkgs/development/libraries/gdk-pixbuf/default.nix
@@ -87,7 +87,7 @@ in stdenv.mkDerivation rec {
   # The tests take an excessive amount of time (> 1.5 hours) and memory (> 6 GB).
   inherit doCheck;
 
-  passthru = {
+  passthru = rec {
     updateScript = gnome3.updateScript {
       packageName = pname;
     };
@@ -96,8 +96,9 @@ in stdenv.mkDerivation rec {
       installedTests = nixosTests.installed-tests.gdk-pixbuf;
     };
 
-    # gdk_pixbuf_moduledir variable from gdk-pixbuf-2.0.pc
-    moduleDir = "lib/gdk-pixbuf-2.0/2.10.0/loaders";
+    # gdk_pixbuf_binarydir variable from gdk-pixbuf-2.0.pc
+    binaryDir = "lib/gdk-pixbuf-2.0/2.10.0";
+    moduleDir = "${binaryDir}/loaders";
   };
 
   meta = with stdenv.lib; {
diff --git a/pkgs/development/libraries/libheif/default.nix b/pkgs/development/libraries/libheif/default.nix
index b5717034da0..059615794c9 100644
--- a/pkgs/development/libraries/libheif/default.nix
+++ b/pkgs/development/libraries/libheif/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, libde265, x265, libpng, libjpeg }:
+{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, libde265, x265, libpng, libjpeg, gdk-pixbuf }:
 
 stdenv.mkDerivation rec {
   pname = "libheif";
@@ -14,10 +14,13 @@ stdenv.mkDerivation rec {
   };
 
   nativeBuildInputs = [ autoreconfHook pkgconfig ];
-  buildInputs = [ libde265 x265 libpng libjpeg ];
+  buildInputs = [ libde265 x265 libpng libjpeg gdk-pixbuf ];
 
   enableParallelBuilding = true;
 
+  # Fix installation path for gdk-pixbuf module
+  PKG_CONFIG_GDK_PIXBUF_2_0_GDK_PIXBUF_BINARYDIR = "${placeholder "out"}/${gdk-pixbuf.binaryDir}";
+
   meta = {
     homepage = "http://www.libheif.org/";
     description = "ISO/IEC 23008-12:2017 HEIF image file format decoder and encoder";

Originally posted by @jtojnar in #86661 (comment)

@jtojnar jtojnar added 0.kind: enhancement Add something new 6.topic: GNOME GNOME desktop environment and its underlying platform labels May 6, 2020
@stale
Copy link

stale bot commented Nov 2, 2020

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Nov 2, 2020
@alexeymuranov
Copy link
Contributor

Does not look stale to me.

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Dec 22, 2020
@stale
Copy link

stale bot commented Jun 20, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 20, 2021
@alexeymuranov
Copy link
Contributor

Still important to me.

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jul 7, 2021
@stale
Copy link

stale bot commented Jan 3, 2022

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jan 3, 2022
@jtojnar
Copy link
Member Author

jtojnar commented Jan 3, 2022

#153275 will make this possible.

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jan 3, 2022
@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jul 10, 2022
@JohnRTitor JohnRTitor added this to GNOME Jun 20, 2024
@JohnRTitor JohnRTitor moved this to Done in GNOME Jun 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: enhancement Add something new 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 6.topic: GNOME GNOME desktop environment and its underlying platform
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants