From 2c85888a04986a25d18f7e1b1fb2a0f498e61ce8 Mon Sep 17 00:00:00 2001 From: Michael Raskin <7c6f434c@mail.ru> Date: Fri, 12 Dec 2014 21:33:23 +0300 Subject: [PATCH] Fix Firefox wrapper set-as-default functionality --- .../networking/browsers/firefox/wrapper.nix | 18 ++++++++++++++++-- pkgs/top-level/all-packages.nix | 1 + 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/networking/browsers/firefox/wrapper.nix b/pkgs/applications/networking/browsers/firefox/wrapper.nix index eba0deb627e4..330bf6def59e 100644 --- a/pkgs/applications/networking/browsers/firefox/wrapper.nix +++ b/pkgs/applications/networking/browsers/firefox/wrapper.nix @@ -1,5 +1,5 @@ { stdenv, lib, browser, makeDesktopItem, makeWrapper, plugins, gst_plugins, libs, gtk_modules -, browserName, desktopName, nameSuffix, icon +, browserName, desktopName, nameSuffix, icon, libtrick ? true }: let p = builtins.parseDrvName browser.name; in @@ -33,7 +33,21 @@ stdenv.mkDerivation { --suffix-each GTK_PATH ':' "$gtk_modules" \ --suffix-each LD_PRELOAD ':' "$(cat $(filterExisting $(addSuffix /extra-ld-preload $plugins)))" \ --prefix GST_PLUGIN_SYSTEM_PATH : "$GST_PLUGIN_SYSTEM_PATH" \ - --prefix-contents PATH ':' "$(filterExisting $(addSuffix /extra-bin-path $plugins))" + --prefix-contents PATH ':' "$(filterExisting $(addSuffix /extra-bin-path $plugins))" \ + --set MOZ_OBJDIR "$(ls -d "${browser}/lib/${browserName}*")" + + ${ lib.optionalString libtrick + '' + sed -e "s@exec @exec -a '$out/bin/${browserName}${nameSuffix}' @" -i "$out/bin/${browserName}${nameSuffix}" + libdirname="$(echo "${browser}/lib/${browserName}"*)" + libdirbasename="$(basename "$libdirname")" + mkdir -p "$out/lib/$libdirbasename" + ln -s "$libdirname"/* "$out/lib/$libdirbasename" + script_location="$(mktemp "$out/lib/$libdirbasename/${browserName}${nameSuffix}.XXXXXX")" + mv "$out/bin/${browserName}${nameSuffix}" "$script_location" + ln -s "$script_location" "$out/bin/${browserName}${nameSuffix}" + '' + } mkdir -p $out/share/applications cp $desktopItem/share/applications/* $out/share/applications diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index f5fff1592ae4..42de5f122426 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -11172,6 +11172,7 @@ let in import ../applications/networking/browsers/firefox/wrapper.nix { inherit stdenv lib makeWrapper makeDesktopItem browser browserName desktopName nameSuffix icon; + libtrick = true; plugins = assert !(enableGnash && enableAdobeFlash); assert !(jre && icedtea);