[MacPorts] #45354: gdk-pixbuf2 @2.31.1 Hidden dependency on shared-mime-info
MacPorts
noreply at macports.org
Tue Oct 14 21:07:03 PDT 2014
#45354: gdk-pixbuf2 @2.31.1 Hidden dependency on shared-mime-info
--------------------------+----------------------
Reporter: bgilbert@… | Owner: devans@…
Type: defect | Status: assigned
Priority: Normal | Milestone:
Component: ports | Version:
Resolution: | Keywords:
Port: gdk-pixbuf2 |
--------------------------+----------------------
Comment (by bgilbert@…):
It turns out that `shared-mime-info` doesn't delete its cache files when
it is uninstalled (filed as #45396), so removing it is not enough to get
your system back to a pristine state. That explains why GIO content
sniffing is enabled during gdk-pixbuf builds: the builders have had
`shared-mime-info` installed ''at some point in the past''.
Here's a session demonstrating the problem:
{{{
$ port installed gdk-pixbuf2 shared-mime-info
The following ports are currently installed:
gdk-pixbuf2 @2.31.1_0+x11 (active)
shared-mime-info @1.3_0 (active)
$ wget -q https://www.macports.org/img/macports-logo-top.png
$ cat gdk-pixbuf-open.c
#include <stdio.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
int main(int argc, char **argv) {
GError *err = NULL;
GdkPixbuf *pixbuf = gdk_pixbuf_new_from_file(argv[1], &err);
if (pixbuf == NULL) {
fprintf(stderr, "Failed: %s\n", err->message);
} else {
printf("OK\n");
}
return 0;
}
$ gcc -o gdk-pixbuf-open $(pkg-config --cflags --libs glib-2.0 gdk-
pixbuf-2.0) gdk-pixbuf-open.c
$ ./gdk-pixbuf-open macports-logo-top.png
OK
$ sudo port uninstall shared-mime-info
---> Deactivating shared-mime-info @1.3_0
---> Cleaning shared-mime-info
---> Uninstalling shared-mime-info @1.3_0
---> Cleaning shared-mime-info
$ ./gdk-pixbuf-open macports-logo-top.png
OK
$ ls -d /opt/local/share/mime/* | grep -v packages | sudo xargs rm -r
$ ./gdk-pixbuf-open macports-logo-top.png
Failed: Couldn't recognize the image file format for file 'macports-logo-
top.png'
$ sudo port install shared-mime-info
---> Computing dependencies for shared-mime-info
---> Fetching archive for shared-mime-info
---> Attempting to fetch shared-mime-info-1.3_0.darwin_13.x86_64.tbz2
from http://packages.macports.org/shared-mime-info
---> Attempting to fetch shared-mime-
info-1.3_0.darwin_13.x86_64.tbz2.rmd160 from http://packages.macports.org
/shared-mime-info
---> Installing shared-mime-info @1.3_0
---> Activating shared-mime-info @1.3_0
---> Cleaning shared-mime-info
---> Updating database of binaries
---> Scanning binaries for linking errors
---> No broken files found.
$ ./gdk-pixbuf-open macports-logo-top.png
OK
}}}
To summarize: GIO content sniffing is implicitly enabled in `gdk-pixbuf2`
builds due to #45396, but doesn't actually return a useful result unless
`shared-mime-info` (or its leftover cache files) is installed. Neither
the `gdk-pixbuf2` nor `glib2` packages depend on `shared-mime-info`. As a
result, a minimal install of `gdk-pixbuf2` refuses to load any images.
--
Ticket URL: <https://trac.macports.org/ticket/45354#comment:5>
MacPorts <http://www.macports.org/>
Ports system for OS X
More information about the macports-tickets
mailing list