2021-12-06 16:07:01 +00:00
|
|
|
{ lib
|
|
|
|
, rustPlatform
|
|
|
|
, fetchCrate
|
|
|
|
, pkg-config
|
|
|
|
, curl
|
|
|
|
, openssl
|
|
|
|
, stdenv
|
|
|
|
, CoreFoundation
|
|
|
|
, libiconv
|
|
|
|
, Security
|
2020-08-20 17:08:02 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "cargo-c";
|
2022-11-04 12:27:35 +00:00
|
|
|
version = "0.9.13";
|
2020-08-20 17:08:02 +00:00
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
src = fetchCrate {
|
|
|
|
inherit pname;
|
|
|
|
# this version may need to be updated along with package version
|
2022-11-04 12:27:35 +00:00
|
|
|
version = "${version}+cargo-0.65";
|
|
|
|
sha256 = "sha256-f/p+ZIvDe9JQ8GM82SEud7sRTlimNs/ADPevfdkhsfg=";
|
2020-08-20 17:08:02 +00:00
|
|
|
};
|
|
|
|
|
2022-11-04 12:27:35 +00:00
|
|
|
cargoSha256 = "sha256-JrlEWgKbTqQG/JYFqBR53eB58fa29c/+vIdSNGoS5Y0=";
|
2021-09-18 10:52:07 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [ pkg-config (lib.getDev curl) ];
|
2021-12-06 16:07:01 +00:00
|
|
|
buildInputs = [ openssl curl ] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
CoreFoundation
|
|
|
|
libiconv
|
|
|
|
Security
|
|
|
|
];
|
2020-08-20 17:08:02 +00:00
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
# Ensure that we are avoiding build of the curl vendored in curl-sys
|
|
|
|
doInstallCheck = stdenv.hostPlatform.libc == "glibc";
|
|
|
|
installCheckPhase = ''
|
|
|
|
runHook preInstallCheck
|
|
|
|
|
|
|
|
ldd "$out/bin/cargo-cbuild" | grep libcurl.so
|
|
|
|
|
|
|
|
runHook postInstallCheck
|
|
|
|
'';
|
|
|
|
|
2020-08-20 17:08:02 +00:00
|
|
|
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;
|
2021-05-20 23:08:51 +00:00
|
|
|
maintainers = with maintainers; [ ];
|
2020-08-20 17:08:02 +00:00
|
|
|
};
|
|
|
|
}
|