1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-17 19:21:04 +00:00

xdg-utils: Ensure xdg-mime can find shared-mime-info

Issue discovered when testing #251474, `xdg-mime` can't find the mimeinfo DB:

	❯ nix-shell --pure -I nixpkgs=. -p xdg-utils
	$ xdg-mime query filetype /dev/stdin < some/picture.png
	WARNING: You don't seem to have a mime-info database. The shared-mime-info package is available from http://freedesktop.org/ at /nix/store/jvkvicdw2hwl40gl52kakz4yi59lwpkh-perl5.38.2-File-MimeInfo-0.33/bin/mimetype line 175.
	No mimeinfo database found
This commit is contained in:
nicoo 2024-05-01 17:52:02 +00:00
parent 211cb102a2
commit 57775b3ffe

View file

@ -3,6 +3,7 @@
, libxslt, docbook_xml_dtd_412, docbook_xml_dtd_43, docbook_xsl, xmlto
# runtime deps
, resholve, bash, coreutils, dbus, file, gawk, glib, gnugrep, gnused, jq, nettools, procmail, procps, which, xdg-user-dirs
, shared-mime-info
, perl, perlPackages
, mimiSupport ? false
, withXdgOpenUsePortalPatch ? true }:
@ -121,6 +122,7 @@ let
"$KTRADER" = true;
};
prologue = "${writeText "xdg-mime-prologue" ''
export XDG_DATA_DIRS="$XDG_DATA_DIRS''${XDG_DATA_DIRS:+:}${shared-mime-info}/share"
export PERL5LIB=${with perlPackages; makePerlPath [ FileMimeInfo ]}
export PATH=$PATH:${lib.makeBinPath [ coreutils perlPackages.FileMimeInfo ]}
''}";