about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJoachim F <joachifm@users.noreply.github.com>2018-02-12 11:15:29 +0000
committerGitHub <noreply@github.com>2018-02-12 11:15:29 +0000
commit2bfda206c4246ab815aa63c933fa236c1725a6a2 (patch)
treec262deb4091d6117438c99cf0df94feaf1e4502b
parent040bde90521c9956e8970b35305a337732cf0ade (diff)
parent5e41e65f5f4de26c9fe6165d8e94ab83acadb0d2 (diff)
Merge pull request #34849 from oxij/pkgs/firefoxes
pkgs: firefoxes and tor-browsers
-rw-r--r--pkgs/applications/networking/browsers/firefox/common.nix44
-rw-r--r--pkgs/applications/networking/browsers/firefox/packages.nix34
2 files changed, 41 insertions, 37 deletions
diff --git a/pkgs/applications/networking/browsers/firefox/common.nix b/pkgs/applications/networking/browsers/firefox/common.nix
index 91b86a18375cc..69e935d78762d 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 <<END_MOZCONFIG
-    ${lib.concatStringsSep "\n" (map (flag: "ac_add_options ${flag}") configureFlags)}
-    ${lib.optionalString googleAPISupport "ac_add_options --with-google-api-keyfile=$TMPDIR/ga"}
-    END_MOZCONFIG
+    test -f layout/style/ServoBindings.toml && sed -i -e '/"-DMOZ_STYLO"/ a , "-cxx-isystem", "'$cxxLib'", "-isystem", "'$archLib'"' layout/style/ServoBindings.toml
   '' + 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
     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 6195449258030..4cb997031cf7b 100644
--- a/pkgs/applications/networking/browsers/firefox/packages.nix
+++ b/pkgs/applications/networking/browsers/firefox/packages.nix
@@ -99,44 +99,42 @@ rec {
 
 in rec {
 
-  tor-browser-6-5 = common (rec {
+  tor-browser-7-0 = common (rec {
     pname = "tor-browser";
-    version = "6.5.2";
+    version = "7.0.1";
     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";
+      repo  = "tor-browser";
+      # branch "tor-browser-52.5.0esr-7.0-1-slnos";
+      rev   = "830ff8d622ef20345d83f386174f790b0fc2440d";
+      sha256 = "169mjkr0bp80yv9nzza7kay7y2k03lpnx71h4ybcv9ygxgzdgax5";
     };
-  } // commonAttrs) {
-    stdenv = overrideCC stdenv gcc5;
-    ffmpegSupport = false;
-    gssSupport = false;
-  };
 
-  tor-browser-7-0 = common (rec {
+    patches =
+      [ ./env_var_for_system_dir.patch ];
+  } // commonAttrs) {};
+
+  tor-browser-7-5 = common (rec {
     pname = "tor-browser";
-    version = "7.0.1";
+    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.5.0esr-7.0-1-slnos";
-      rev   = "830ff8d622ef20345d83f386174f790b0fc2440d";
-      sha256 = "169mjkr0bp80yv9nzza7kay7y2k03lpnx71h4ybcv9ygxgzdgax5";
+      # 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-0;
+  tor-browser = tor-browser-7-5;
 
 })