From 69be72a64aa7ee9a9ce9c50429bbac8a64ca250d Mon Sep 17 00:00:00 2001 From: worldofpeace Date: Fri, 8 Feb 2019 19:26:54 -0500 Subject: [PATCH] desktop-files-utils: add setupHook to remove mimeinfo.cache Post-Installation scripts are running `update-desktop-database -q` creating these files which obviously results in a lot of collisions. Much better solution than eventually noticing their existence and removing them in postInstall. --- pkgs/applications/misc/font-manager/default.nix | 4 ---- pkgs/development/tools/profiling/sysprof/default.nix | 4 ---- pkgs/tools/misc/desktop-file-utils/default.nix | 2 ++ pkgs/tools/misc/desktop-file-utils/setup-hook.sh | 6 ++++++ 4 files changed, 8 insertions(+), 8 deletions(-) create mode 100644 pkgs/tools/misc/desktop-file-utils/setup-hook.sh diff --git a/pkgs/applications/misc/font-manager/default.nix b/pkgs/applications/misc/font-manager/default.nix index ee8766f766f1..bf97cff5030d 100644 --- a/pkgs/applications/misc/font-manager/default.nix +++ b/pkgs/applications/misc/font-manager/default.nix @@ -49,10 +49,6 @@ stdenv.mkDerivation rec { patchShebangs meson_post_install.py ''; - postInstall = '' - rm $out/share/applications/mimeinfo.cache - ''; - meta = { homepage = https://fontmanager.github.io/; description = "Simple font management for GTK+ desktop environments"; diff --git a/pkgs/development/tools/profiling/sysprof/default.nix b/pkgs/development/tools/profiling/sysprof/default.nix index 3945af2794d5..8cd6a3f09eef 100644 --- a/pkgs/development/tools/profiling/sysprof/default.nix +++ b/pkgs/development/tools/profiling/sysprof/default.nix @@ -46,10 +46,6 @@ in stdenv.mkDerivation rec { "-Dsystemdunitdir=lib/systemd/system" ]; - postInstall = '' - rm $out/share/applications/mimeinfo.cache - ''; - passthru = { updateScript = gnome3.updateScript { packageName = pname; diff --git a/pkgs/tools/misc/desktop-file-utils/default.nix b/pkgs/tools/misc/desktop-file-utils/default.nix index 8dc590c5d6fc..3e47ebd51d74 100644 --- a/pkgs/tools/misc/desktop-file-utils/default.nix +++ b/pkgs/tools/misc/desktop-file-utils/default.nix @@ -21,6 +21,8 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ pkgconfig ]; buildInputs = [ glib libintl ]; + setupHook = ./setup-hook.sh; + meta = { homepage = http://www.freedesktop.org/wiki/Software/desktop-file-utils; description = "Command line utilities for working with .desktop files"; diff --git a/pkgs/tools/misc/desktop-file-utils/setup-hook.sh b/pkgs/tools/misc/desktop-file-utils/setup-hook.sh new file mode 100644 index 000000000000..004d635cff0e --- /dev/null +++ b/pkgs/tools/misc/desktop-file-utils/setup-hook.sh @@ -0,0 +1,6 @@ +# Remove mimeinfo cache +mimeinfoPreFixupPhase() { + rm -f $out/share/applications/mimeinfo.cache +} + +preFixupPhases="$preFixupPhases mimeinfoPreFixupPhase"