rav1e: switch to fetchCrate

This commit is contained in:
figsoda 2021-10-07 21:10:22 -04:00
parent 10666c6613
commit 88b50fce11

View file

@ -1,4 +1,4 @@
{ stdenv, rustPlatform, rust, fetchurl, fetchFromGitHub, lib, nasm, cargo-c, libiconv }:
{ lib, rust, stdenv, rustPlatform, fetchCrate, nasm, cargo-c, libiconv }:
let
rustTargetPlatformSpec = rust.toRustTargetSpec stdenv.hostPlatform;
@ -6,29 +6,13 @@ in rustPlatform.buildRustPackage rec {
pname = "rav1e";
version = "0.4.1";
src = stdenv.mkDerivation rec {
name = "${pname}-${version}-source";
src = fetchFromGitHub {
owner = "xiph";
repo = "rav1e";
rev = "v${version}";
sha256 = "0jnq5a3fv6fzzbmprzfxidlcwwgblkwwm0135cfw741wjv7f7h6r";
};
cargoLock = fetchurl {
url = "https://github.com/xiph/rav1e/releases/download/v${version}/Cargo.lock";
sha256 = "14fi9wam9rs5206rvcd2f3sjpzq41pnfml14w74wn2ws3gpi46zn";
};
installPhase = ''
mkdir -p $out
cp -r ./* $out/
cp ${cargoLock} $out/Cargo.lock
'';
src = fetchCrate {
inherit pname version;
sha256 = "sha256-9fBAH1vuLJ3yu8X5+CQGLQFDlzTYoFBUTy3Muo6hLkw=";
};
cargoSha256 = "0miq6iiywwbxm6k0alnqg6bnd14pwc8vl9d8fgg6c0vjlfy5zhlb";
cargoSha256 = "sha256-QhWVqHcNjJF94uTvHGVnV8MTp2bYOuCEjaMBfViOLRo=";
nativeBuildInputs = [ nasm cargo-c ];
buildInputs = lib.optionals stdenv.isDarwin [ libiconv ];