2018-10-01 01:00:00 +01:00
|
|
|
{ pname, ffversion, meta, updateScript ? null
|
|
|
|
, src, unpackPhase ? null, patches ? []
|
|
|
|
, extraNativeBuildInputs ? [], extraConfigureFlags ? [], extraMakeFlags ? []
|
2019-01-01 00:00:00 +00:00
|
|
|
, isIceCatLike ? false, icversion ? null
|
2018-10-01 01:00:00 +01:00
|
|
|
, isTorBrowserLike ? false, tbversion ? null }:
|
2017-03-27 13:33:00 +01:00
|
|
|
|
2018-06-29 19:55:43 +01:00
|
|
|
{ lib, stdenv, pkgconfig, pango, perl, python2, zip, libIDL
|
2018-02-25 02:23:58 +00:00
|
|
|
, libjpeg, zlib, dbus, dbus-glib, bzip2, xorg
|
2017-03-27 13:33:00 +01:00
|
|
|
, freetype, fontconfig, file, nspr, nss, libnotify
|
2018-02-24 13:12:44 +00:00
|
|
|
, yasm, libGLU_combined, sqlite, unzip, makeWrapper
|
2013-06-11 10:52:15 +01:00
|
|
|
, hunspell, libevent, libstartup_notification, libvpx
|
2018-07-21 01:44:44 +01:00
|
|
|
, icu, libpng, jemalloc, glib
|
2017-09-28 01:13:15 +01:00
|
|
|
, autoconf213, which, gnused, cargo, rustc, llvmPackages
|
2019-03-01 08:22:32 +00:00
|
|
|
, rust-cbindgen, nodejs, nasm
|
2013-10-06 05:07:42 +01:00
|
|
|
, debugBuild ? false
|
2017-03-27 13:33:00 +01:00
|
|
|
|
|
|
|
### optionals
|
|
|
|
|
2017-03-27 13:35:34 +01:00
|
|
|
## optional libraries
|
|
|
|
|
2018-07-10 23:10:04 +01:00
|
|
|
, alsaSupport ? stdenv.isLinux, alsaLib
|
2018-11-07 09:07:40 +00:00
|
|
|
, pulseaudioSupport ? stdenv.isLinux, libpulseaudio
|
2018-11-14 22:29:48 +00:00
|
|
|
, ffmpegSupport ? true
|
2018-10-01 01:00:00 +01:00
|
|
|
, gtk3Support ? true, gtk2, gtk3, wrapGAppsHook
|
2019-02-03 10:34:39 +00:00
|
|
|
, waylandSupport ? true, libxkbcommon
|
2017-09-27 14:30:29 +01:00
|
|
|
, gssSupport ? true, kerberos
|
2017-03-27 13:33:00 +01:00
|
|
|
|
2017-03-27 13:35:34 +01:00
|
|
|
## privacy-related options
|
|
|
|
|
2019-01-01 00:00:00 +00:00
|
|
|
, privacySupport ? isTorBrowserLike || isIceCatLike
|
2017-03-27 13:35:34 +01:00
|
|
|
|
|
|
|
# WARNING: NEVER set any of the options below to `true` by default.
|
|
|
|
# Set to `privacySupport` or `false`.
|
|
|
|
|
2018-05-13 18:19:55 +01:00
|
|
|
# webrtcSupport breaks the aarch64 build on version >= 60.
|
|
|
|
# https://bugzilla.mozilla.org/show_bug.cgi?id=1434589
|
2018-10-01 01:00:00 +01:00
|
|
|
, webrtcSupport ? (if lib.versionAtLeast ffversion "60" && stdenv.isAarch64 then false else !privacySupport)
|
2017-11-15 00:00:00 +00:00
|
|
|
, geolocationSupport ? !privacySupport
|
|
|
|
, googleAPISupport ? geolocationSupport
|
2017-03-27 13:33:00 +01:00
|
|
|
, crashreporterSupport ? false
|
|
|
|
|
2017-11-15 00:00:00 +00:00
|
|
|
, safeBrowsingSupport ? false
|
2017-03-27 13:33:00 +01:00
|
|
|
, drmSupport ? false
|
|
|
|
|
2018-07-10 23:10:04 +01:00
|
|
|
# macOS dependencies
|
2018-07-11 22:01:35 +01:00
|
|
|
, xcbuild, CoreMedia, ExceptionHandling, Kerberos, AVFoundation, MediaToolbox
|
2018-07-29 05:15:14 +01:00
|
|
|
, CoreLocation, Foundation, AddressBook, libobjc, cups, rsync
|
2018-07-10 23:10:04 +01:00
|
|
|
|
2017-03-27 13:35:34 +01:00
|
|
|
## other
|
|
|
|
|
2018-01-31 16:50:10 +00:00
|
|
|
# As stated by Sylvestre Ledru (@sylvestre) on Nov 22, 2017 at
|
|
|
|
# https://github.com/NixOS/nixpkgs/issues/31843#issuecomment-346372756 we
|
|
|
|
# have permission to use the official firefox branding.
|
|
|
|
#
|
|
|
|
# Fur purposes of documentation the statement of @sylvestre:
|
|
|
|
# > As the person who did part of the work described in the LWN article
|
|
|
|
# > and release manager working for Mozilla, I can confirm the statement
|
|
|
|
# > that I made in
|
|
|
|
# > https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=815006
|
|
|
|
# >
|
|
|
|
# > @garbas shared with me the list of patches applied for the Nix package.
|
|
|
|
# > As they are just for portability and tiny modifications, they don't
|
|
|
|
# > alter the experience of the product. In parallel, Rok also shared the
|
|
|
|
# > build options. They seem good (even if I cannot judge the quality of the
|
|
|
|
# > packaging of the underlying dependencies like sqlite, png, etc).
|
|
|
|
# > Therefor, as long as you keep the patch queue sane and you don't alter
|
|
|
|
# > the experience of Firefox users, you won't have any issues using the
|
|
|
|
# > official branding.
|
|
|
|
, enableOfficialBranding ? true
|
2013-06-06 12:07:54 +01:00
|
|
|
}:
|
|
|
|
|
2018-02-01 00:00:00 +00:00
|
|
|
assert stdenv.cc.libc or null != null;
|
2013-06-06 12:07:54 +01:00
|
|
|
|
2015-09-03 09:54:13 +01:00
|
|
|
let
|
2017-03-27 13:33:00 +01:00
|
|
|
flag = tf: x: [(if tf then "--enable-${x}" else "--disable-${x}")];
|
2018-07-10 23:10:04 +01:00
|
|
|
|
|
|
|
default-toolkit = if stdenv.isDarwin then "cairo-cocoa"
|
2019-02-03 10:34:39 +00:00
|
|
|
else "cairo-gtk${if gtk3Support then "3${lib.optionalString waylandSupport "-wayland"}" else "2"}";
|
2018-07-29 05:15:14 +01:00
|
|
|
|
2019-01-01 00:00:00 +00:00
|
|
|
binaryName = if isIceCatLike then "icecat" else "firefox";
|
|
|
|
binaryNameCapitalized = lib.toUpper (lib.substring 0 1 binaryName) + lib.substring 1 (-1) binaryName;
|
|
|
|
|
|
|
|
browserName = if stdenv.isDarwin then binaryNameCapitalized else binaryName;
|
|
|
|
|
2018-07-29 05:15:14 +01:00
|
|
|
execdir = if stdenv.isDarwin
|
2019-01-01 00:00:00 +00:00
|
|
|
then "/Applications/${binaryNameCapitalized}.app/Contents/MacOS"
|
2018-07-29 05:15:14 +01:00
|
|
|
else "/bin";
|
2019-01-01 00:00:00 +00:00
|
|
|
|
|
|
|
browserVersion = if isIceCatLike then icversion
|
|
|
|
else if isTorBrowserLike then tbversion
|
|
|
|
else ffversion;
|
2019-01-31 16:38:01 +00:00
|
|
|
|
|
|
|
browserPatches = [
|
|
|
|
./env_var_for_system_dir.patch
|
|
|
|
] ++ patches;
|
|
|
|
|
2017-03-27 13:33:00 +01:00
|
|
|
in
|
2013-06-06 12:07:54 +01:00
|
|
|
|
2018-10-01 01:00:00 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2016-01-10 13:56:17 +00:00
|
|
|
name = "${pname}-unwrapped-${version}";
|
2019-01-01 00:00:00 +00:00
|
|
|
version = browserVersion;
|
2013-06-06 12:07:54 +01:00
|
|
|
|
2019-01-31 16:38:01 +00:00
|
|
|
inherit src unpackPhase meta;
|
|
|
|
|
|
|
|
patches = browserPatches;
|
2017-03-27 13:33:00 +01:00
|
|
|
|
2019-01-23 00:04:04 +00:00
|
|
|
# Ignore trivial whitespace changes in patches, this fixes compatibility of
|
|
|
|
# ./env_var_for_system_dir.patch with Firefox >=65 without having to track
|
|
|
|
# two patches.
|
|
|
|
patchFlags = [ "-p1" "-l" ];
|
|
|
|
|
2017-03-27 13:33:00 +01:00
|
|
|
buildInputs = [
|
|
|
|
gtk2 perl zip libIDL libjpeg zlib bzip2
|
2018-07-12 14:05:52 +01:00
|
|
|
dbus dbus-glib pango freetype fontconfig xorg.libXi xorg.libXcursor
|
2017-03-27 13:33:00 +01:00
|
|
|
xorg.libX11 xorg.libXrender xorg.libXft xorg.libXt file
|
2018-10-01 01:00:00 +01:00
|
|
|
libnotify xorg.pixman yasm libGLU_combined
|
2018-12-31 03:40:47 +00:00
|
|
|
xorg.libXScrnSaver xorg.xorgproto
|
|
|
|
xorg.libXext sqlite unzip makeWrapper
|
2018-06-29 19:55:43 +01:00
|
|
|
libevent libstartup_notification libvpx /* cairo */
|
|
|
|
icu libpng jemalloc glib
|
2017-03-27 13:33:00 +01:00
|
|
|
]
|
2018-10-01 01:00:00 +01:00
|
|
|
++ lib.optionals (!isTorBrowserLike) [ nspr nss ]
|
|
|
|
++ lib.optional (lib.versionOlder ffversion "61") hunspell
|
2019-03-01 08:22:32 +00:00
|
|
|
|
|
|
|
# >= 66 requires nasm for the AV1 lib dav1d
|
|
|
|
# yasm can potentially be removed in future versions
|
|
|
|
# https://bugzilla.mozilla.org/show_bug.cgi?id=1501796
|
|
|
|
# https://groups.google.com/forum/#!msg/mozilla.dev.platform/o-8levmLU80/SM_zQvfzCQAJ
|
|
|
|
++ lib.optional (lib.versionAtLeast ffversion "66") nasm
|
2017-03-27 13:33:00 +01:00
|
|
|
++ lib.optional alsaSupport alsaLib
|
|
|
|
++ lib.optional pulseaudioSupport libpulseaudio # only headers are needed
|
2017-09-27 14:30:29 +01:00
|
|
|
++ lib.optional gtk3Support gtk3
|
2018-07-10 23:10:04 +01:00
|
|
|
++ lib.optional gssSupport kerberos
|
2019-02-03 10:34:39 +00:00
|
|
|
++ lib.optional waylandSupport libxkbcommon
|
2018-07-11 22:01:35 +01:00
|
|
|
++ lib.optionals stdenv.isDarwin [ CoreMedia ExceptionHandling Kerberos
|
|
|
|
AVFoundation MediaToolbox CoreLocation
|
2018-07-29 05:15:14 +01:00
|
|
|
Foundation libobjc AddressBook cups ];
|
2018-07-11 22:01:35 +01:00
|
|
|
|
2018-10-01 01:00:00 +01:00
|
|
|
NIX_CFLAGS_COMPILE = [
|
|
|
|
"-I${glib.dev}/include/gio-unix-2.0"
|
|
|
|
]
|
|
|
|
++ lib.optionals (!isTorBrowserLike) [
|
|
|
|
"-I${nss.dev}/include/nss"
|
|
|
|
]
|
|
|
|
++ lib.optional stdenv.isDarwin [
|
|
|
|
"-isystem ${llvmPackages.libcxx}/include/c++/v1"
|
|
|
|
"-DMAC_OS_X_VERSION_MAX_ALLOWED=MAC_OS_X_VERSION_10_10"
|
|
|
|
];
|
2018-07-11 22:01:35 +01:00
|
|
|
|
|
|
|
postPatch = lib.optionalString stdenv.isDarwin ''
|
|
|
|
substituteInPlace js/src/jsmath.cpp --replace 'defined(HAVE___SINCOS)' 0
|
2018-10-23 08:16:43 +01:00
|
|
|
'' + lib.optionalString (lib.versionAtLeast ffversion "63.0" && !isTorBrowserLike) ''
|
|
|
|
substituteInPlace third_party/prio/prio/rand.c --replace 'nspr/prinit.h' 'prinit.h'
|
2018-07-11 22:01:35 +01:00
|
|
|
'';
|
2017-09-28 01:13:15 +01:00
|
|
|
|
2017-04-23 03:50:33 +01:00
|
|
|
nativeBuildInputs =
|
2018-06-29 19:55:43 +01:00
|
|
|
[ autoconf213 which gnused pkgconfig perl python2 cargo rustc ]
|
2018-07-10 23:10:04 +01:00
|
|
|
++ lib.optional gtk3Support wrapGAppsHook
|
2018-07-29 05:15:14 +01:00
|
|
|
++ lib.optionals stdenv.isDarwin [ xcbuild rsync ]
|
2018-10-23 08:16:43 +01:00
|
|
|
++ lib.optionals (lib.versionAtLeast ffversion "63.0") [ rust-cbindgen nodejs ]
|
2018-07-10 23:10:04 +01:00
|
|
|
++ extraNativeBuildInputs;
|
2017-03-27 13:33:00 +01:00
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
# remove distributed configuration files
|
|
|
|
rm -f configure
|
|
|
|
rm -f js/src/configure
|
|
|
|
rm -f .mozconfig*
|
2018-10-01 01:00:00 +01:00
|
|
|
'' + (if lib.versionAtLeast ffversion "58"
|
2018-02-01 00:00:00 +00:00
|
|
|
# this will run autoconf213
|
|
|
|
then ''
|
|
|
|
configureScript="$(realpath ./mach) configure"
|
|
|
|
'' else ''
|
|
|
|
make -f client.mk configure-files
|
|
|
|
configureScript="$(realpath ./configure)"
|
2018-10-01 01:00:00 +01:00
|
|
|
'') + lib.optionalString (lib.versionAtLeast ffversion "53") ''
|
2018-07-11 22:01:35 +01:00
|
|
|
export MOZCONFIG=$(pwd)/mozconfig
|
|
|
|
|
|
|
|
# Set C flags for Rust's bindgen program. Unlike ordinary C
|
|
|
|
# compilation, bindgen does not invoke $CC directly. Instead it
|
|
|
|
# uses LLVM's libclang. To make sure all necessary flags are
|
|
|
|
# included we need to look in a few places.
|
|
|
|
# TODO: generalize this process for other use-cases.
|
2018-07-29 05:15:14 +01:00
|
|
|
|
|
|
|
BINDGEN_CFLAGS="$(< ${stdenv.cc}/nix-support/libc-cflags) \
|
|
|
|
$(< ${stdenv.cc}/nix-support/cc-cflags) \
|
|
|
|
${stdenv.cc.default_cxx_stdlib_compile} \
|
|
|
|
${lib.optionalString stdenv.cc.isClang "-idirafter ${stdenv.cc.cc}/lib/clang/${lib.getVersion stdenv.cc.cc}/include"} \
|
|
|
|
${lib.optionalString stdenv.cc.isGNU "-isystem ${stdenv.cc.cc}/include/c++/${lib.getVersion stdenv.cc.cc} -isystem ${stdenv.cc.cc}/include/c++/${lib.getVersion stdenv.cc.cc}/$(cc -dumpmachine)"} \
|
|
|
|
$NIX_CFLAGS_COMPILE"
|
|
|
|
|
|
|
|
echo "ac_add_options BINDGEN_CFLAGS='$BINDGEN_CFLAGS'" >> $MOZCONFIG
|
2018-01-31 00:52:10 +00:00
|
|
|
'' + lib.optionalString googleAPISupport ''
|
|
|
|
# Google API key used by Chromium and Firefox.
|
|
|
|
# Note: These are for NixOS/nixpkgs use ONLY. For your own distribution,
|
|
|
|
# please get your own set of keys.
|
|
|
|
echo "AIzaSyDGi15Zwl11UNe6Y-5XW_upsfyw31qwZPI" > $TMPDIR/ga
|
2019-03-01 08:22:32 +00:00
|
|
|
# 60.5+ & 66+ did split the google API key arguments: https://bugzilla.mozilla.org/show_bug.cgi?id=1531176
|
|
|
|
${if (lib.versionAtLeast ffversion "60.6" && lib.versionOlder ffversion "61") || (lib.versionAtLeast ffversion "66") then ''
|
|
|
|
configureFlagsArray+=("--with-google-location-service-api-keyfile=$TMPDIR/ga")
|
|
|
|
configureFlagsArray+=("--with-google-safebrowsing-api-keyfile=$TMPDIR/ga")
|
|
|
|
'' else ''
|
|
|
|
configureFlagsArray+=("--with-google-api-keyfile=$TMPDIR/ga")
|
|
|
|
''}
|
2018-10-01 01:00:00 +01:00
|
|
|
'' + lib.optionalString (lib.versionOlder ffversion "58") ''
|
2017-03-27 13:33:00 +01:00
|
|
|
cd obj-*
|
2018-12-11 09:37:55 +00:00
|
|
|
''
|
|
|
|
# AS=as in the environment causes build failure https://bugzilla.mozilla.org/show_bug.cgi?id=1497286
|
|
|
|
+ lib.optionalString (lib.versionAtLeast ffversion "64") ''
|
|
|
|
unset AS
|
2017-03-27 13:33:00 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
"--enable-application=browser"
|
|
|
|
"--with-system-jpeg"
|
|
|
|
"--with-system-zlib"
|
|
|
|
"--with-system-bz2"
|
|
|
|
"--with-system-libevent"
|
|
|
|
"--with-system-libvpx"
|
|
|
|
"--with-system-png" # needs APNG support
|
|
|
|
"--with-system-icu"
|
|
|
|
"--enable-system-ffi"
|
|
|
|
"--enable-system-pixman"
|
|
|
|
"--enable-system-sqlite"
|
|
|
|
#"--enable-system-cairo"
|
|
|
|
"--enable-startup-notification"
|
2017-05-14 16:10:06 +01:00
|
|
|
#"--enable-content-sandbox" # TODO: probably enable after 54
|
2017-03-27 13:33:00 +01:00
|
|
|
"--disable-tests"
|
|
|
|
"--disable-necko-wifi" # maybe we want to enable this at some point
|
|
|
|
"--disable-updater"
|
|
|
|
"--enable-jemalloc"
|
|
|
|
"--disable-gconf"
|
2018-07-10 23:10:04 +01:00
|
|
|
"--enable-default-toolkit=${default-toolkit}"
|
2017-03-27 13:33:00 +01:00
|
|
|
]
|
2018-12-11 09:37:55 +00:00
|
|
|
++ lib.optional (lib.versionOlder ffversion "64") "--disable-maintenance-service"
|
2018-10-01 01:00:00 +01:00
|
|
|
++ lib.optional (stdenv.isDarwin && lib.versionAtLeast ffversion "61") "--disable-xcode-checks"
|
|
|
|
++ lib.optional (lib.versionOlder ffversion "61") "--enable-system-hunspell"
|
2018-09-11 09:12:06 +01:00
|
|
|
++ lib.optionals (lib.versionAtLeast ffversion "56") [
|
2018-01-16 21:19:02 +00:00
|
|
|
"--with-libclang-path=${llvmPackages.libclang}/lib"
|
2017-09-28 01:13:15 +01:00
|
|
|
"--with-clang-path=${llvmPackages.clang}/bin/clang"
|
|
|
|
]
|
2018-10-01 01:00:00 +01:00
|
|
|
++ lib.optionals (lib.versionAtLeast ffversion "57") [
|
2017-12-09 16:40:57 +00:00
|
|
|
"--enable-webrender=build"
|
|
|
|
]
|
2017-04-01 01:00:00 +01:00
|
|
|
|
|
|
|
# TorBrowser patches these
|
|
|
|
++ lib.optionals (!isTorBrowserLike) [
|
|
|
|
"--with-system-nspr"
|
2018-10-01 01:00:00 +01:00
|
|
|
"--with-system-nss"
|
2017-04-01 01:00:00 +01:00
|
|
|
]
|
|
|
|
|
|
|
|
# and wants these
|
2017-11-15 00:00:00 +00:00
|
|
|
++ lib.optionals isTorBrowserLike ([
|
2018-10-01 01:00:00 +01:00
|
|
|
"--with-tor-browser-version=${tbversion}"
|
2017-04-01 01:00:00 +01:00
|
|
|
"--enable-signmar"
|
|
|
|
"--enable-verify-mar"
|
2018-10-01 01:00:00 +01:00
|
|
|
])
|
2017-04-01 01:00:00 +01:00
|
|
|
|
2017-03-27 13:33:00 +01:00
|
|
|
++ flag alsaSupport "alsa"
|
|
|
|
++ flag pulseaudioSupport "pulseaudio"
|
|
|
|
++ flag ffmpegSupport "ffmpeg"
|
2017-09-27 14:30:29 +01:00
|
|
|
++ flag gssSupport "negotiateauth"
|
2017-03-27 13:33:00 +01:00
|
|
|
++ flag webrtcSupport "webrtc"
|
|
|
|
++ flag crashreporterSupport "crashreporter"
|
2017-07-01 04:06:51 +01:00
|
|
|
++ lib.optional drmSupport "--enable-eme=widevine"
|
2017-03-27 13:33:00 +01:00
|
|
|
|
2018-10-01 01:00:00 +01:00
|
|
|
++ lib.optionals (lib.versionOlder ffversion "60") ([]
|
|
|
|
++ flag geolocationSupport "mozril-geoloc"
|
|
|
|
++ flag safeBrowsingSupport "safe-browsing"
|
|
|
|
)
|
|
|
|
|
2017-03-27 13:33:00 +01:00
|
|
|
++ (if debugBuild then [ "--enable-debug" "--enable-profiling" ]
|
|
|
|
else [ "--disable-debug" "--enable-release"
|
|
|
|
"--enable-optimize"
|
|
|
|
"--enable-strip" ])
|
2017-08-15 01:00:00 +01:00
|
|
|
++ lib.optional enableOfficialBranding "--enable-official-branding"
|
|
|
|
++ extraConfigureFlags;
|
2014-07-23 14:31:49 +01:00
|
|
|
|
2018-02-01 00:00:00 +00:00
|
|
|
# Before 58 we have to run `make -f client.mk configure-files` at
|
|
|
|
# the top level, and then run `./configure` in the obj-* dir (see
|
|
|
|
# above), but in 58 we have to instead run `./mach configure` at the
|
|
|
|
# top level and then run `make` in obj-*. (We can also run the
|
|
|
|
# `make` at the top level in 58, but then we would have to `cd` to
|
|
|
|
# `make install` anyway. This is ugly, but simple.)
|
2018-10-01 01:00:00 +01:00
|
|
|
postConfigure = lib.optionalString (lib.versionAtLeast ffversion "58") ''
|
2018-02-01 00:00:00 +00:00
|
|
|
cd obj-*
|
|
|
|
'';
|
|
|
|
|
2018-10-01 01:00:00 +01:00
|
|
|
preBuild = lib.optionalString isTorBrowserLike ''
|
2017-08-15 01:00:00 +01:00
|
|
|
buildFlagsArray=("MOZ_APP_DISPLAYNAME=Tor Browser")
|
|
|
|
'';
|
|
|
|
|
|
|
|
makeFlags = lib.optionals enableOfficialBranding [
|
|
|
|
"MOZILLA_OFFICIAL=1"
|
|
|
|
"BUILD_OFFICIAL=1"
|
|
|
|
]
|
|
|
|
++ extraMakeFlags;
|
|
|
|
|
2014-07-23 14:31:49 +01:00
|
|
|
enableParallelBuilding = true;
|
2018-04-25 04:20:18 +01:00
|
|
|
doCheck = false; # "--disable-tests" above
|
2014-07-23 14:31:49 +01:00
|
|
|
|
2018-07-29 05:15:14 +01:00
|
|
|
installPhase = if stdenv.isDarwin then ''
|
|
|
|
mkdir -p $out/Applications
|
2019-01-01 00:00:00 +00:00
|
|
|
cp -LR dist/${binaryNameCapitalized}.app $out/Applications
|
2018-07-29 05:15:14 +01:00
|
|
|
'' else null;
|
|
|
|
|
|
|
|
postInstall = lib.optionalString stdenv.isLinux ''
|
2017-03-27 13:33:00 +01:00
|
|
|
# Remove SDK cruft. FIXME: move to a separate output?
|
2019-01-01 00:00:00 +00:00
|
|
|
rm -rf $out/share/idl $out/include $out/lib/${binaryName}-devel-*
|
2017-03-27 13:33:00 +01:00
|
|
|
|
|
|
|
# Needed to find Mozilla runtime
|
2019-01-01 00:00:00 +00:00
|
|
|
gappsWrapperArgs+=(--argv0 "$out/bin/.${binaryName}-wrapped")
|
2017-03-27 13:33:00 +01:00
|
|
|
'';
|
|
|
|
|
2018-07-29 05:15:14 +01:00
|
|
|
postFixup = lib.optionalString stdenv.isLinux ''
|
2016-09-18 22:19:51 +01:00
|
|
|
# Fix notifications. LibXUL uses dlopen for this, unfortunately; see #18712.
|
2017-03-27 13:33:00 +01:00
|
|
|
patchelf --set-rpath "${lib.getLib libnotify
|
2019-01-01 00:00:00 +00:00
|
|
|
}/lib:$(patchelf --print-rpath "$out"/lib/${binaryName}*/libxul.so)" \
|
|
|
|
"$out"/lib/${binaryName}*/libxul.so
|
2017-03-27 13:33:00 +01:00
|
|
|
'';
|
2016-09-18 22:19:51 +01:00
|
|
|
|
2017-04-09 18:17:40 +01:00
|
|
|
doInstallCheck = true;
|
2017-03-27 13:33:00 +01:00
|
|
|
installCheckPhase = ''
|
|
|
|
# Some basic testing
|
2018-07-29 05:15:14 +01:00
|
|
|
"$out${execdir}/${browserName}" --version
|
2017-03-27 13:33:00 +01:00
|
|
|
'';
|
2013-06-06 12:07:54 +01:00
|
|
|
|
2014-07-23 14:31:49 +01:00
|
|
|
passthru = {
|
2017-03-27 13:33:00 +01:00
|
|
|
inherit version updateScript;
|
|
|
|
isFirefox3Like = true;
|
2019-01-01 00:00:00 +00:00
|
|
|
inherit isIceCatLike;
|
2017-04-01 01:00:00 +01:00
|
|
|
inherit isTorBrowserLike;
|
2017-03-27 13:33:00 +01:00
|
|
|
gtk = gtk2;
|
|
|
|
inherit nspr;
|
|
|
|
inherit ffmpegSupport;
|
2017-09-27 14:30:29 +01:00
|
|
|
inherit gssSupport;
|
2018-07-29 05:15:14 +01:00
|
|
|
inherit execdir;
|
|
|
|
inherit browserName;
|
2017-05-04 21:09:15 +01:00
|
|
|
} // lib.optionalAttrs gtk3Support { inherit gtk3; };
|
2017-04-01 01:00:00 +01:00
|
|
|
|
2018-10-01 01:00:00 +01:00
|
|
|
}
|