about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/gtk
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2020-01-11 23:37:02 +0000
committerAlyssa Ross <hi@alyssa.is>2020-01-11 23:41:30 +0000
commit6c557e3f1c28cf87e9fba232811d6875dd1399c1 (patch)
tree035a071d5d8980df6de0fa42e2ef8fc0cce7055e /nixpkgs/pkgs/development/libraries/gtk
parentda7500bc026e937ac7fce7b50f67a0e1765737a7 (diff)
parente4134747f5666bcab8680aff67fa3b63384f9a0f (diff)
downloadnixlib-6c557e3f1c28cf87e9fba232811d6875dd1399c1.tar
nixlib-6c557e3f1c28cf87e9fba232811d6875dd1399c1.tar.gz
nixlib-6c557e3f1c28cf87e9fba232811d6875dd1399c1.tar.bz2
nixlib-6c557e3f1c28cf87e9fba232811d6875dd1399c1.tar.lz
nixlib-6c557e3f1c28cf87e9fba232811d6875dd1399c1.tar.xz
nixlib-6c557e3f1c28cf87e9fba232811d6875dd1399c1.tar.zst
nixlib-6c557e3f1c28cf87e9fba232811d6875dd1399c1.zip
Merge commit 'e4134747f5666bcab8680aff67fa3b63384f9a0f'
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/gtk')
-rw-r--r--nixpkgs/pkgs/development/libraries/gtk/2.x.nix13
-rw-r--r--nixpkgs/pkgs/development/libraries/gtk/3.x.nix38
-rw-r--r--nixpkgs/pkgs/development/libraries/gtk/hooks/drop-icon-theme-cache.sh19
-rw-r--r--nixpkgs/pkgs/development/libraries/gtk/hooks/gtk2-clean-immodules-cache.sh (renamed from nixpkgs/pkgs/development/libraries/gtk/setup-hook.sh)4
-rw-r--r--nixpkgs/pkgs/development/libraries/gtk/hooks/gtk3-clean-immodules-cache.sh (renamed from nixpkgs/pkgs/development/libraries/gtk/gtk3-setup-hook.sh)5
-rw-r--r--nixpkgs/pkgs/development/libraries/gtk/patches/01-build-Fix-path-handling-in-pkgconfig.patch (renamed from nixpkgs/pkgs/development/libraries/gtk/01-build-Fix-path-handling-in-pkgconfig.patch)0
-rw-r--r--nixpkgs/pkgs/development/libraries/gtk/patches/2.0-darwin-x11.patch (renamed from nixpkgs/pkgs/development/libraries/gtk/2.0-darwin-x11.patch)0
-rw-r--r--nixpkgs/pkgs/development/libraries/gtk/patches/2.0-immodules.cache.patch (renamed from nixpkgs/pkgs/development/libraries/gtk/2.0-immodules.cache.patch)0
-rw-r--r--nixpkgs/pkgs/development/libraries/gtk/patches/3.0-darwin-x11.patch (renamed from nixpkgs/pkgs/development/libraries/gtk/3.0-darwin-x11.patch)0
-rw-r--r--nixpkgs/pkgs/development/libraries/gtk/patches/3.0-immodules.cache.patch (renamed from nixpkgs/pkgs/development/libraries/gtk/3.0-immodules.cache.patch)0
-rw-r--r--nixpkgs/pkgs/development/libraries/gtk/patches/gtk2-theme-paths.patch (renamed from nixpkgs/pkgs/development/libraries/gtk/gtk2-theme-paths.patch)0
11 files changed, 56 insertions, 23 deletions
diff --git a/nixpkgs/pkgs/development/libraries/gtk/2.x.nix b/nixpkgs/pkgs/development/libraries/gtk/2.x.nix
index f1a53390467a..932527eed092 100644
--- a/nixpkgs/pkgs/development/libraries/gtk/2.x.nix
+++ b/nixpkgs/pkgs/development/libraries/gtk/2.x.nix
@@ -25,19 +25,22 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  setupHook = ./setup-hook.sh;
+  setupHooks =  [
+    ./hooks/gtk2-clean-immodules-cache.sh
+    ./hooks/drop-icon-theme-cache.sh
+  ];
 
-  nativeBuildInputs = [ setupHook perl pkgconfig gettext gobject-introspection ];
+  nativeBuildInputs = setupHooks ++ [ perl pkgconfig gettext gobject-introspection ];
 
   patches = [
-    ./2.0-immodules.cache.patch
-    ./gtk2-theme-paths.patch
+    ./patches/2.0-immodules.cache.patch
+    ./patches/gtk2-theme-paths.patch
   ] ++ optionals stdenv.isDarwin [
     (fetchpatch {
       url = https://bug557780.bugzilla-attachments.gnome.org/attachment.cgi?id=306776;
       sha256 = "0sp8f1r5c4j2nlnbqgv7s7nxa4cfwigvm033hvhb1ld652pjag4r";
     })
-    ./2.0-darwin-x11.patch
+    ./patches/2.0-darwin-x11.patch
   ];
 
   propagatedBuildInputs = with xorg;
diff --git a/nixpkgs/pkgs/development/libraries/gtk/3.x.nix b/nixpkgs/pkgs/development/libraries/gtk/3.x.nix
index aee97d9bad00..60432614433b 100644
--- a/nixpkgs/pkgs/development/libraries/gtk/3.x.nix
+++ b/nixpkgs/pkgs/development/libraries/gtk/3.x.nix
@@ -3,6 +3,9 @@
 , fetchpatch
 , pkgconfig
 , gettext
+, docbook_xsl
+, docbook_xml_dtd_43
+, gtk-doc
 , meson
 , ninja
 , python3
@@ -24,7 +27,6 @@
 , libxkbcommon
 , gmp
 , gnome3
-, hicolor-icon-theme
 , gsettings-desktop-schemas
 , sassc
 , x11Support ? stdenv.isLinux
@@ -34,6 +36,7 @@
 , wayland-protocols
 , xineramaSupport ? stdenv.isLinux
 , cupsSupport ? stdenv.isLinux
+, withGtkDoc ? stdenv.isLinux
 , cups ? null
 , AppKit
 , Cocoa
@@ -45,44 +48,47 @@ with stdenv.lib;
 
 stdenv.mkDerivation rec {
   pname = "gtk+3";
-  version = "3.24.10";
+  version = "3.24.12";
 
-  outputs = [ "out" "dev" ];
+  outputs = [ "out" "dev" ] ++ optional withGtkDoc "devdoc";
   outputBin = "dev";
 
-  setupHook = ./gtk3-setup-hook.sh;
+  setupHooks = [
+    ./hooks/gtk3-clean-immodules-cache.sh
+    ./hooks/drop-icon-theme-cache.sh
+  ];
 
   src = fetchurl {
     url = "mirror://gnome/sources/gtk+/${stdenv.lib.versions.majorMinor version}/gtk+-${version}.tar.xz";
-    sha256 = "00qvq1r96ikdalv7xzgng1kad9i0rcahqk01gwhxl3xrw83z3a1m";
+    sha256 = "10xyyhlfb0yk4hglngxh2zsv9xrxkqv343df8h01dvagc6jyp10k";
   };
 
   patches = [
-    ./3.0-immodules.cache.patch
+    ./patches/3.0-immodules.cache.patch
     (fetchpatch {
       name = "Xft-setting-fallback-compute-DPI-properly.patch";
       url = "https://bug757142.bugzilla-attachments.gnome.org/attachment.cgi?id=344123";
       sha256 = "0g6fhqcv8spfy3mfmxpyji93k8d4p4q4fz1v9a1c1cgcwkz41d7p";
     })
     # https://gitlab.gnome.org/GNOME/gtk/merge_requests/1002
-    ./01-build-Fix-path-handling-in-pkgconfig.patch
+    ./patches/01-build-Fix-path-handling-in-pkgconfig.patch
   ] ++ optionals stdenv.isDarwin [
     # X11 module requires <gio/gdesktopappinfo.h> which is not installed on Darwin
     # let’s drop that dependency in similar way to how other parts of the library do it
     # e.g. https://gitlab.gnome.org/GNOME/gtk/blob/3.24.4/gtk/gtk-launch.c#L31-33
-    ./3.0-darwin-x11.patch
+    ./patches/3.0-darwin-x11.patch
   ];
 
+  separateDebugInfo = stdenv.isLinux;
+
   mesonFlags = [
+    "-Dgtk_doc=${boolToString withGtkDoc}"
     "-Dtests=false"
   ];
 
   # These are the defines that'd you'd get with --enable-debug=minimum (default).
   # See: https://developer.gnome.org/gtk3/stable/gtk-building.html#extra-configuration-options
-  NIX_CFLAGS_COMPILE = [
-    "-DG_ENABLE_DEBUG"
-    "-DG_DISABLE_CAST_CHECKS"
-  ];
+  NIX_CFLAGS_COMPILE = "-DG_ENABLE_DEBUG -DG_DISABLE_CAST_CHECKS";
 
   postPatch = ''
     files=(
@@ -103,14 +109,16 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [
     gettext
     gobject-introspection
-    hicolor-icon-theme # setup-hook
     makeWrapper
     meson
     ninja
     pkgconfig
     python3
     sassc
-    setupHook
+  ] ++ setupHooks ++ optionals withGtkDoc [
+    docbook_xml_dtd_43
+    docbook_xsl
+    gtk-doc
   ];
 
   buildInputs = [
@@ -192,7 +200,7 @@ stdenv.mkDerivation rec {
     '';
     homepage = https://www.gtk.org/;
     license = licenses.lgpl2Plus;
-    maintainers = with maintainers; [ raskin vcunat lethalman ];
+    maintainers = with maintainers; [ raskin vcunat lethalman worldofpeace ];
     platforms = platforms.all;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/gtk/hooks/drop-icon-theme-cache.sh b/nixpkgs/pkgs/development/libraries/gtk/hooks/drop-icon-theme-cache.sh
new file mode 100644
index 000000000000..f28a856c4f50
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gtk/hooks/drop-icon-theme-cache.sh
@@ -0,0 +1,19 @@
+# shellcheck shell=bash
+
+# Packages often run gtk-update-icon-cache to include their icons in themes’ icon cache.
+# However, since each package is installed to its own prefix, the files will only collide.
+dropIconThemeCache() {
+    if [[ -z "${dontDropIconThemeCache:-}" ]]; then
+        local icondir="${out:?}/share/icons"
+        if [[ -d "${icondir}" ]]; then
+            # App icons are supposed to go to hicolor theme, since it is a fallback theme as per [icon-theme-spec], but some might still choose to install stylized icons to other themes.
+            find "${icondir}" -name 'icon-theme.cache' -print0 \
+              | while IFS= read -r -d '' file; do
+                echo "Removing ${file}"
+                rm -f "${file}"
+            done
+        fi
+    fi
+}
+
+preFixupPhases="${preFixupPhases-} dropIconThemeCache"
diff --git a/nixpkgs/pkgs/development/libraries/gtk/setup-hook.sh b/nixpkgs/pkgs/development/libraries/gtk/hooks/gtk2-clean-immodules-cache.sh
index c2b0ab502db7..dde991fd27cd 100644
--- a/nixpkgs/pkgs/development/libraries/gtk/setup-hook.sh
+++ b/nixpkgs/pkgs/development/libraries/gtk/hooks/gtk2-clean-immodules-cache.sh
@@ -1,8 +1,10 @@
+# shellcheck shell=bash
+
 fixupOutputHooks+=(_gtk2CleanComments)
 
 # Clean comments that link to generator of the file
 _gtk2CleanComments() {
-    local f="$prefix/lib/gtk-2.0/2.10.0/immodules.cache"
+    local f="${prefix:?}/lib/gtk-2.0/2.10.0/immodules.cache"
     if [ -f "$f" ]; then
         sed 's|Created by .*bin/gtk-query-|Created by bin/gtk-query-|' -i "$f"
     fi
diff --git a/nixpkgs/pkgs/development/libraries/gtk/gtk3-setup-hook.sh b/nixpkgs/pkgs/development/libraries/gtk/hooks/gtk3-clean-immodules-cache.sh
index bddeb2d25d50..d2d5287831a0 100644
--- a/nixpkgs/pkgs/development/libraries/gtk/gtk3-setup-hook.sh
+++ b/nixpkgs/pkgs/development/libraries/gtk/hooks/gtk3-clean-immodules-cache.sh
@@ -1,10 +1,11 @@
+# shellcheck shell=bash
+
 fixupOutputHooks+=(_gtk3CleanComments)
 
 # Clean comments that link to generator of the file
 _gtk3CleanComments() {
-    local f="$prefix/lib/gtk-3.0/3.0.0/immodules.cache"
+    local f="${prefix:?}/lib/gtk-3.0/3.0.0/immodules.cache"
     if [ -f "$f" ]; then
         sed 's|Created by .*bin/gtk-query-|Created by bin/gtk-query-|' -i "$f"
     fi
 }
-
diff --git a/nixpkgs/pkgs/development/libraries/gtk/01-build-Fix-path-handling-in-pkgconfig.patch b/nixpkgs/pkgs/development/libraries/gtk/patches/01-build-Fix-path-handling-in-pkgconfig.patch
index ec69a12514fe..ec69a12514fe 100644
--- a/nixpkgs/pkgs/development/libraries/gtk/01-build-Fix-path-handling-in-pkgconfig.patch
+++ b/nixpkgs/pkgs/development/libraries/gtk/patches/01-build-Fix-path-handling-in-pkgconfig.patch
diff --git a/nixpkgs/pkgs/development/libraries/gtk/2.0-darwin-x11.patch b/nixpkgs/pkgs/development/libraries/gtk/patches/2.0-darwin-x11.patch
index 9725cfb84260..9725cfb84260 100644
--- a/nixpkgs/pkgs/development/libraries/gtk/2.0-darwin-x11.patch
+++ b/nixpkgs/pkgs/development/libraries/gtk/patches/2.0-darwin-x11.patch
diff --git a/nixpkgs/pkgs/development/libraries/gtk/2.0-immodules.cache.patch b/nixpkgs/pkgs/development/libraries/gtk/patches/2.0-immodules.cache.patch
index 1b8231756e71..1b8231756e71 100644
--- a/nixpkgs/pkgs/development/libraries/gtk/2.0-immodules.cache.patch
+++ b/nixpkgs/pkgs/development/libraries/gtk/patches/2.0-immodules.cache.patch
diff --git a/nixpkgs/pkgs/development/libraries/gtk/3.0-darwin-x11.patch b/nixpkgs/pkgs/development/libraries/gtk/patches/3.0-darwin-x11.patch
index 86631634b5bd..86631634b5bd 100644
--- a/nixpkgs/pkgs/development/libraries/gtk/3.0-darwin-x11.patch
+++ b/nixpkgs/pkgs/development/libraries/gtk/patches/3.0-darwin-x11.patch
diff --git a/nixpkgs/pkgs/development/libraries/gtk/3.0-immodules.cache.patch b/nixpkgs/pkgs/development/libraries/gtk/patches/3.0-immodules.cache.patch
index bbe5f28dbd3e..bbe5f28dbd3e 100644
--- a/nixpkgs/pkgs/development/libraries/gtk/3.0-immodules.cache.patch
+++ b/nixpkgs/pkgs/development/libraries/gtk/patches/3.0-immodules.cache.patch
diff --git a/nixpkgs/pkgs/development/libraries/gtk/gtk2-theme-paths.patch b/nixpkgs/pkgs/development/libraries/gtk/patches/gtk2-theme-paths.patch
index edd69b078076..edd69b078076 100644
--- a/nixpkgs/pkgs/development/libraries/gtk/gtk2-theme-paths.patch
+++ b/nixpkgs/pkgs/development/libraries/gtk/patches/gtk2-theme-paths.patch