diff --git a/pkgs/applications/networking/browsers/firefox/common.nix b/pkgs/applications/networking/browsers/firefox/common.nix index 91b86a18375c..69e935d78762 100644 --- a/pkgs/applications/networking/browsers/firefox/common.nix +++ b/pkgs/applications/networking/browsers/firefox/common.nix @@ -59,7 +59,7 @@ , enableOfficialBranding ? true }: -assert stdenv.cc ? libc && stdenv.cc.libc != null; +assert stdenv.cc.libc or null != null; let flag = tf: x: [(if tf then "--enable-${x}" else "--disable-${x}")]; @@ -100,29 +100,25 @@ stdenv.mkDerivation (rec { rm -f configure rm -f js/src/configure rm -f .mozconfig* + '' + (if lib.versionAtLeast version "58" + # this will run autoconf213 + then '' + configureScript="$(realpath ./mach) configure" + '' else '' + make -f client.mk configure-files + configureScript="$(realpath ./configure)" + '') + '' + cxxLib=$( echo -n ${gcc}/include/c++/* ) + archLib=$cxxLib/$( ${gcc}/bin/gcc -dumpmachine ) - '' + lib.optionalString (stdenv.lib.versionAtLeast version "58.0.0") '' - cat >.mozconfig < $TMPDIR/ga configureFlagsArray+=("--with-google-api-keyfile=$TMPDIR/ga") - '' + '' - # this will run autoconf213 - ${if (stdenv.lib.versionAtLeast version "58.0.0") then "./mach configure" else "make -f client.mk configure-files"} - - configureScript="$(realpath ./configure)" - - cxxLib=$( echo -n ${gcc}/include/c++/* ) - archLib=$cxxLib/$( ${gcc}/bin/gcc -dumpmachine ) - - test -f layout/style/ServoBindings.toml && sed -i -e '/"-DMOZ_STYLO"/ a , "-cxx-isystem", "'$cxxLib'", "-isystem", "'$archLib'"' layout/style/ServoBindings.toml - + '' + lib.optionalString (lib.versionOlder version "58") '' cd obj-* ''; @@ -150,12 +146,12 @@ stdenv.mkDerivation (rec { "--disable-gconf" "--enable-default-toolkit=cairo-gtk${if gtk3Support then "3" else "2"}" ] - ++ lib.optionals (stdenv.lib.versionAtLeast version "56" && !stdenv.hostPlatform.isi686) [ + ++ lib.optionals (lib.versionAtLeast version "56" && !stdenv.hostPlatform.isi686) [ # on i686-linux: --with-libclang-path is not available in this configuration "--with-libclang-path=${llvmPackages.libclang}/lib" "--with-clang-path=${llvmPackages.clang}/bin/clang" ] - ++ lib.optionals (stdenv.lib.versionAtLeast version "57") [ + ++ lib.optionals (lib.versionAtLeast version "57") [ "--enable-webrender=build" ] @@ -196,6 +192,16 @@ stdenv.mkDerivation (rec { ++ lib.optional enableOfficialBranding "--enable-official-branding" ++ extraConfigureFlags; + # 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.) + postConfigure = lib.optionalString (lib.versionAtLeast version "58") '' + cd obj-* + ''; + preBuild = lib.optionalString (enableOfficialBranding && isTorBrowserLike) '' buildFlagsArray=("MOZ_APP_DISPLAYNAME=Tor Browser") ''; diff --git a/pkgs/applications/networking/browsers/firefox/packages.nix b/pkgs/applications/networking/browsers/firefox/packages.nix index 619544925803..4cb997031cf7 100644 --- a/pkgs/applications/networking/browsers/firefox/packages.nix +++ b/pkgs/applications/networking/browsers/firefox/packages.nix @@ -99,26 +99,6 @@ rec { in rec { - tor-browser-6-5 = common (rec { - pname = "tor-browser"; - version = "6.5.2"; - isTorBrowserLike = true; - extraConfigureFlags = [ "--disable-loop" ]; - - # FIXME: fetchFromGitHub is not ideal, unpacked source is >900Mb - src = fetchFromGitHub { - owner = "SLNOS"; - repo = "tor-browser"; - # branch "tor-browser-45.8.0esr-6.5-2-slnos" - rev = "e4140ea01b9906934f0347e95f860cec207ea824"; - sha256 = "0a1qk3a9a3xxrl56bp4zbknbchv5x17k1w5kgcf4j3vklcv6av60"; - }; - } // commonAttrs) { - stdenv = overrideCC stdenv gcc5; - ffmpegSupport = false; - gssSupport = false; - }; - tor-browser-7-0 = common (rec { pname = "tor-browser"; version = "7.0.1"; @@ -137,6 +117,24 @@ in rec { [ ./env_var_for_system_dir.patch ]; } // commonAttrs) {}; - tor-browser = tor-browser-7-0; + tor-browser-7-5 = common (rec { + pname = "tor-browser"; + version = "7.5.2"; + isTorBrowserLike = true; + + # FIXME: fetchFromGitHub is not ideal, unpacked source is >900Mb + src = fetchFromGitHub { + owner = "SLNOS"; + repo = "tor-browser"; + # branch "tor-browser-52.6.2esr-7.5-2-slnos"; + rev = "cf1a504aaa26af962ae909a3811c0038db2d2eec"; + sha256 = "0llbk7skh1n7yj137gv7rnxfasxsnvfjp4ss7h1fbdnw19yba115"; + }; + + patches = + [ ./env_var_for_system_dir.patch ]; + } // commonAttrs) {}; + + tor-browser = tor-browser-7-5; })