Merge pull request #182193 from vtuan10/update-uniffi-bindgen

uniffi-bindgen: 0.17.0 -> 0.19.3
This commit is contained in:
Winter 2022-07-23 14:12:48 -04:00 committed by GitHub
commit 42e208ab90
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 461 additions and 267 deletions

File diff suppressed because it is too large Load diff

View file

@ -11,17 +11,16 @@
rustPlatform.buildRustPackage rec {
pname = "uniffi-bindgen";
version = "0.17.0";
version = "0.19.3";
src = fetchFromGitHub {
owner = "mozilla";
repo = "uniffi-rs";
rev = "v${version}";
hash = "sha256-EGyJrW0U/dnKT7OWgd8LehCyvj6mxud3QWbBVyhoK4Y=";
hash = "sha256-A6Zd1jfhoR4yW2lT5qYE3vJTpiJc94pK/XQmfE2QLFc=";
};
cargoLock.lockFileContents = builtins.readFile ./Cargo.lock;
cargoHash = "sha256-Fw+yCAI32NdFKJGPuNU6t0FiEfohoVD3VQfInNJuooI=";
cargoLock.lockFile = ./Cargo.lock;
cargoBuildFlags = [ "-p uniffi_bindgen" ];
cargoTestFlags = [ "-p uniffi_bindgen" ];
@ -36,6 +35,8 @@ rustPlatform.buildRustPackage rec {
--suffix PATH : ${lib.strings.makeBinPath [ rustfmt ktlint yapf rubocop ] }
'';
passthru.updateScript = ./update.sh;
meta = with lib; {
description = "Toolkit for building cross-platform software components in Rust";
homepage = "https://mozilla.github.io/uniffi-rs/";

View file

@ -0,0 +1,35 @@
#!/usr/bin/env nix-shell
#! nix-shell -p nix cargo rsync nix-update
#! nix-shell -i bash
set -euo pipefail
if [[ -z "${UPDATE_NIX_ATTR_PATH+x}" ]]; then
echo "Error: run the following command from nixpkgs root:" >&2
echo " nix-shell maintainers/scripts/update.nix --argstr package uniffi-bindgen" >&2
exit 1
fi
targetLockfile="$(dirname "$0")/Cargo.lock"
# Update version and hash
nix-update "$UPDATE_NIX_ATTR_PATH"
# Update lockfile through `cargo update`
src=$(nix-build -A "${UPDATE_NIX_ATTR_PATH}.src" --no-out-link)
tmp=$(mktemp -d)
cleanup() {
echo "Removing $tmp" >&2
rm -rf "$tmp"
}
trap cleanup EXIT
rsync -a --chmod=ugo=rwX "$src/" "$tmp"
pushd "$tmp"
cargo update
cp "Cargo.lock" "$targetLockfile"
popd