depot/third_party/nixpkgs/pkgs/development/tools/rust/cargo-c/default.nix
Default email 9c6d255489 Project import generated by Copybara.
GitOrigin-RevId: 8133b9cb5f7c00d4fe31c8c2c4b525bc2650bfc0
2020-10-16 20:44:37 +00:00

50 lines
1.6 KiB
Nix

{ rustPlatform, stdenv, lib, fetchFromGitHub, fetchurl
, pkg-config, openssl
, CoreFoundation, libiconv, Security
}:
rustPlatform.buildRustPackage rec {
pname = "cargo-c";
version = "0.6.15";
src = stdenv.mkDerivation rec {
name = "${pname}-source-${version}";
src = fetchFromGitHub {
owner = "lu-zero";
repo = pname;
rev = "v${version}";
sha256 = "04hrk3vy8294vxcsggdpcs8hg3ykzj2564ifsqc4zwz4b4wd1p8l";
};
cargoLock = fetchurl {
url = "https://github.com/lu-zero/${pname}/releases/download/v${version}/Cargo.lock";
sha256 = "0rqb6ssqsdlm8zbshbxkwxlyy7j7p2gyficavzz33cw9g6fpmzbd";
};
installPhase = ''
mkdir -p $out
cp -R ./* $out/
cp ${cargoLock} $out/Cargo.lock
'';
};
cargoSha256 = "1q2s28nqd6l9qmhmdksdjjlypxry5ff18i2pgwmgiilcry51mj4b";
nativeBuildInputs = [ pkg-config ];
buildInputs = [ openssl ]
++ stdenv.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 ];
};
}