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:
Anton Arapov 2021-04-03 12:58:10 +02:00 committed by Alan Daniels
commit 56de2bcd43
30691 changed files with 3076956 additions and 0 deletions

View file

@ -0,0 +1,49 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3
[[package]]
name = "aho-corasick"
version = "0.7.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f"
dependencies = [
"memchr",
]
[[package]]
name = "libc"
version = "0.2.125"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5916d2ae698f6de9bfb891ad7a8d65c09d232dc58cc4ac433c7da3b2fd84bc2b"
[[package]]
name = "memchr"
version = "2.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d"
[[package]]
name = "regex"
version = "1.5.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1a11647b6b25ff05a515cb92c365cec08801e83423a235b51e231e1808747286"
dependencies = [
"aho-corasick",
"memchr",
"regex-syntax",
]
[[package]]
name = "regex-syntax"
version = "0.6.25"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b"
[[package]]
name = "rure"
version = "0.2.1"
dependencies = [
"libc",
"regex",
]

View file

@ -0,0 +1,41 @@
{ lib
, stdenv
, rustPlatform
, fetchCrate
}:
let
pin = lib.importJSON ./pin.json;
in
rustPlatform.buildRustPackage {
inherit (pin) pname version;
src = fetchCrate pin;
# upstream doesn't ship a Cargo.lock, is generated by the update script
postPatch = ''
cp ${./Cargo.lock} Cargo.lock
'';
cargoLock.lockFile = ./Cargo.lock;
outputs = [ "out" "dev" ];
# Headers are not handled by cargo nor buildRustPackage
postInstall = ''
install -Dm644 include/rure.h -t "$dev/include"
'';
passthru.updateScript = ./update.sh;
meta = {
description = "A C API for Rust's regular expression library";
homepage = "https://crates.io/crates/rure";
license = [
lib.licenses.mit
lib.licenses.asl20
];
maintainers = [ lib.maintainers.sternenseemann ];
};
}

View file

@ -0,0 +1,5 @@
{
"pname": "rure",
"version": "0.2.1",
"sha256": "18sd1dfagf2338mp32kfjbqpc3n0agm61p044jl7yhy299ws21r8"
}

View file

@ -0,0 +1,51 @@
#!/usr/bin/env nix-shell
#! nix-shell -p nix jq curl cargo rsync
#! nix-shell -i bash
set -eu
cd "$(dirname "$0")"
crate=rure
echo "Getting latest version from crates.io API" >&2
curlOpts=(
-H "Accept: application/json"
-H "User-Agent: $crate update script (https://github.com/nixos/nixpkgs/)"
)
version="$(curl "${curlOpts[@]}" "https://crates.io/api/v1/crates/$crate" \
| jq -r .crate.max_stable_version)"
echo "Prefetching latest tarball from crates.io" >&2
url="https://crates.io/api/v1/crates/$crate/$version/download"
prefetch="$(nix-prefetch-url --print-path --type sha256 --unpack "$url")"
cat > pin.json <<EOF
{
"pname": "$crate",
"version": "$version",
"sha256": "$(printf '%s' "$prefetch" | head -n1)"
}
EOF
echo "Generating updated Cargo.lock" >&2
tmp="$(mktemp -d)"
cleanup() {
echo "Removing $tmp" >&2
rm -rf "$tmp"
}
trap cleanup EXIT
rsync -a --chmod=ugo=rwX "$(printf '%s' "$prefetch" | tail -n1)/" "$tmp"
pushd "$tmp"
cargo update
popd
cp "$tmp/Cargo.lock" ./Cargo.lock