2020-08-20 17:08:02 +00:00
|
|
|
{ rustPlatform, stdenv, lib, fetchFromGitHub, fetchurl
|
|
|
|
, pkg-config, openssl
|
|
|
|
, CoreFoundation, libiconv, Security
|
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "cargo-c";
|
2021-02-19 19:06:45 +00:00
|
|
|
version = "0.7.3";
|
2020-08-20 17:08:02 +00:00
|
|
|
|
|
|
|
src = stdenv.mkDerivation rec {
|
|
|
|
name = "${pname}-source-${version}";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "lu-zero";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2021-02-19 19:06:45 +00:00
|
|
|
sha256 = "0df87kx8dfq2fvz00k6advwg2iw9djkflhrbsjw0xhac78623c56";
|
2020-08-20 17:08:02 +00:00
|
|
|
};
|
|
|
|
cargoLock = fetchurl {
|
|
|
|
url = "https://github.com/lu-zero/${pname}/releases/download/v${version}/Cargo.lock";
|
2021-02-19 19:06:45 +00:00
|
|
|
sha256 = "18l54jf9q5xb908bwyyil1sblxxa9mkrgr33gm0r6nxicw6kf8in";
|
2020-08-20 17:08:02 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out
|
|
|
|
cp -R ./* $out/
|
|
|
|
cp ${cargoLock} $out/Cargo.lock
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2021-02-19 19:06:45 +00:00
|
|
|
cargoSha256 = "0z7sjfnnmld5bijn14c7v7arh0vzqmbkjk7bf9ky67acq2r2cv2f";
|
2020-08-20 17:08:02 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [ pkg-config ];
|
|
|
|
buildInputs = [ openssl ]
|
2021-02-05 17:12:51 +00:00
|
|
|
++ lib.optionals stdenv.isDarwin [ CoreFoundation libiconv Security ];
|
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;
|
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = with maintainers; [ primeos ];
|
|
|
|
};
|
|
|
|
}
|