@ -1,7 +1,7 @@
{ pname , version , updateScript ? null
, src , patches ? [ ] , extraConfigureFlags ? [ ] , extraMakeFlag s ? [ ]
, overrides ? { } , extraNativeBuildInput s ? [ ] , m eta
, isTorBrowserLike ? false } :
{ pname , ff version, meta , updateScript ? null
, src , unpackPhase ? null , patche s ? [ ]
, extraNativeBuildInputs ? [ ] , extraConfigureFlag s ? [ ] , ex traMakeFl ags ? [ ]
, isTorBrowserLike ? false , tbversion ? null } :
{ lib , stdenv , pkgconfig , pango , perl , python2 , zip , libIDL
, libjpeg , zlib , dbus , dbus-glib , bzip2 , xorg
@ -19,7 +19,7 @@
, alsaSupport ? stdenv . isLinux , alsaLib
, pulseaudioSupport ? true , libpulseaudio
, ffmpegSupport ? true , gstreamer , gst-plugins-base
, gtk3Support ? ! isTorBrowserLik e, gtk2 , gtk3 , wrapGAppsHook
, gtk3Support ? tru e, gtk2 , gtk3 , wrapGAppsHook
, gssSupport ? true , kerberos
## privacy-related options
@ -31,7 +31,7 @@
# webrtcSupport breaks the aarch64 build on version >= 60.
# https://bugzilla.mozilla.org/show_bug.cgi?id=1434589
, webrtcSupport ? ( if lib . versionAtLeast version " 6 0 " && stdenv . isAarch64 then false else ! privacySupport )
, webrtcSupport ? ( if lib . versionAtLeast ff version " 6 0 " && stdenv . isAarch64 then false else ! privacySupport )
, geolocationSupport ? ! privacySupport
, googleAPISupport ? geolocationSupport
, crashreporterSupport ? false
@ -80,23 +80,24 @@ let
browserName = if stdenv . isDarwin then " F i r e f o x " else " f i r e f o x " ;
in
stdenv . mkDerivation ( rec {
stdenv . mkDerivation rec {
name = " ${ pname } - u n w r a p p e d - ${ version } " ;
version = if ! isTorBrowserLike then ffversion else tbversion ;
inherit src patches meta ;
inherit src unpackPhase patches meta ;
buildInputs = [
gtk2 perl zip libIDL libjpeg zlib bzip2
dbus dbus-glib pango freetype fontconfig xorg . libXi xorg . libXcursor
xorg . libX11 xorg . libXrender xorg . libXft xorg . libXt file
nspr libnotify xorg . pixman yasm libGLU_combined
libnotify xorg . pixman yasm libGLU_combined
xorg . libXScrnSaver xorg . scrnsaverproto
xorg . libXext xorg . xextproto sqlite unzip makeWrapper
libevent libstartup_notification libvpx /* c a i r o */
icu libpng jemalloc glib
]
++ lib . optionals ( ! isTorBrowserLike ) [ nss ]
++ lib . optional ( lib . versionOlder version " 6 1 " ) hunspell
++ lib . optionals ( ! isTorBrowserLike ) [ nspr ns s ]
++ lib . optional ( lib . versionOlder ff version " 6 1 " ) hunspell
++ lib . optional alsaSupport alsaLib
++ lib . optional pulseaudioSupport libpulseaudio # only headers are needed
++ lib . optionals ffmpegSupport [ gstreamer gst-plugins-base ]
@ -106,12 +107,17 @@ stdenv.mkDerivation (rec {
AVFoundation MediaToolbox CoreLocation
Foundation libobjc AddressBook cups ] ;
NIX_CFLAGS_COMPILE = [ " - I ${ nspr . dev } / i n c l u d e / n s p r "
" - I ${ nss . dev } / i n c l u d e / n s s "
" - I ${ glib . dev } / i n c l u d e / g i o - u n i x - 2 . 0 " ]
++ lib . optional stdenv . isDarwin [
" - i s y s t e m ${ llvmPackages . libcxx } / i n c l u d e / c + + / v 1 "
" - D M A C _ O S _ X _ V E R S I O N _ M A X _ A L L O W E D = M A C _ O S _ X _ V E R S I O N _ 1 0 _ 1 0 " ] ;
NIX_CFLAGS_COMPILE = [
" - I ${ glib . dev } / i n c l u d e / g i o - u n i x - 2 . 0 "
]
++ lib . optionals ( ! isTorBrowserLike ) [
" - I ${ nspr . dev } / i n c l u d e / n s p r "
" - I ${ nss . dev } / i n c l u d e / n s s "
]
++ lib . optional stdenv . isDarwin [
" - i s y s t e m ${ llvmPackages . libcxx } / i n c l u d e / c + + / v 1 "
" - D M A C _ O S _ X _ V E R S I O N _ M A X _ A L L O W E D = M A C _ O S _ X _ V E R S I O N _ 1 0 _ 1 0 "
] ;
postPatch = lib . optionalString stdenv . isDarwin ''
substituteInPlace js/src/jsmath.cpp - - replace ' defined ( HAVE___SINCOS ) ' 0
@ -128,14 +134,14 @@ stdenv.mkDerivation (rec {
rm - f configure
rm - f js/src/configure
rm - f . mozconfig *
'' + ( i f l i b . v e r s i o n A t L e a s t v e r s i o n " 5 8 "
'' + ( i f l i b . v e r s i o n A t L e a s t f f ve r s i o n " 5 8 "
# this will run autoconf213
then ''
configureScript = " $ ( r e a l p a t h . / m a c h ) c o n f i g u r e "
'' e l s e ''
make - f client . mk configure-files
configureScript = " $ ( r e a l p a t h . / c o n f i g u r e ) "
'' ) + l i b . o p t i o n a l S t r i n g ( ! i s T o r B r o w s e r L i k e & & li b . v e r s i o n A t L e a s t v e r s i o n " 5 3 " ) ''
'' ) + l i b . o p t i o n a l S t r i n g ( l i b . v e r s i o n A t L e a s t f f v e r s i o n " 5 3 " ) ''
export MOZCONFIG = $ ( pwd ) /mozconfig
# Set C flags for Rust's bindgen program. Unlike ordinary C
@ -158,7 +164,7 @@ stdenv.mkDerivation (rec {
# please get your own set of keys.
echo " A I z a S y D G i 1 5 Z w l 1 1 U N e 6 Y - 5 X W _ u p s f y w 3 1 q w Z P I " > $ TMPDIR/ga
configureFlagsArray + = ( " - - w i t h - g o o g l e - a p i - k e y f i l e = $ T M P D I R / g a " )
'' + l i b . o p t i o n a l S t r i n g ( l i b . v e r s i o n O l d e r v e r s i o n " 5 8 " ) ''
'' + l i b . o p t i o n a l S t r i n g ( l i b . v e r s i o n O l d e r f f ve r s i o n " 5 8 " ) ''
cd obj- *
'' ;
@ -185,37 +191,29 @@ stdenv.mkDerivation (rec {
" - - d i s a b l e - g c o n f "
" - - e n a b l e - d e f a u l t - t o o l k i t = ${ default-toolkit } "
]
++ lib . optional ( stdenv . isDarwin && lib . versionAtLeast version " 6 1 " ) " - - d i s a b l e - x c o d e - c h e c k s "
++ lib . optional ( lib . versionOlder version " 6 1 " ) " - - e n a b l e - s y s t e m - h u n s p e l l "
++ lib . optionals ( lib . versionAtLeast version " 5 6 " && ! stdenv . hostPlatform . isi686 ) [
++ lib . optional ( stdenv . isDarwin && lib . versionAtLeast ff version " 6 1 " ) " - - d i s a b l e - x c o d e - c h e c k s "
++ lib . optional ( lib . versionOlder ff version " 6 1 " ) " - - e n a b l e - s y s t e m - h u n s p e l l "
++ lib . optionals ( lib . versionAtLeast ff version " 5 6 " && ! stdenv . hostPlatform . isi686 ) [
# on i686-linux: --with-libclang-path is not available in this configuration
" - - w i t h - l i b c l a n g - p a t h = ${ llvmPackages . libclang } / l i b "
" - - w i t h - c l a n g - p a t h = ${ llvmPackages . clang } / b i n / c l a n g "
]
++ lib . optionals ( lib . versionAtLeast version " 5 7 " ) [
++ lib . optionals ( lib . versionAtLeast ff version " 5 7 " ) [
" - - e n a b l e - w e b r e n d e r = b u i l d "
]
# TorBrowser patches these
++ lib . optionals ( ! isTorBrowserLike ) [
" - - w i t h - s y s t e m - n s s "
" - - w i t h - s y s t e m - n s p r "
" - - w i t h - s y s t e m - n s s "
]
# and wants these
++ lib . optionals isTorBrowserLike ( [
" - - w i t h - t o r - b r o w s e r - v e r s i o n = ${ version } "
" - - w i t h - t o r - b r o w s e r - v e r s i o n = ${ tb version} "
" - - e n a b l e - s i g n m a r "
" - - e n a b l e - v e r i f y - m a r "
# We opt out of TorBrowser's nspr because that patch is useless on
# anything but Windows and produces zero fingerprinting
# possibilities on other platforms.
# Lets save some space instead.
" - - w i t h - s y s t e m - n s p r "
] ++ flag geolocationSupport " m o z r i l - g e o l o c "
++ flag safeBrowsingSupport " s a f e - b r o w s i n g "
)
] )
++ flag alsaSupport " a l s a "
++ flag pulseaudioSupport " p u l s e a u d i o "
@ -226,6 +224,11 @@ stdenv.mkDerivation (rec {
++ flag crashreporterSupport " c r a s h r e p o r t e r "
++ lib . optional drmSupport " - - e n a b l e - e m e = w i d e v i n e "
++ lib . optionals ( lib . versionOlder ffversion " 6 0 " ) ( [ ]
++ flag geolocationSupport " m o z r i l - g e o l o c "
++ flag safeBrowsingSupport " s a f e - b r o w s i n g "
)
++ ( if debugBuild then [ " - - e n a b l e - d e b u g " " - - e n a b l e - p r o f i l i n g " ]
else [ " - - d i s a b l e - d e b u g " " - - e n a b l e - r e l e a s e "
" - - e n a b l e - o p t i m i z e "
@ -239,11 +242,11 @@ stdenv.mkDerivation (rec {
# 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.)
postConfigure = lib . optionalString ( lib . versionAtLeast version " 5 8 " ) ''
postConfigure = lib . optionalString ( lib . versionAtLeast ff version " 5 8 " ) ''
cd obj- *
'' ;
preBuild = lib . optionalString ( enableOfficialBranding && isTorBrowserLike ) ''
preBuild = lib . optionalString isTorBrowserLike ''
buildFlagsArray = ( " M O Z _ A P P _ D I S P L A Y N A M E = T o r B r o w s e r " )
'' ;
@ -302,4 +305,4 @@ stdenv.mkDerivation (rec {
inherit browserName ;
} // lib . optionalAttrs gtk3Support { inherit gtk3 ; } ;
} // overrides )
}