aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias C. Berner <tcberner@FreeBSD.org>2022-03-26 07:05:20 +0000
committerTobias C. Berner <tcberner@FreeBSD.org>2022-03-27 13:21:30 +0000
commitbd08b1edde618be0d9644299561b696a507a446f (patch)
treec3dbd07088c901eedb645c7283564247a93f5eb2
parentf5269b1820b794f9d3256e9e1d9605f9e5cbc3f9 (diff)
downloadports-bd08b1edde618be0d9644299561b696a507a446f.tar.gz
ports-bd08b1edde618be0d9644299561b696a507a446f.zip
graphics/gdk-pixbuf2: add trigger to run gdk-pixbuf-query-loaders
gdk-pixbuf2 uses a cache of its loadable modules, which is updated by ${RREFIX}/bin/gdk-pixbuf-query-loaders and stored in ${PREFIX}/lib/gdk-pixbuf-2.0/${GTK2_VERSION}/loaders. Remove the pre-existing @exec and @postexec commands in the ports providing such modules, and add a trigger in graphics/gdk-pixbuf2 to do this automatically. Reviewed by: bapt Differential Revision: https://reviews.freebsd.org/D34679
-rw-r--r--Mk/bsd.port.mk2
-rw-r--r--graphics/gdk-pixbuf2/Makefile4
-rw-r--r--graphics/gdk-pixbuf2/files/gdk-pixbuf-query-loaders.ucl.in17
-rw-r--r--graphics/gdk-pixbuf2/pkg-plist2
-rw-r--r--graphics/libavif/pkg-plist2
-rw-r--r--graphics/libjxl/pkg-plist2
-rw-r--r--graphics/librsvg2-rust/pkg-plist2
-rw-r--r--graphics/librsvg2/pkg-plist2
-rw-r--r--graphics/webp-pixbuf-loader/pkg-plist2
9 files changed, 21 insertions, 14 deletions
diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk
index 58a03b2fb643..6710a7cee2df 100644
--- a/Mk/bsd.port.mk
+++ b/Mk/bsd.port.mk
@@ -1927,7 +1927,7 @@ _FORCE_POST_PATTERNS= rmdir kldxref mkfontscale mkfontdir fc-cache \
load-octave-pkg \
ocamlfind \
update-desktop-database update-mime-database \
- gdk-pixbuf-query-loaders catalog.ports \
+ catalog.ports \
ccache-update-links
.if defined(USE_LOCAL_MK)
diff --git a/graphics/gdk-pixbuf2/Makefile b/graphics/gdk-pixbuf2/Makefile
index 3804cb947246..17c1e597d833 100644
--- a/graphics/gdk-pixbuf2/Makefile
+++ b/graphics/gdk-pixbuf2/Makefile
@@ -17,11 +17,13 @@ LICENSE_FILE= ${WRKSRC}/COPYING
BUILD_DEPENDS= docbook-xsl>0:textproc/docbook-xsl
USES= cpe gettext gnome localbase:ldflags meson pkgconfig \
- python:3.4+,build shared-mime-info tar:xz
+ python:3.4+,build shared-mime-info tar:xz trigger
CPE_VENDOR= gnome
USE_GNOME= glib20 introspection:build libxslt:build
USE_LDCONFIG= yes
MESON_ARGS= -Dman=true
+TRIGGERS= gdk-pixbuf-query-loaders
+SUB_LIST= GTK2_VERSION=${GTK2_VERSION}
BINARY_ALIAS= python3=${PYTHON_VERSION}
diff --git a/graphics/gdk-pixbuf2/files/gdk-pixbuf-query-loaders.ucl.in b/graphics/gdk-pixbuf2/files/gdk-pixbuf-query-loaders.ucl.in
new file mode 100644
index 000000000000..814bf2d40b72
--- /dev/null
+++ b/graphics/gdk-pixbuf2/files/gdk-pixbuf-query-loaders.ucl.in
@@ -0,0 +1,17 @@
+path: "%%PREFIX%%/lib/gdk-pixbuf-2.0/%%GTK2_VERSION%%/loaders"
+cleanup: {
+ type: lua
+ sandbox: false
+ script: <<EOS
+print("Removing gdk-pixbuf cache directory")
+os.remove("%%PREFIX%%/lib/gdk-pixbuf-2.0/%%GTK2_VERSION%%/loaders")
+EOS
+}
+trigger: {
+ type: lua
+ sandbox: false
+ script: <<EOS
+print("Generating gdk-pixbuf modules cache")
+pkg.exec({"%%PREFIX%%/bin/gdk-pixbuf-query-loaders"})
+EOS
+}
diff --git a/graphics/gdk-pixbuf2/pkg-plist b/graphics/gdk-pixbuf2/pkg-plist
index 556d5d2d81d9..02446f6ee862 100644
--- a/graphics/gdk-pixbuf2/pkg-plist
+++ b/graphics/gdk-pixbuf2/pkg-plist
@@ -152,5 +152,3 @@ share/locale/zh_CN/LC_MESSAGES/gdk-pixbuf.mo
share/locale/zh_HK/LC_MESSAGES/gdk-pixbuf.mo
share/locale/zh_TW/LC_MESSAGES/gdk-pixbuf.mo
share/thumbnailers/gdk-pixbuf-thumbnailer.thumbnailer
-@postexec %D/bin/gdk-pixbuf-query-loaders > /dev/null 2>&1 && %D/bin/gdk-pixbuf-query-loaders > %D/lib/gdk-pixbuf-2.0/%%GTK2_VERSION%%/loaders.cache 2>/dev/null || /usr/bin/true
-@postunexec rm %D/lib/gdk-pixbuf-2.0/%%GTK2_VERSION%%/loaders.cache 2>&1 >/dev/null || true
diff --git a/graphics/libavif/pkg-plist b/graphics/libavif/pkg-plist
index 23c018ec1137..08f46c72a996 100644
--- a/graphics/libavif/pkg-plist
+++ b/graphics/libavif/pkg-plist
@@ -9,5 +9,3 @@ lib/libavif.so
lib/libavif.so.13
lib/libavif.so.13.0.0
libdata/pkgconfig/libavif.pc
-%%PIXBUF%%@postexec %D/bin/gdk-pixbuf-query-loaders > /dev/null 2>&1 && %D/bin/gdk-pixbuf-query-loaders > %D/lib/gdk-pixbuf-2.0/%%GTK2_VERSION%%/loaders.cache 2>/dev/null || /usr/bin/true
-%%PIXBUF%%@postunexec %D/bin/gdk-pixbuf-query-loaders > /dev/null 2>&1 && %D/bin/gdk-pixbuf-query-loaders > %D/lib/gdk-pixbuf-2.0/%%GTK2_VERSION%%/loaders.cache 2>/dev/null || /usr/bin/true
diff --git a/graphics/libjxl/pkg-plist b/graphics/libjxl/pkg-plist
index 77bfe896e4c8..91051800f600 100644
--- a/graphics/libjxl/pkg-plist
+++ b/graphics/libjxl/pkg-plist
@@ -33,5 +33,3 @@ libdata/pkgconfig/libjxl_threads.pc
%%MANPAGES%%share/man/man1/djxl.1.gz
share/mime/packages/image-jxl.xml
%%PIXBUF%%share/thumbnailers/jxl.thumbnailer
-%%PIXBUF%%@postexec %D/bin/gdk-pixbuf-query-loaders > /dev/null 2>&1 && %D/bin/gdk-pixbuf-query-loaders > %D/lib/gdk-pixbuf-2.0/%%GTK2_VERSION%%/loaders.cache 2>/dev/null || /usr/bin/true
-%%PIXBUF%%@postunexec %D/bin/gdk-pixbuf-query-loaders > /dev/null 2>&1 && %D/bin/gdk-pixbuf-query-loaders > %D/lib/gdk-pixbuf-2.0/%%GTK2_VERSION%%/loaders.cache 2>/dev/null || /usr/bin/true
diff --git a/graphics/librsvg2-rust/pkg-plist b/graphics/librsvg2-rust/pkg-plist
index eac007058524..e44127c344eb 100644
--- a/graphics/librsvg2-rust/pkg-plist
+++ b/graphics/librsvg2-rust/pkg-plist
@@ -131,5 +131,3 @@ man/man1/rsvg-convert.1.gz
share/gir-1.0/Rsvg-2.0.gir
share/thumbnailers/librsvg.thumbnailer
share/vala/vapi/librsvg-2.0.vapi
-@postexec %D/bin/gdk-pixbuf-query-loaders > /dev/null 2>&1 && %D/bin/gdk-pixbuf-query-loaders > %D/lib/gdk-pixbuf-2.0/%%GTK2_VERSION%%/loaders.cache 2>/dev/null || /usr/bin/true
-@postunexec %D/bin/gdk-pixbuf-query-loaders > /dev/null 2>&1 && %D/bin/gdk-pixbuf-query-loaders > %D/lib/gdk-pixbuf-2.0/%%GTK2_VERSION%%/loaders.cache 2>/dev/null || /usr/bin/true
diff --git a/graphics/librsvg2/pkg-plist b/graphics/librsvg2/pkg-plist
index 07d52269c0e0..d5d4006c0c14 100644
--- a/graphics/librsvg2/pkg-plist
+++ b/graphics/librsvg2/pkg-plist
@@ -35,5 +35,3 @@ man/man1/rsvg-convert.1.gz
share/gir-1.0/Rsvg-2.0.gir
share/thumbnailers/librsvg.thumbnailer
%%VAPI%%share/vala/vapi/librsvg-2.0.vapi
-@postexec %D/bin/gdk-pixbuf-query-loaders > /dev/null 2>&1 && %D/bin/gdk-pixbuf-query-loaders > %D/lib/gdk-pixbuf-2.0/%%GTK2_VERSION%%/loaders.cache 2>/dev/null || /usr/bin/true
-@postunexec %D/bin/gdk-pixbuf-query-loaders > /dev/null 2>&1 && %D/bin/gdk-pixbuf-query-loaders > %D/lib/gdk-pixbuf-2.0/%%GTK2_VERSION%%/loaders.cache 2>/dev/null || /usr/bin/true
diff --git a/graphics/webp-pixbuf-loader/pkg-plist b/graphics/webp-pixbuf-loader/pkg-plist
index 42b7ba98ad0b..8f9f1875cd6a 100644
--- a/graphics/webp-pixbuf-loader/pkg-plist
+++ b/graphics/webp-pixbuf-loader/pkg-plist
@@ -1,4 +1,2 @@
lib/gdk-pixbuf-2.0/%%GTK2_VERSION%%/loaders/libpixbufloader-webp.so
share/thumbnailers/webp-pixbuf.thumbnailer
-@postexec %D/bin/gdk-pixbuf-query-loaders > /dev/null 2>&1 && %D/bin/gdk-pixbuf-query-loaders > %D/lib/gdk-pixbuf-2.0/%%GTK2_VERSION%%/loaders.cache 2>/dev/null || /usr/bin/true
-@postunexec %D/bin/gdk-pixbuf-query-loaders > /dev/null 2>&1 && %D/bin/gdk-pixbuf-query-loaders > %D/lib/gdk-pixbuf-2.0/%%GTK2_VERSION%%/loaders.cache 2>/dev/null || /usr/bin/true