3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/tools/rust/cargo-c/default.nix
2021-01-29 18:12:47 +01:00

51 lines
1.6 KiB
Nix

{ rustPlatform, stdenv, lib, fetchFromGitHub, fetchurl
, pkg-config, openssl
, CoreFoundation, libiconv, Security
}:
rustPlatform.buildRustPackage rec {
pname = "cargo-c";
version = "0.7.2";
src = stdenv.mkDerivation rec {
name = "${pname}-source-${version}";
src = fetchFromGitHub {
owner = "lu-zero";
repo = pname;
rev = "v${version}";
sha256 = "1rgwj3kf31n4rz0b7jw67wsgyapdycfic7plm5gm4n9rlslp5ax5";
};
cargoLock = fetchurl {
url = "https://github.com/lu-zero/${pname}/releases/download/v${version}/Cargo.lock";
sha256 = "0jnawnkf4m7cqcq9iahnxa53l61a5riax400n96vxrqf3fa752c6";
};
installPhase = ''
mkdir -p $out
cp -R ./* $out/
cp ${cargoLock} $out/Cargo.lock
'';
};
cargoSha256 = "0svmhq64aqw1vidq8jmw7w4xhhnyp04vcs9yzhjyz25c4cn9grsf";
nativeBuildInputs = [ pkg-config ];
buildInputs = [ openssl ]
++ lib.optionals stdenv.isDarwin [ CoreFoundation libiconv Security ];
meta = with lib; {
description = "A cargo subcommand to build and install C-ABI compatibile dynamic and static libraries";
longDescription = ''
Cargo C-ABI helpers. A cargo applet that produces and installs a correct
pkg-config file, a static library and a dynamic library, and a C header
to be used by any C (and C-compatible) software.
'';
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; [ primeos ];
};
}