summary refs log tree commit diff
diff options
context:
space:
mode:
authorworldofpeace <worldofpeace@protonmail.ch>2019-06-25 21:07:28 -0400
committerFrederik Rietdijk <freddyrietdijk@fridh.nl>2019-07-17 10:45:06 +0200
commit638c39e65bce5adcea7b7bebf3586c7ee371563f (patch)
treefe4633b707ca4a59aa65ba4a797cd082198e757e
parenta7edafd0d372ea3f9ae7cadfcd098adac8ab1a4d (diff)
downloadnixpkgs-638c39e65bce5adcea7b7bebf3586c7ee371563f.tar
nixpkgs-638c39e65bce5adcea7b7bebf3586c7ee371563f.tar.gz
nixpkgs-638c39e65bce5adcea7b7bebf3586c7ee371563f.tar.bz2
nixpkgs-638c39e65bce5adcea7b7bebf3586c7ee371563f.tar.lz
nixpkgs-638c39e65bce5adcea7b7bebf3586c7ee371563f.tar.xz
nixpkgs-638c39e65bce5adcea7b7bebf3586c7ee371563f.tar.zst
nixpkgs-638c39e65bce5adcea7b7bebf3586c7ee371563f.zip
gtk3: 3.24.8 -> 3.24.10, meson!
We now build gtk3 with the meson build system.
Notably, at least for the expression, all the platforms
logic for we had for configureFlags should be unneeded
with meson.
-rw-r--r--pkgs/development/libraries/gtk+/3.x.nix57
-rw-r--r--pkgs/development/libraries/gtk+/gtk3-setup-hook.sh10
2 files changed, 43 insertions, 24 deletions
diff --git a/pkgs/development/libraries/gtk+/3.x.nix b/pkgs/development/libraries/gtk+/3.x.nix
index 52d792b966b..d2e6a6bb15e 100644
--- a/pkgs/development/libraries/gtk+/3.x.nix
+++ b/pkgs/development/libraries/gtk+/3.x.nix
@@ -3,7 +3,9 @@
 , fetchpatch
 , pkgconfig
 , gettext
-, perl
+, meson
+, ninja
+, python3
 , makeWrapper
 , shared-mime-info
 , isocodes
@@ -22,7 +24,7 @@
 , libxkbcommon
 , gmp
 , gnome3
-, autoreconfHook
+, hicolor-icon-theme
 , gsettings-desktop-schemas
 , x11Support ? stdenv.isLinux
 , waylandSupport ? stdenv.isLinux
@@ -42,14 +44,16 @@ with stdenv.lib;
 
 stdenv.mkDerivation rec {
   pname = "gtk+3";
-  version = "3.24.8";
+  version = "3.24.10";
 
   outputs = [ "out" "dev" ];
   outputBin = "dev";
 
+  setupHook = ./gtk3-setup-hook.sh;
+
   src = fetchurl {
     url = "mirror://gnome/sources/gtk+/${stdenv.lib.versions.majorMinor version}/gtk+-${version}.tar.xz";
-    sha256 = "16f71bbkhwhndcsrpyhjia3b77cb5ksf5c45lyfgws4pkgg64sb6";
+    sha256 = "00qvq1r96ikdalv7xzgng1kad9i0rcahqk01gwhxl3xrw83z3a1m";
   };
 
   patches = [
@@ -66,13 +70,36 @@ stdenv.mkDerivation rec {
     ./3.0-darwin-x11.patch
   ];
 
+  mesonFlags = [
+    "-Dtests=false"
+  ];
+
+  postPatch = ''
+    files=(
+      build-aux/meson/post-install.py
+      demos/gtk-demo/geninclude.py
+      gdk/broadway/gen-c-array.py
+      gdk/gen-gdk-gresources-xml.py
+      gtk/cursor/dnd-copy.png
+      gtk/gen-gtk-gresources-xml.py
+      gtk/gen-rc.py
+      gtk/gentypefuncs.py
+    )
+
+    chmod +x ''${files[@]}
+    patchShebangs ''${files[@]}
+  '';
+
   nativeBuildInputs = [
-    autoreconfHook
     gettext
     gobject-introspection
+    hicolor-icon-theme # setup-hook
     makeWrapper
-    perl
+    meson
+    ninja
     pkgconfig
+    python3
+    setupHook
   ];
 
   buildInputs = [
@@ -109,27 +136,9 @@ stdenv.mkDerivation rec {
   ;
   #TODO: colord?
 
-  ## (2019-06-12) Demos seem to install fine now. Keeping this around in case it fails again.
-  ## (2014-03-27) demos fail to install, no idea where's the problem
-  #preConfigure = "sed '/^SRC_SUBDIRS /s/demos//' -i Makefile.in";
-
-  configureFlags = optional stdenv.isDarwin [
-    "--disable-debug"
-    "--disable-dependency-tracking"
-    "--disable-glibtest"
-  ] ++ optional (stdenv.isDarwin && !x11Support)
-    "--enable-quartz-backend"
-    ++ optional x11Support [
-    "--enable-x11-backend"
-  ] ++ optional waylandSupport [
-    "--enable-wayland-backend"
-  ];
-
   doCheck = false; # needs X11
 
   postInstall = optionalString (!stdenv.isDarwin) ''
-    substituteInPlace "$out/lib/gtk-3.0/3.0.0/printbackends/libprintbackend-cups.la" \
-      --replace '-L${gmp.dev}/lib' '-L${gmp.out}/lib'
     # The updater is needed for nixos env and it's tiny.
     moveToOutput bin/gtk-update-icon-cache "$out"
     # Launcher
diff --git a/pkgs/development/libraries/gtk+/gtk3-setup-hook.sh b/pkgs/development/libraries/gtk+/gtk3-setup-hook.sh
new file mode 100644
index 00000000000..bddeb2d25d5
--- /dev/null
+++ b/pkgs/development/libraries/gtk+/gtk3-setup-hook.sh
@@ -0,0 +1,10 @@
+fixupOutputHooks+=(_gtk3CleanComments)
+
+# Clean comments that link to generator of the file
+_gtk3CleanComments() {
+    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
+}
+