Merge pull request #140914 from figsoda/remove-cargo-lock-staging

[staging] {cargo-c,rav1e}: switch to fetchCrate
This commit is contained in:
figsoda
2021-10-08 12:07:29 -04:00
committed by GitHub
2 changed files with 27 additions and 49 deletions
+21 -27
View File
@@ -1,39 +1,34 @@
{ rustPlatform, stdenv, lib, fetchFromGitHub, fetchurl
, pkg-config, curl, openssl
, CoreFoundation, libiconv, Security
{ lib
, rustPlatform
, fetchCrate
, pkg-config
, curl
, openssl
, stdenv
, CoreFoundation
, libiconv
, Security
}:
rustPlatform.buildRustPackage rec {
pname = "cargo-c";
version = "0.9.2";
src = stdenv.mkDerivation rec {
name = "${pname}-source-${version}";
src = fetchFromGitHub {
owner = "lu-zero";
repo = pname;
rev = "v${version}";
sha256 = "0hvlrhmbplx4cj4l5fynihgr9cdh0rkpwvipizk1gpp6p1ksr5hz";
};
cargoLock = fetchurl {
url = "https://github.com/lu-zero/${pname}/releases/download/v${version}/Cargo.lock";
sha256 = "0ckn31asz7013206j153ig96602dxvxm6skdz1plan0h05j5mgah";
};
installPhase = ''
mkdir -p $out
cp -R ./* $out/
cp ${cargoLock} $out/Cargo.lock
'';
src = fetchCrate {
inherit pname;
# this version may need to be updated along with package version
version = "${version}+cargo-0.55";
sha256 = "sha256-yh5vAtKlBvoSlJBsW2RSduSK6T8aOssM84WQMNjLZqA=";
};
cargoSha256 = "0c0vn2pcy5px02mc0l4a3w7z9n8hc6br5w3ww6nrav5w6911jp52";
cargoSha256 = "sha256-YikTjAeroaHyNe3ygUWRHSXJwdm2BSBV7RgIDN4suZ4=";
nativeBuildInputs = [ pkg-config (lib.getDev curl) ];
buildInputs = [ openssl curl ]
++ lib.optionals stdenv.isDarwin [ CoreFoundation libiconv Security ];
buildInputs = [ openssl curl ] ++ lib.optionals stdenv.isDarwin [
CoreFoundation
libiconv
Security
];
# Ensure that we are avoiding build of the curl vendored in curl-sys
doInstallCheck = stdenv.hostPlatform.libc == "glibc";
@@ -55,7 +50,6 @@ rustPlatform.buildRustPackage rec {
homepage = "https://github.com/lu-zero/cargo-c";
changelog = "https://github.com/lu-zero/cargo-c/releases/tag/v${version}";
license = licenses.mit;
platforms = platforms.unix;
maintainers = with maintainers; [ ];
};
}
+6 -22
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 ];