about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/gtk/hooks/gtk3-clean-immodules-cache.sh
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/gtk/hooks/gtk3-clean-immodules-cache.sh')
-rw-r--r--nixpkgs/pkgs/development/libraries/gtk/hooks/gtk3-clean-immodules-cache.sh11
1 files changed, 11 insertions, 0 deletions
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
new file mode 100644
index 000000000000..d2d5287831a0
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gtk/hooks/gtk3-clean-immodules-cache.sh
@@ -0,0 +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"
+    if [ -f "$f" ]; then
+        sed 's|Created by .*bin/gtk-query-|Created by bin/gtk-query-|' -i "$f"
+    fi
+}