2018-02-23 04:11:30 +00:00
|
|
|
{ lib, stdenv, fetchurl, config, wrapGAppsHook
|
2014-06-23 14:03:11 +01:00
|
|
|
, alsaLib
|
|
|
|
, atk
|
|
|
|
, cairo
|
2016-09-15 16:39:08 +01:00
|
|
|
, curl
|
2014-06-23 14:03:11 +01:00
|
|
|
, cups
|
2018-02-25 02:23:58 +00:00
|
|
|
, dbus-glib
|
2014-06-23 14:03:11 +01:00
|
|
|
, dbus_libs
|
|
|
|
, fontconfig
|
|
|
|
, freetype
|
|
|
|
, gconf
|
|
|
|
, gdk_pixbuf
|
|
|
|
, glib
|
|
|
|
, glibc
|
2016-05-04 01:29:45 +01:00
|
|
|
, gtk2
|
|
|
|
, gtk3
|
2017-09-27 14:30:29 +01:00
|
|
|
, kerberos
|
2014-06-23 14:03:11 +01:00
|
|
|
, libX11
|
|
|
|
, libXScrnSaver
|
2016-08-15 00:03:19 +01:00
|
|
|
, libxcb
|
2014-10-12 14:57:43 +01:00
|
|
|
, libXcomposite
|
|
|
|
, libXdamage
|
2014-06-23 14:03:11 +01:00
|
|
|
, libXext
|
2014-10-12 14:57:43 +01:00
|
|
|
, libXfixes
|
2014-06-23 14:03:11 +01:00
|
|
|
, libXinerama
|
|
|
|
, libXrender
|
|
|
|
, libXt
|
2018-02-25 02:23:58 +00:00
|
|
|
, libcanberra-gtk2
|
2014-06-23 14:03:11 +01:00
|
|
|
, libgnome
|
|
|
|
, libgnomeui
|
2018-05-07 00:17:16 +01:00
|
|
|
, libnotify
|
2016-05-04 01:29:45 +01:00
|
|
|
, defaultIconTheme
|
2018-02-24 13:12:44 +00:00
|
|
|
, libGLU_combined
|
2014-06-23 14:03:11 +01:00
|
|
|
, nspr
|
|
|
|
, nss
|
|
|
|
, pango
|
2015-06-27 01:22:58 +01:00
|
|
|
, libheimdal
|
2015-05-27 20:42:15 +01:00
|
|
|
, libpulseaudio
|
2014-06-23 14:03:11 +01:00
|
|
|
, systemd
|
2017-06-08 14:33:24 +01:00
|
|
|
, channel
|
|
|
|
, generated
|
2016-12-01 17:58:16 +00:00
|
|
|
, writeScript
|
|
|
|
, xidel
|
|
|
|
, coreutils
|
|
|
|
, gnused
|
|
|
|
, gnugrep
|
2017-02-19 18:33:31 +00:00
|
|
|
, gnupg
|
2014-06-23 14:03:11 +01:00
|
|
|
}:
|
|
|
|
|
2014-10-12 14:57:43 +01:00
|
|
|
let
|
2016-05-15 01:59:07 +01:00
|
|
|
|
|
|
|
inherit (generated) version sources;
|
|
|
|
|
2017-11-05 16:09:41 +00:00
|
|
|
mozillaPlatforms = {
|
|
|
|
"i686-linux" = "linux-i686";
|
|
|
|
"x86_64-linux" = "linux-x86_64";
|
|
|
|
};
|
|
|
|
|
|
|
|
arch = mozillaPlatforms.${stdenv.system};
|
2014-06-23 14:03:11 +01:00
|
|
|
|
|
|
|
isPrefixOf = prefix: string:
|
|
|
|
builtins.substring 0 (builtins.stringLength prefix) string == prefix;
|
|
|
|
|
|
|
|
sourceMatches = locale: source:
|
|
|
|
(isPrefixOf source.locale locale) && source.arch == arch;
|
|
|
|
|
|
|
|
systemLocale = config.i18n.defaultLocale or "en-US";
|
|
|
|
|
|
|
|
defaultSource = stdenv.lib.findFirst (sourceMatches "en-US") {} sources;
|
|
|
|
|
|
|
|
source = stdenv.lib.findFirst (sourceMatches systemLocale) defaultSource sources;
|
|
|
|
|
2017-06-08 14:33:24 +01:00
|
|
|
name = "firefox-${channel}-bin-unwrapped-${version}";
|
2016-12-01 17:58:16 +00:00
|
|
|
|
2014-06-23 14:03:11 +01:00
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
2016-12-01 17:58:16 +00:00
|
|
|
inherit name;
|
2014-06-23 14:03:11 +01:00
|
|
|
|
2016-07-16 12:04:04 +01:00
|
|
|
src = fetchurl { inherit (source) url sha512; };
|
2014-06-23 14:03:11 +01:00
|
|
|
|
2017-04-23 14:34:24 +01:00
|
|
|
phases = [ "unpackPhase" "installPhase" "fixupPhase" ];
|
2014-06-23 14:03:11 +01:00
|
|
|
|
|
|
|
libPath = stdenv.lib.makeLibraryPath
|
2015-01-15 04:25:26 +00:00
|
|
|
[ stdenv.cc.cc
|
2014-06-23 14:03:11 +01:00
|
|
|
alsaLib
|
2018-02-23 04:11:30 +00:00
|
|
|
(lib.getDev alsaLib)
|
2014-06-23 14:03:11 +01:00
|
|
|
atk
|
|
|
|
cairo
|
2016-09-15 16:39:08 +01:00
|
|
|
curl
|
2014-06-23 14:03:11 +01:00
|
|
|
cups
|
2018-02-25 02:23:58 +00:00
|
|
|
dbus-glib
|
2014-06-23 14:03:11 +01:00
|
|
|
dbus_libs
|
|
|
|
fontconfig
|
|
|
|
freetype
|
|
|
|
gconf
|
|
|
|
gdk_pixbuf
|
|
|
|
glib
|
|
|
|
glibc
|
2016-05-04 01:29:45 +01:00
|
|
|
gtk2
|
|
|
|
gtk3
|
2017-09-27 14:30:29 +01:00
|
|
|
kerberos
|
2014-06-23 14:03:11 +01:00
|
|
|
libX11
|
|
|
|
libXScrnSaver
|
2014-10-12 14:57:43 +01:00
|
|
|
libXcomposite
|
2016-08-15 00:03:19 +01:00
|
|
|
libxcb
|
2014-10-12 14:57:43 +01:00
|
|
|
libXdamage
|
2014-06-23 14:03:11 +01:00
|
|
|
libXext
|
2014-10-12 14:57:43 +01:00
|
|
|
libXfixes
|
2014-06-23 14:03:11 +01:00
|
|
|
libXinerama
|
|
|
|
libXrender
|
|
|
|
libXt
|
2018-02-25 02:23:58 +00:00
|
|
|
libcanberra-gtk2
|
2014-06-23 14:03:11 +01:00
|
|
|
libgnome
|
|
|
|
libgnomeui
|
2018-05-07 00:17:16 +01:00
|
|
|
libnotify
|
2018-02-24 13:12:44 +00:00
|
|
|
libGLU_combined
|
2014-06-23 14:03:11 +01:00
|
|
|
nspr
|
|
|
|
nss
|
|
|
|
pango
|
2015-06-27 01:22:58 +01:00
|
|
|
libheimdal
|
2016-08-03 18:39:46 +01:00
|
|
|
libpulseaudio
|
2018-02-23 04:11:30 +00:00
|
|
|
(lib.getDev libpulseaudio)
|
2014-06-23 14:03:11 +01:00
|
|
|
systemd
|
2016-04-14 16:14:28 +01:00
|
|
|
] + ":" + stdenv.lib.makeSearchPathOutput "lib" "lib64" [
|
2015-01-15 04:25:26 +00:00
|
|
|
stdenv.cc.cc
|
2014-06-23 14:03:11 +01:00
|
|
|
];
|
|
|
|
|
2017-06-08 14:33:24 +01:00
|
|
|
inherit gtk3;
|
|
|
|
|
2017-04-23 14:34:24 +01:00
|
|
|
buildInputs = [ wrapGAppsHook gtk3 defaultIconTheme ];
|
2016-05-04 01:29:45 +01:00
|
|
|
|
2014-06-23 14:03:11 +01:00
|
|
|
# "strip" after "patchelf" may break binaries.
|
|
|
|
# See: https://github.com/NixOS/patchelf/issues/10
|
2017-04-23 14:34:24 +01:00
|
|
|
dontStrip = true;
|
|
|
|
dontPatchELF = true;
|
2014-06-23 14:03:11 +01:00
|
|
|
|
2017-06-08 14:33:24 +01:00
|
|
|
patchPhase = ''
|
|
|
|
sed -i -e '/^pref("app.update.channel",/d' defaults/pref/channel-prefs.js
|
|
|
|
echo 'pref("app.update.channel", "non-existing-channel")' >> defaults/pref/channel-prefs.js
|
|
|
|
'';
|
|
|
|
|
2014-06-23 14:03:11 +01:00
|
|
|
installPhase =
|
|
|
|
''
|
|
|
|
mkdir -p "$prefix/usr/lib/firefox-bin-${version}"
|
|
|
|
cp -r * "$prefix/usr/lib/firefox-bin-${version}"
|
|
|
|
|
|
|
|
mkdir -p "$out/bin"
|
|
|
|
ln -s "$prefix/usr/lib/firefox-bin-${version}/firefox" "$out/bin/"
|
|
|
|
|
|
|
|
for executable in \
|
2015-02-25 13:35:36 +00:00
|
|
|
firefox firefox-bin plugin-container \
|
2014-06-23 14:03:11 +01:00
|
|
|
updater crashreporter webapprt-stub
|
|
|
|
do
|
2016-05-15 01:59:07 +01:00
|
|
|
if [ -e "$out/usr/lib/firefox-bin-${version}/$executable" ]; then
|
|
|
|
patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
|
|
|
"$out/usr/lib/firefox-bin-${version}/$executable"
|
|
|
|
fi
|
2014-06-23 14:03:11 +01:00
|
|
|
done
|
|
|
|
|
2015-08-18 12:35:10 +01:00
|
|
|
find . -executable -type f -exec \
|
2014-06-23 14:03:11 +01:00
|
|
|
patchelf --set-rpath "$libPath" \
|
2015-08-18 12:35:10 +01:00
|
|
|
"$out/usr/lib/firefox-bin-${version}/{}" \;
|
2014-06-23 14:03:11 +01:00
|
|
|
|
2016-05-08 09:06:08 +01:00
|
|
|
# wrapFirefox expects "$out/lib" instead of "$out/usr/lib"
|
|
|
|
ln -s "$out/usr/lib" "$out/lib"
|
|
|
|
|
2017-04-23 14:34:24 +01:00
|
|
|
gappsWrapperArgs+=(--argv0 "$out/bin/.firefox-wrapped")
|
2014-06-23 14:03:11 +01:00
|
|
|
'';
|
|
|
|
|
2016-05-18 22:07:49 +01:00
|
|
|
passthru.ffmpegSupport = true;
|
2017-09-27 14:30:29 +01:00
|
|
|
passthru.gssSupport = true;
|
2018-04-16 11:37:31 +01:00
|
|
|
# update with:
|
|
|
|
# $ nix-shell maintainers/scripts/update.nix --argstr package firefox-bin-unwrapped
|
2016-12-16 15:34:25 +00:00
|
|
|
passthru.updateScript = import ./update.nix {
|
2017-06-08 14:33:24 +01:00
|
|
|
inherit name channel writeScript xidel coreutils gnused gnugrep gnupg curl;
|
2017-06-15 19:28:02 +01:00
|
|
|
baseUrl =
|
|
|
|
if channel == "devedition"
|
|
|
|
then "http://archive.mozilla.org/pub/devedition/releases/"
|
|
|
|
else "http://archive.mozilla.org/pub/firefox/releases/";
|
2016-12-16 15:34:25 +00:00
|
|
|
};
|
2014-06-23 14:03:11 +01:00
|
|
|
meta = with stdenv.lib; {
|
2014-11-25 15:28:55 +00:00
|
|
|
description = "Mozilla Firefox, free web browser (binary package)";
|
2014-06-23 14:03:11 +01:00
|
|
|
homepage = http://www.mozilla.org/firefox/;
|
|
|
|
license = {
|
2014-11-25 15:28:55 +00:00
|
|
|
free = false;
|
2014-06-23 14:03:11 +01:00
|
|
|
url = http://www.mozilla.org/en-US/foundation/trademarks/policy/;
|
|
|
|
};
|
2017-11-05 16:09:41 +00:00
|
|
|
platforms = builtins.attrNames mozillaPlatforms;
|
2016-05-15 22:22:50 +01:00
|
|
|
maintainers = with maintainers; [ garbas ];
|
2014-06-23 14:03:11 +01:00
|
|
|
};
|
|
|
|
}
|