about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/gtk/hooks
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2021-04-09 18:28:16 +0000
committerAlyssa Ross <hi@alyssa.is>2021-04-12 18:46:15 +0000
commitfd2e737e0678ee7d8081baef05b305146a2c0034 (patch)
treeac3e9b27576a0382335532d126f9a66d486bc638 /nixpkgs/pkgs/development/libraries/gtk/hooks
parentcc207d720b6aa836e256c1ee9842bc739e630a8a (diff)
parent9e377a6ce42dccd9b624ae4ce8f978dc892ba0e2 (diff)
downloadnixlib-fd2e737e0678ee7d8081baef05b305146a2c0034.tar
nixlib-fd2e737e0678ee7d8081baef05b305146a2c0034.tar.gz
nixlib-fd2e737e0678ee7d8081baef05b305146a2c0034.tar.bz2
nixlib-fd2e737e0678ee7d8081baef05b305146a2c0034.tar.lz
nixlib-fd2e737e0678ee7d8081baef05b305146a2c0034.tar.xz
nixlib-fd2e737e0678ee7d8081baef05b305146a2c0034.tar.zst
nixlib-fd2e737e0678ee7d8081baef05b305146a2c0034.zip
Merge remote-tracking branch 'nixpkgs/nixos-unstable'
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/gtk/hooks')
-rw-r--r--nixpkgs/pkgs/development/libraries/gtk/hooks/clean-immodules-cache.sh15
-rw-r--r--nixpkgs/pkgs/development/libraries/gtk/hooks/gtk2-clean-immodules-cache.sh12
-rw-r--r--nixpkgs/pkgs/development/libraries/gtk/hooks/gtk3-clean-immodules-cache.sh11
-rw-r--r--nixpkgs/pkgs/development/libraries/gtk/hooks/gtk4-clean-immodules-cache.sh11
4 files changed, 15 insertions, 34 deletions
diff --git a/nixpkgs/pkgs/development/libraries/gtk/hooks/clean-immodules-cache.sh b/nixpkgs/pkgs/development/libraries/gtk/hooks/clean-immodules-cache.sh
new file mode 100644
index 000000000000..0868a4a39101
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gtk/hooks/clean-immodules-cache.sh
@@ -0,0 +1,15 @@
+# shellcheck shell=bash
+
+fixupOutputHooks+=(_gtkCleanImmodulesCache)
+
+# Clean comments that link to generator of the file
+_gtkCleanImmodulesCache() {
+    # gtk_module_path is where the modules are installed
+    # https://gitlab.gnome.org/GNOME/gtk/-/blob/3.24.24/gtk/gtkmodules.c#L68
+    # gtk_binary_version can be retrived with:
+    # pkg-config --variable=gtk_binary_version gtk+-3.0
+    local f="${prefix:?}/lib/@gtk_module_path@/@gtk_binary_version@/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/hooks/gtk2-clean-immodules-cache.sh b/nixpkgs/pkgs/development/libraries/gtk/hooks/gtk2-clean-immodules-cache.sh
deleted file mode 100644
index dde991fd27cd..000000000000
--- a/nixpkgs/pkgs/development/libraries/gtk/hooks/gtk2-clean-immodules-cache.sh
+++ /dev/null
@@ -1,12 +0,0 @@
-# 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"
-    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/hooks/gtk3-clean-immodules-cache.sh b/nixpkgs/pkgs/development/libraries/gtk/hooks/gtk3-clean-immodules-cache.sh
deleted file mode 100644
index d2d5287831a0..000000000000
--- a/nixpkgs/pkgs/development/libraries/gtk/hooks/gtk3-clean-immodules-cache.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-# 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"
-    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/hooks/gtk4-clean-immodules-cache.sh b/nixpkgs/pkgs/development/libraries/gtk/hooks/gtk4-clean-immodules-cache.sh
deleted file mode 100644
index 49f7051aabb6..000000000000
--- a/nixpkgs/pkgs/development/libraries/gtk/hooks/gtk4-clean-immodules-cache.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-# shellcheck shell=bash
-
-fixupOutputHooks+=(_gtk4CleanComments)
-
-# Clean comments that link to generator of the file
-_gtk4CleanComments() {
-    local f="${prefix:?}/lib/gtk-4.0/4.0.0/immodules.cache"
-    if [ -f "$f" ]; then
-        sed 's|Created by .*bin/gtk-query-|Created by bin/gtk-query-|' -i "$f"
-    fi
-}