git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #37040 from taku0/firefox-59.0

firefox, firefox-bin: 58.0.2 -> 59.0, firefos-esr: 52.6.0esr -> 52.7.0esr [Critical security fixes]

commit92d18198ae3de723820fd3818f4cbc144be9e338 authorMichael Raskin <7c6f434c@mail.ru> dateFri 16 Mar 2018, 20:56 (9 years ago) parentb1747a1808e8f6
4 files changed+32−26
pkgs/applications/networking/browsers/firefox/common.nix+3−3 pkgs/applications/networking/browsers/firefox/packages.nix+6−19 pkgs/applications/networking/browsers/firefox/update.nix+4−2 pkgs/common-updater/scripts/update-source-version+19−2
pkgs/applications/networking/browsers/firefox/common.nix+3−3
@@ -221,7 +221,7 @@ stdenv.mkDerivation (rec {
221221
222222 postInstall = ''
223223 # For grsecurity kernels
224− paxmark m $out/lib/firefox-[0-9]*/{firefox,firefox-bin,plugin-container}
224+ paxmark m $out/lib/firefox*/{firefox,firefox-bin,plugin-container}
225225
226226 # Remove SDK cruft. FIXME: move to a separate output?
227227 rm -rf $out/share/idl $out/include $out/lib/firefox-devel-*
@@ -233,8 +233,8 @@ stdenv.mkDerivation (rec {
233233 postFixup = ''
234234 # Fix notifications. LibXUL uses dlopen for this, unfortunately; see #18712.
235235 patchelf --set-rpath "${lib.getLib libnotify
236− }/lib:$(patchelf --print-rpath "$out"/lib/firefox-*/libxul.so)" \
237− "$out"/lib/firefox-*/libxul.so
236+ }/lib:$(patchelf --print-rpath "$out"/lib/firefox*/libxul.so)" \
237+ "$out"/lib/firefox*/libxul.so
238238 '';
239239
240240 doInstallCheck = true;
pkgs/applications/networking/browsers/firefox/packages.nix+6−19
@@ -18,28 +18,15 @@ rec {
1818
1919 firefox = common rec {
2020 pname = "firefox";
21− version = "58.0.2";
21+ version = "59.0";
2222 src = fetchurl {
23− url = "mirror://mozilla/firefox/releases/${version}/source/firefox-${version}.source.tar.xz";
24− sha512 = "ff748780492fc66b3e44c7e7641f16206e4c09514224c62d37efac2c59877bdf428a3670bfb50407166d7b505d4e2ea020626fd776b87f6abb6bc5d2e54c773f";
23+ url = "https://hg.mozilla.org/releases/mozilla-release/archive/c61f5f5ead48c78a80c80db5c489bdc7cfaf8175.tar.bz2";
24+ sha512 = "03yybi1yp9g29jzdfgrq32r7a0gl2jz64w6ai8219cvhx8y95ahxfznj3vm29frrp6c18dk2nlpv2s89iczwm00lnn42r7dn6s6ppl9";
2525 };
2626
2727 patches = nixpkgsPatches ++ [
2828 ./no-buildconfig.patch
29−
30− # https://bugzilla.mozilla.org/show_bug.cgi?id=1430274
31− # Scheduled for firefox 59
32− (fetchpatch {
33− url = "https://bug1430274.bmoattachments.org/attachment.cgi?id=8943426";
34− sha256 = "12yfss3k61yilrb337dh2rffy5hh83d2f16gqrf5i56r9c33f7hf";
35− })
36−
37− # https://bugzilla.mozilla.org/show_bug.cgi?id=1388981
38− # Should have been fixed in firefox 57
39− ] ++ lib.optional stdenv.isi686 (fetchpatch {
40− url = "https://hg.mozilla.org/mozilla-central/raw-rev/15517c5a5d37";
41− sha256 = "1ba487p3hk4w2w7qqfxgv1y57vp86b8g3xhav2j20qd3j3phbbn7";
42− });
29+ ];
4330
4431 meta = {
4532 description = "A web browser built from Firefox source tree";
@@ -54,10 +41,10 @@ rec {
5441
5542 firefox-esr = common rec {
5643 pname = "firefox-esr";
57− version = "52.6.0esr";
44+ version = "52.7.1esr";
5845 src = fetchurl {
5946 url = "mirror://mozilla/firefox/releases/${version}/source/firefox-${version}.source.tar.xz";
60− sha512 = "cf583df34272b7ff8841c3b093ca0819118f9c36d23c6f9b3135db298e84ca022934bcd189add6473922b199b47330c0ecf14c303ab4177c03dbf26e64476fa4";
47+ sha512 = "0275ca9c093fd0dcf09cfd31a4bca8c6ddb87aa74ace6b273a62f61079eeed11c2c0330c52c5f76aa73ed97e9cd18aa63cee69387e1fe346a30e4f9affc91ba7";
6148 };
6249
6350 patches = nixpkgsPatches;
pkgs/applications/networking/browsers/firefox/update.nix+4−2
@@ -22,13 +22,15 @@ writeScript "update-${attrPath}" ''
2222 # - removes trailing slash
2323 # - sorts everything with semver in mind
2424 # - picks up latest release
25− version=`xidel $url --extract "//a" | \
25+ version=`xidel -s $url --extract "//a" | \
2626 grep "^[0-9.]*${versionSuffix}/$" | \
2727 sed s/[/]$// | \
2828 sort --version-sort | \
2929 tail -n 1`
3030
31+ source_url=`curl --silent $url$version/SOURCE | grep -o 'https://.*\.tar\.bz2'`
32+
3133 shasum=`curl --silent $url$version/SHA512SUMS | grep 'source\.tar\.xz' | cut -d ' ' -f 1`
3234
33− update-source-version ${attrPath} "$version" "$shasum"
35+ update-source-version ${attrPath} "$version" "$shasum" "$source_url"
3436''
pkgs/common-updater/scripts/update-source-version+19−2
@@ -6,10 +6,11 @@ die() {
66 exit 1
77}
88
9−# Usage: update-source-hash <attr> <version> [<new-source-hash>]
9+# Usage: update-source-hash <attr> <version> [<new-source-hash>] [<new-source-url>]
1010attr=$1
1111newVersion=$2
1212newHash=$3
13+newUrl=$4
1314
1415nixFile=$(nix-instantiate --eval --strict -A "$attr.meta.position" | sed -re 's/^"(.*):[0-9]+"$/\1/')
1516if [ ! -f "$nixFile" ]; then
@@ -27,6 +28,12 @@ if [ $(grep -c "$oldHash" "$nixFile") != 1 ]; then
2728 die "Couldn't locate old source hash '$oldHash' (or it appeared more than once) in '$nixFile'!"
2829fi
2930
31+oldUrl=$(nix-instantiate --eval -E "with import ./. {}; builtins.elemAt $attr.src.drvAttrs.urls 0" | tr -d '"')
32+
33+if [ -z "$oldUrl" ]; then
34+ die "Couldn't evaluate source url from '$attr.name'!"
35+fi
36+
3037drvName=$(nix-instantiate --eval -E "with import ./. {}; (builtins.parseDrvName $attr.name).name" | tr -d '"')
3138oldVersion=$(nix-instantiate --eval -E "with import ./. {}; $attr.version or (builtins.parseDrvName $attr.name).version" | tr -d '"')
3239
@@ -41,6 +48,7 @@ fi
4148
4249# Escape regex metacharacter that are allowed in store path names
4350oldVersion=$(echo "$oldVersion" | sed -re 's|[.+]|\\&|g')
51+oldUrl=$(echo "$oldUrl" | sed -re 's|[${}.+]|\\&|g')
4452
4553if [ $(grep -c -E "^\s*(let\b)?\s*version\s*=\s*\"$oldVersion\"" "$nixFile") = 1 ]; then
4654 pattern="/\bversion\b\s*=/ s|\"$oldVersion\"|\"$newVersion\"|"
@@ -56,6 +64,15 @@ if cmp -s "$nixFile" "$nixFile.bak"; then
5664 die "Failed to replace version '$oldVersion' to '$newVersion' in '$attr'!"
5765fi
5866
67+# Replace new URL
68+if [ -n "$newUrl" ]; then
69+ sed -i "$nixFile" -re "s|\"$oldUrl\"|\"$newUrl\"|"
70+
71+ if cmp -s "$nixFile" "$nixFile.bak"; then
72+ die "Failed to replace source URL '$oldUrl' to '$newUrl' in '$attr'!"
73+ fi
74+fi
75+
5976case "$oldHashAlgo" in
6077 sha256) hashLength=64 ;;
6178 sha512) hashLength=128 ;;
@@ -74,7 +91,7 @@ fi
7491if [ -z "$newHash" ]; then
7592 nix-build --no-out-link -A "$attr.src" 2>"$attr.fetchlog" >/dev/null || true
7693 # FIXME: use nix-build --hash here once https://github.com/NixOS/nix/issues/1172 is fixed
77− newHash=$(egrep -v "killing process|dependencies couldn't be built" "$attr.fetchlog" | tail -n2 | sed "s~output path .* has .* hash \(.*\) when .* was expected\|fixed-output derivation produced path '.*' with .* hash '\(.*\)' instead of the expected hash '.*'~\1\2~" | head -n1)
94+ newHash=$(egrep -v "killing process|dependencies couldn't be built" "$attr.fetchlog" | tail -n2 | sed "s~output path .* has .* hash ‘\(.*\)’ when .* was expected\|fixed-output derivation produced path '.*' with .* hash '\(.*\)' instead of the expected hash '.*'~\1\2~" | head -n1)
7895fi
7996
8097if [ -z "$newHash" ]; then