Skip to content

Commit

Permalink
Merge pull request #49096 from andir/18.03/firefox
Browse files Browse the repository at this point in the history
[18.03] firefox{,-bin}: 62.0.3 -> 63.0 & nss: 3.38-> 3.39
  • Loading branch information
andir committed Oct 25, 2018
2 parents ede8a2f + 5dd4087 commit b4e3a40
Show file tree
Hide file tree
Showing 13 changed files with 1,040 additions and 405 deletions.
794 changes: 397 additions & 397 deletions pkgs/applications/networking/browsers/firefox-bin/release_sources.nix

Large diffs are not rendered by default.

18 changes: 14 additions & 4 deletions pkgs/applications/networking/browsers/firefox/common.nix
Expand Up @@ -9,7 +9,8 @@
, yasm, libGLU_combined, sqlite, unzip, makeWrapper
, hunspell, libevent, libstartup_notification, libvpx
, cairo, icu, libpng, jemalloc, glib
, autoconf213, which, gnused, cargo, rustc, llvmPackages
, autoconf213, which, gnused, cargo, rustc, rust_1_29, llvmPackages
, rust-cbindgen, nodejs-8_x
, debugBuild ? false

### optionals
Expand Down Expand Up @@ -96,7 +97,11 @@ stdenv.mkDerivation (rec {
NIX_CFLAGS_COMPILE = "-I${nspr.dev}/include/nspr -I${nss.dev}/include/nss -I${glib.dev}/include/gio-unix-2.0";

nativeBuildInputs =
[ autoconf213 which gnused pkgconfig perl python2 cargo rustc ]
[ autoconf213 which gnused pkgconfig perl python2 ]
# >= 63 requires at least rust version 1.28 and a matching cargo version
++ (if lib.versionAtLeast version "63" then [
rust_1_29.rustc rust_1_29.cargo rust-cbindgen nodejs-8_x
] else [rustc cargo])
++ lib.optional gtk3Support wrapGAppsHook ++ extraNativeBuildInputs;

preConfigure = ''
Expand Down Expand Up @@ -160,8 +165,9 @@ stdenv.mkDerivation (rec {
"--enable-webrender=build"
]

# TorBrowser patches these
++ lib.optionals (!isTorBrowserLike) [
# TorBrowser patches these and for version <63.0 we still use our own nss &
# nspr, for newer ones we do just use whatever firefox ships
++ lib.optionals (!isTorBrowserLike && (lib.versionOlder version "63")) [
"--with-system-nss"
"--with-system-nspr"
]
Expand Down Expand Up @@ -197,6 +203,10 @@ stdenv.mkDerivation (rec {
++ lib.optional enableOfficialBranding "--enable-official-branding"
++ extraConfigureFlags;

postPatch = lib.optionalString (lib.versionAtLeast version "63.0" && !isTorBrowserLike) ''
substituteInPlace third_party/prio/prio/rand.c --replace 'nspr/prinit.h' 'prinit.h'
'';

# 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
Expand Down
8 changes: 4 additions & 4 deletions pkgs/applications/networking/browsers/firefox/packages.nix
Expand Up @@ -20,10 +20,10 @@ rec {

firefox = common rec {
pname = "firefox";
version = "62.0.3";
version = "63.0";
src = fetchurl {
url = "mirror://mozilla/firefox/releases/${version}/source/firefox-${version}.source.tar.xz";
sha512 = "0kvb664s47bmmdq2ppjsnyqy8yaiig1xj81r25s36c3i8igfq3zxvws10k2dlmmmrwyc5k4g9i9imgkxj7r3xwwqxc72dl429wvfys8";
sha512 = "095nn50g72l4ihbv26qqqs2jg4ahnmd54vxvm7nxwrnkx901aji7pph6c91zfpf7df26ib1b0pqyir9vsac40sdxc8yrzm6d0lyl1m2";
};

patches = nixpkgsPatches ++ [
Expand Down Expand Up @@ -78,10 +78,10 @@ rec {

firefox-esr-60 = common rec {
pname = "firefox-esr";
version = "60.2.2esr";
version = "60.3.0esr";
src = fetchurl {
url = "mirror://mozilla/firefox/releases/${version}/source/firefox-${version}.source.tar.xz";
sha512 = "2h2naaxx4lv90bjpcrsma4sdhl4mvsisx3zi09vakjwv2lad91gy41cmcpqprpcbsmlvpqf8yiv52ah4d02a8d9335xhw2ajw6asjc1";
sha512 = "7ded25a38835fbd73a58085e24ad83308afee1784a3bf853d75093c1500ad46988f5865c106abdae938cfbd1fb10746cc1795ece7994fd7eba8a002158cf1bcd";
};

patches = nixpkgsPatches ++ [
Expand Down
117 changes: 117 additions & 0 deletions pkgs/development/compilers/rust/1.29/binaryBuild.nix
@@ -0,0 +1,117 @@
{ stdenv, makeWrapper, bash, buildRustPackage, curl, darwin
, version
, src
, platform
, versionType
}:

let
inherit (stdenv.lib) optionalString;
inherit (darwin.apple_sdk.frameworks) Security;

bootstrapping = versionType == "bootstrap";

installComponents
= "rustc,rust-std-${platform}"
+ (optionalString bootstrapping ",cargo")
;
in

rec {
inherit buildRustPackage;

rustc = stdenv.mkDerivation rec {
name = "rustc-${versionType}-${version}";

inherit version;
inherit src;

meta = with stdenv.lib; {
homepage = http://www.rust-lang.org/;
description = "A safe, concurrent, practical language";
maintainers = with maintainers; [ qknight ];
license = [ licenses.mit licenses.asl20 ];
};

buildInputs = [ bash ] ++ stdenv.lib.optional stdenv.isDarwin Security;

postPatch = ''
patchShebangs .
'';

installPhase = ''
./install.sh --prefix=$out \
--components=${installComponents}
${optionalString (stdenv.isLinux && bootstrapping) ''
patchelf \
--set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
"$out/bin/rustc"
patchelf \
--set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
"$out/bin/rustdoc"
patchelf \
--set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
"$out/bin/cargo"
''}
${optionalString (stdenv.isDarwin && bootstrapping) ''
install_name_tool -change /usr/lib/libresolv.9.dylib '${darwin.libresolv}/lib/libresolv.9.dylib' "$out/bin/rustc"
install_name_tool -change /usr/lib/libresolv.9.dylib '${darwin.libresolv}/lib/libresolv.9.dylib' "$out/bin/rustdoc"
install_name_tool -change /usr/lib/libiconv.2.dylib '${darwin.libiconv}/lib/libiconv.2.dylib' "$out/bin/cargo"
install_name_tool -change /usr/lib/libresolv.9.dylib '${darwin.libresolv}/lib/libresolv.9.dylib' "$out/bin/cargo"
install_name_tool -change /usr/lib/libcurl.4.dylib '${stdenv.lib.getLib curl}/lib/libcurl.4.dylib' "$out/bin/cargo"
for f in $out/lib/lib*.dylib; do
install_name_tool -change /usr/lib/libresolv.9.dylib '${darwin.libresolv}/lib/libresolv.9.dylib' "$f"
done
''}
# Do NOT, I repeat, DO NOT use `wrapProgram` on $out/bin/rustc
# (or similar) here. It causes strange effects where rustc loads
# the wrong libraries in a bootstrap-build causing failures that
# are very hard to track down. For details, see
# https://github.com/rust-lang/rust/issues/34722#issuecomment-232164943
'';
};

cargo = stdenv.mkDerivation rec {
name = "cargo-${versionType}-${version}";

inherit version;
inherit src;

meta = with stdenv.lib; {
homepage = http://www.rust-lang.org/;
description = "A safe, concurrent, practical language";
maintainers = with maintainers; [ qknight ];
license = [ licenses.mit licenses.asl20 ];
};

buildInputs = [ makeWrapper bash ] ++ stdenv.lib.optional stdenv.isDarwin Security;

postPatch = ''
patchShebangs .
'';

installPhase = ''
patchShebangs ./install.sh
./install.sh --prefix=$out \
--components=cargo
${optionalString (stdenv.isLinux && bootstrapping) ''
patchelf \
--set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
"$out/bin/cargo"
''}
${optionalString (stdenv.isDarwin && bootstrapping) ''
install_name_tool -change /usr/lib/libiconv.2.dylib '${darwin.libiconv}/lib/libiconv.2.dylib' "$out/bin/cargo"
install_name_tool -change /usr/lib/libresolv.9.dylib '${darwin.libresolv}/lib/libresolv.9.dylib' "$out/bin/cargo"
install_name_tool -change /usr/lib/libcurl.4.dylib '${stdenv.lib.getLib curl}/lib/libcurl.4.dylib' "$out/bin/cargo"
''}
wrapProgram "$out/bin/cargo" \
--suffix PATH : "${rustc}/bin"
'';
};
}
42 changes: 42 additions & 0 deletions pkgs/development/compilers/rust/1.29/bootstrap.nix
@@ -0,0 +1,42 @@
{ stdenv, fetchurl, callPackage }:

let
# Note: the version MUST be one version prior to the version we're
# building
version = "1.28.0";

# fetch hashes by running `print-hashes.sh 1.24.1`
hashes = {
i686-unknown-linux-gnu = "de7cdb4e665e897ea9b10bf6fd545f900683296456d6a11d8510397bb330455f";
x86_64-unknown-linux-gnu = "2a1390340db1d24a9498036884e6b2748e9b4b057fc5219694e298bdaa37b810";
armv7-unknown-linux-gnueabihf = "346558d14050853b87049e5e1fbfae0bf0360a2f7c57433c6985b1a879c349a2";
aarch64-unknown-linux-gnu = "9b6fbcee73070332c811c0ddff399fa31965bec62ef258656c0c90354f6231c1";
i686-apple-darwin = "752e2c9182e057c4a54152d1e0b3949482c225d02bb69d9d9a4127dc2a65fb68";
x86_64-apple-darwin = "5d7a70ed4701fe9410041c1eea025c95cad97e5b3d8acc46426f9ac4f9f02393";
};

platform =
if stdenv.hostPlatform.system == "i686-linux"
then "i686-unknown-linux-gnu"
else if stdenv.hostPlatform.system == "x86_64-linux"
then "x86_64-unknown-linux-gnu"
else if stdenv.hostPlatform.system == "armv7l-linux"
then "armv7-unknown-linux-gnueabihf"
else if stdenv.hostPlatform.system == "aarch64-linux"
then "aarch64-unknown-linux-gnu"
else if stdenv.hostPlatform.system == "i686-darwin"
then "i686-apple-darwin"
else if stdenv.hostPlatform.system == "x86_64-darwin"
then "x86_64-apple-darwin"
else throw "missing bootstrap url for platform ${stdenv.hostPlatform.system}";

src = fetchurl {
url = "https://static.rust-lang.org/dist/rust-${version}-${platform}.tar.gz";
sha256 = hashes."${platform}";
};

in callPackage ./binaryBuild.nix
{ inherit version src platform;
buildRustPackage = null;
versionType = "bootstrap";
}
68 changes: 68 additions & 0 deletions pkgs/development/compilers/rust/1.29/cargo.nix
@@ -0,0 +1,68 @@
{ stdenv, file, curl, pkgconfig, python, openssl, cmake, zlib
, makeWrapper, libiconv, cacert, rustPlatform, rustc, libgit2, darwin
, version
, patches ? []
, src }:

let
inherit (darwin.apple_sdk.frameworks) CoreFoundation;
in

rustPlatform.buildRustPackage rec {
name = "cargo-${version}";
inherit version src patches;

# the rust source tarball already has all the dependencies vendored, no need to fetch them again
cargoVendorDir = "src/vendor";
preBuild = "cd src; pushd tools/cargo";
postBuild = "popd";

passthru.rustc = rustc;

# changes hash of vendor directory otherwise
dontUpdateAutotoolsGnuConfigScripts = true;

nativeBuildInputs = [ pkgconfig ];
buildInputs = [ cacert file curl python openssl cmake zlib makeWrapper libgit2 ]
++ stdenv.lib.optionals stdenv.isDarwin [ CoreFoundation libiconv ];

LIBGIT2_SYS_USE_PKG_CONFIG=1;

# fixes: the cargo feature `edition` requires a nightly version of Cargo, but this is the `stable` channel
RUSTC_BOOTSTRAP=1;

# FIXME: Use impure version of CoreFoundation because of missing symbols.
# CFURLSetResourcePropertyForKey is defined in the headers but there's no
# corresponding implementation in the sources from opensource.apple.com.
preConfigure = stdenv.lib.optionalString stdenv.isDarwin ''
export NIX_CFLAGS_COMPILE="-F${CoreFoundation}/Library/Frameworks $NIX_CFLAGS_COMPILE"
'';

postInstall = ''
# NOTE: We override the `http.cainfo` option usually specified in
# `.cargo/config`. This is an issue when users want to specify
# their own certificate chain as environment variables take
# precedence
wrapProgram "$out/bin/cargo" \
--suffix PATH : "${rustc}/bin" \
--set CARGO_HTTP_CAINFO "${cacert}/etc/ssl/certs/ca-bundle.crt" \
--set SSL_CERT_FILE "${cacert}/etc/ssl/certs/ca-bundle.crt"
'';

checkPhase = ''
# Disable cross compilation tests
export CFG_DISABLE_CROSS_TESTS=1
cargo test
'';

# Disable check phase as there are failures (4 tests fail)
doCheck = false;

meta = with stdenv.lib; {
homepage = https://crates.io;
description = "Downloads your Rust project's dependencies and builds your project";
maintainers = with maintainers; [ wizeman retrry ];
license = [ licenses.mit licenses.asl20 ];
platforms = platforms.unix;
};
}
52 changes: 52 additions & 0 deletions pkgs/development/compilers/rust/1.29/default.nix
@@ -0,0 +1,52 @@
{ stdenv, callPackage, recurseIntoAttrs, makeRustPlatform, llvm, fetchurl
, targets ? []
, targetToolchains ? []
, targetPatches ? []
}:

let
rustPlatform = recurseIntoAttrs (makeRustPlatform (callPackage ./bootstrap.nix {}));
version = "1.29.1";
cargoVersion = "1.29.1";
src = fetchurl {
url = "https://static.rust-lang.org/dist/rustc-${version}-src.tar.gz";
sha256 = "0jd3c57x3yndizns4pb68nh25si47agfmrdvf9nwwsyfcs5p5c7i";
};
in rec {
rustc = callPackage ./rustc.nix {
inherit stdenv llvm targets targetPatches targetToolchains rustPlatform version src;

patches = [
./patches/net-tcp-disable-tests.patch

# Re-evaluate if this we need to disable this one
#./patches/stdsimd-disable-doctest.patch

# Fails on hydra - not locally; the exact reason is unknown.
# Comments in the test suggest that some non-reproducible environment
# variables such $RANDOM can make it fail.
./patches/disable-test-inherit-env.patch
];

forceBundledLLVM = true;

configureFlags = [ "--release-channel=stable" ];

# 1. Upstream is not running tests on aarch64:
# see https://github.com/rust-lang/rust/issues/49807#issuecomment-380860567
# So we do the same.
# 2. Tests run out of memory for i686
#doCheck = !stdenv.isAarch64 && !stdenv.isi686;

# Disabled for now; see https://github.com/NixOS/nixpkgs/pull/42348#issuecomment-402115598.
doCheck = false;
};

cargo = callPackage ./cargo.nix rec {
version = cargoVersion;
inherit src;
inherit stdenv;
inherit rustc; # the rustc that will be wrapped by cargo
inherit rustPlatform; # used to build cargo
};
}
@@ -0,0 +1,10 @@
--- rustc-1.26.2-src.org/src/libstd/process.rs 2018-06-01 21:40:11.000000000 +0100
+++ rustc-1.26.2-src/src/libstd/process.rs 2018-06-08 07:50:23.023828658 +0100
@@ -1745,6 +1745,7 @@
}

#[test]
+ #[ignore]
fn test_inherit_env() {
use env;

0 comments on commit b4e3a40

Please sign in to comment.