uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead
https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948 this can do it nicely. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
commit
56de2bcd43
30691 changed files with 3076956 additions and 0 deletions
44
pkgs/build-support/fetchfirefoxaddon/default.nix
Normal file
44
pkgs/build-support/fetchfirefoxaddon/default.nix
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
{stdenv, unzip, jq, zip, fetchurl,writeScript, ...}:
|
||||
|
||||
{
|
||||
name
|
||||
, url ? null
|
||||
, md5 ? ""
|
||||
, sha1 ? ""
|
||||
, sha256 ? ""
|
||||
, sha512 ? ""
|
||||
, fixedExtid ? null
|
||||
, hash ? ""
|
||||
, src ? ""
|
||||
}:
|
||||
|
||||
let
|
||||
extid = if fixedExtid == null then "nixos@${name}" else fixedExtid;
|
||||
source = if url == null then src else fetchurl {
|
||||
url = url;
|
||||
inherit md5 sha1 sha256 sha512 hash;
|
||||
};
|
||||
in
|
||||
stdenv.mkDerivation {
|
||||
inherit name;
|
||||
|
||||
passthru = {
|
||||
inherit extid;
|
||||
};
|
||||
|
||||
builder = writeScript "xpibuilder" ''
|
||||
source $stdenv/setup
|
||||
|
||||
header "firefox addon $name into $out"
|
||||
|
||||
UUID="${extid}"
|
||||
mkdir -p "$out/$UUID"
|
||||
unzip -q ${source} -d "$out/$UUID"
|
||||
NEW_MANIFEST=$(jq '. + {"applications": { "gecko": { "id": "${extid}" }}, "browser_specific_settings":{"gecko":{"id": "${extid}"}}}' "$out/$UUID/manifest.json")
|
||||
echo "$NEW_MANIFEST" > "$out/$UUID/manifest.json"
|
||||
cd "$out/$UUID"
|
||||
zip -r -q -FS "$out/$UUID.xpi" *
|
||||
rm -r "$out/$UUID"
|
||||
'';
|
||||
nativeBuildInputs = [ unzip zip jq ];
|
||||
}
|
||||
21
pkgs/build-support/fetchfirefoxaddon/tests.nix
Normal file
21
pkgs/build-support/fetchfirefoxaddon/tests.nix
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
{ testers, fetchFirefoxAddon, fetchurl, ... }:
|
||||
|
||||
{
|
||||
simple = testers.invalidateFetcherByDrvHash fetchFirefoxAddon {
|
||||
name = "image-search-options";
|
||||
# Chosen because its only 147KB
|
||||
url = "https://addons.mozilla.org/firefox/downloads/file/3059971/image_search_options-3.0.12-fx.xpi";
|
||||
sha256 = "sha256-H73YWX/DKxvhEwKpWOo7orAQ7c/rQywpljeyxYxv0Gg=";
|
||||
};
|
||||
overidden-source =
|
||||
let
|
||||
image-search-options = fetchurl {
|
||||
url = "https://addons.mozilla.org/firefox/downloads/file/3059971/image_search_options-3.0.12-fx.xpi";
|
||||
sha256 = "sha256-H73YWX/DKxvhEwKpWOo7orAQ7c/rQywpljeyxYxv0Gg=";
|
||||
};
|
||||
in
|
||||
testers.invalidateFetcherByDrvHash fetchFirefoxAddon {
|
||||
name = "image-search-options";
|
||||
src = image-search-options;
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue