Also regenerate hackage-packages.nix so it picks up on the newly added library and remove the broken flag no haskell.packages.ghc921.regex-rure which builds fine now (earlier GHC versions bundle incompatible bytestring versions).main
parent
d6e2f44abc
commit
452f76cfaf
@ -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.113" |
||||
source = "registry+https://github.com/rust-lang/crates.io-index" |
||||
checksum = "eef78b64d87775463c549fbd80e19249ef436ea3bf1de2a1eb7e717ec7fab1e9" |
||||
|
||||
[[package]] |
||||
name = "memchr" |
||||
version = "2.4.1" |
||||
source = "registry+https://github.com/rust-lang/crates.io-index" |
||||
checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" |
||||
|
||||
[[package]] |
||||
name = "regex" |
||||
version = "1.5.4" |
||||
source = "registry+https://github.com/rust-lang/crates.io-index" |
||||
checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461" |
||||
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", |
||||
] |
@ -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 ]; |
||||
}; |
||||
} |
@ -0,0 +1,5 @@ |
||||
{ |
||||
"pname": "rure", |
||||
"version": "0.2.1", |
||||
"sha256": "18sd1dfagf2338mp32kfjbqpc3n0agm61p044jl7yhy299ws21r8" |
||||
} |
@ -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 |
Loading…
Reference in new issue