firefox, thunderbird: Use common-updater/update-source-version script
Replace the custom patching code with the common script. Also use callPackage and makeBinPath
This commit is contained in:
parent
9483359887
commit
e5e1bdca53
@ -5,7 +5,7 @@
|
|||||||
, hunspell, libevent, libstartup_notification, libvpx
|
, hunspell, libevent, libstartup_notification, libvpx
|
||||||
, cairo, gstreamer, gst_plugins_base, icu, libpng, jemalloc, libpulseaudio
|
, cairo, gstreamer, gst_plugins_base, icu, libpng, jemalloc, libpulseaudio
|
||||||
, autoconf213, which
|
, autoconf213, which
|
||||||
, writeScript, xidel, coreutils, gnused, gnugrep, curl, ed
|
, writeScript, xidel, common-updater-scripts, coreutils, gnused, gnugrep, curl
|
||||||
, enableGTK3 ? false
|
, enableGTK3 ? false
|
||||||
, debugBuild ? false
|
, debugBuild ? false
|
||||||
, # If you want the resulting program to call itself "Firefox" instead
|
, # If you want the resulting program to call itself "Firefox" instead
|
||||||
@ -151,8 +151,8 @@ in {
|
|||||||
version = "51.0.1";
|
version = "51.0.1";
|
||||||
sha512 = "556e31b717c0640ef5e181e00b9d2a6ea0ace7c16ae04333d0f2e9e120d0ab9efe82a4ca314ef43594c080523edf37953e65dbf694c7428be0a024f3719d8312";
|
sha512 = "556e31b717c0640ef5e181e00b9d2a6ea0ace7c16ae04333d0f2e9e120d0ab9efe82a4ca314ef43594c080523edf37953e65dbf694c7428be0a024f3719d8312";
|
||||||
updateScript = import ./update.nix {
|
updateScript = import ./update.nix {
|
||||||
name = "firefox";
|
attrPath = "firefox-unwrapped";
|
||||||
inherit writeScript xidel coreutils gnused gnugrep curl ed;
|
inherit writeScript lib common-updater-scripts xidel coreutils gnused gnugrep curl;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -161,9 +161,9 @@ in {
|
|||||||
version = "45.7.0esr";
|
version = "45.7.0esr";
|
||||||
sha512 = "6424101b6958191ce654d0619950dfbf98d4aa6bdd979306a2df8d6d30d3fecf1ab44638061a2b4fb1af85fe972f5ff49400e8eeda30cdcb9087c4b110b97a7d";
|
sha512 = "6424101b6958191ce654d0619950dfbf98d4aa6bdd979306a2df8d6d30d3fecf1ab44638061a2b4fb1af85fe972f5ff49400e8eeda30cdcb9087c4b110b97a7d";
|
||||||
updateScript = import ./update.nix {
|
updateScript = import ./update.nix {
|
||||||
name = "firefox-esr";
|
attrPath = "firefox-esr-unwrapped";
|
||||||
versionSuffix = "esr";
|
versionSuffix = "esr";
|
||||||
inherit writeScript xidel coreutils gnused gnugrep curl ed;
|
inherit writeScript lib common-updater-scripts xidel coreutils gnused gnugrep curl;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,23 +1,18 @@
|
|||||||
{ name
|
{ writeScript
|
||||||
, writeScript
|
, lib
|
||||||
, xidel
|
, xidel
|
||||||
|
, common-updater-scripts
|
||||||
, coreutils
|
, coreutils
|
||||||
, gnused
|
, gnused
|
||||||
, gnugrep
|
, gnugrep
|
||||||
, curl
|
, curl
|
||||||
, ed
|
, attrPath
|
||||||
, sourceSectionRegex ? "${name}-unwrapped = common"
|
|
||||||
, basePath ? "pkgs/applications/networking/browsers/firefox"
|
|
||||||
, baseUrl ? "http://archive.mozilla.org/pub/firefox/releases/"
|
, baseUrl ? "http://archive.mozilla.org/pub/firefox/releases/"
|
||||||
, versionSuffix ? ""
|
, versionSuffix ? ""
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
writeScript "update-${attrPath}" ''
|
||||||
version = (builtins.parseDrvName name).version;
|
PATH=${lib.makeBinPath [ common-updater-scripts coreutils curl gnugrep gnused xidel ]}
|
||||||
in writeScript "update-${name}" ''
|
|
||||||
PATH=${coreutils}/bin:${gnused}/bin:${gnugrep}/bin:${xidel}/bin:${curl}/bin:${ed}/bin
|
|
||||||
|
|
||||||
pushd ${basePath}
|
|
||||||
|
|
||||||
url=${baseUrl}
|
url=${baseUrl}
|
||||||
|
|
||||||
@ -35,20 +30,5 @@ in writeScript "update-${name}" ''
|
|||||||
|
|
||||||
shasum=`curl --silent $url$version/SHA512SUMS | grep 'source\.tar\.xz' | cut -d ' ' -f 1`
|
shasum=`curl --silent $url$version/SHA512SUMS | grep 'source\.tar\.xz' | cut -d ' ' -f 1`
|
||||||
|
|
||||||
ed default.nix <<COMMANDS
|
update-source-version ${attrPath} "$version" "$shasum"
|
||||||
# search line
|
|
||||||
/${sourceSectionRegex}/
|
|
||||||
# search version number line
|
|
||||||
/version/
|
|
||||||
# update the version
|
|
||||||
s/".*"/"$version"/
|
|
||||||
# search hash line
|
|
||||||
/sha512/
|
|
||||||
# update the hash
|
|
||||||
s/".*"/"$shasum"/
|
|
||||||
# write then quit
|
|
||||||
wq
|
|
||||||
COMMANDS
|
|
||||||
|
|
||||||
popd
|
|
||||||
''
|
''
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
{ stdenv, fetchurl, pkgconfig, which, m4, gtk2, pango, perl, python2, zip, libIDL
|
{ stdenv, lib, fetchurl, pkgconfig, which, m4, gtk2, pango, perl, python2, zip, libIDL
|
||||||
, libjpeg, libpng, zlib, dbus, dbus_glib, bzip2, xorg
|
, libjpeg, libpng, zlib, dbus, dbus_glib, bzip2, xorg
|
||||||
, freetype, fontconfig, file, alsaLib, nspr, nss, libnotify
|
, freetype, fontconfig, file, alsaLib, nspr, nss, libnotify
|
||||||
, yasm, mesa, sqlite, unzip, makeWrapper
|
, yasm, mesa, sqlite, unzip, makeWrapper
|
||||||
, hunspell, libevent, libstartup_notification, libvpx
|
, hunspell, libevent, libstartup_notification, libvpx
|
||||||
, cairo, gstreamer, gst_plugins_base, icu
|
, cairo, gstreamer, gst_plugins_base, icu
|
||||||
, writeScript, xidel, coreutils, gnused, gnugrep, curl, ed
|
, writeScript, xidel, common-updater-scripts, coreutils, gnused, gnugrep, curl
|
||||||
, debugBuild ? false
|
, debugBuild ? false
|
||||||
, # If you want the resulting program to call itself "Thunderbird"
|
, # If you want the resulting program to call itself "Thunderbird"
|
||||||
# instead of "Earlybird", enable this option. However, those
|
# instead of "Earlybird", enable this option. However, those
|
||||||
@ -140,10 +140,8 @@ stdenv.mkDerivation rec {
|
|||||||
};
|
};
|
||||||
|
|
||||||
passthru.updateScript = import ./../../browsers/firefox/update.nix {
|
passthru.updateScript = import ./../../browsers/firefox/update.nix {
|
||||||
name = "thunderbird";
|
attrPath = "thunderbird";
|
||||||
sourceSectionRegex = ".";
|
|
||||||
basePath = "pkgs/applications/networking/mailreaders/thunderbird";
|
|
||||||
baseUrl = "http://archive.mozilla.org/pub/thunderbird/releases/";
|
baseUrl = "http://archive.mozilla.org/pub/thunderbird/releases/";
|
||||||
inherit writeScript xidel coreutils gnused gnugrep curl ed;
|
inherit writeScript lib common-updater-scripts xidel coreutils gnused gnugrep curl;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user