2020-06-18 11:19:44 +00:00
|
|
|
{ rustPlatform, stdenv, lib, fetchFromGitHub, fetchurl
|
|
|
|
, pkg-config, openssl
|
2020-08-16 18:29:02 +00:00
|
|
|
, CoreFoundation, libiconv, Security
|
2020-06-18 11:19:44 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "cargo-c";
|
2021-05-17 13:18:49 +00:00
|
|
|
version = "0.8.1";
|
2020-06-18 11:19:44 +00:00
|
|
|
|
|
|
|
src = stdenv.mkDerivation rec {
|
|
|
|
name = "${pname}-source-${version}";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "lu-zero";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2021-05-17 13:18:49 +00:00
|
|
|
sha256 = "0fd0xql5cbqgmir2z3ah91iasaq9133wmi5bnhiy3dv7drcqv4rc";
|
2020-06-18 11:19:44 +00:00
|
|
|
};
|
|
|
|
cargoLock = fetchurl {
|
|
|
|
url = "https://github.com/lu-zero/${pname}/releases/download/v${version}/Cargo.lock";
|
2021-05-17 13:18:49 +00:00
|
|
|
sha256 = "1xlh3h77rxhqyr1nkqyanb120lwdks6fklh202camqpmznd763g5";
|
2020-06-18 11:19:44 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out
|
|
|
|
cp -R ./* $out/
|
|
|
|
cp ${cargoLock} $out/Cargo.lock
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2021-05-17 13:18:49 +00:00
|
|
|
cargoSha256 = "0b952xkg0l31laqlhsv3cqdag7v15k9na6xr6q9y8xwy1fjh9gzv";
|
2020-06-18 11:19:44 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2020-08-16 18:29:02 +00:00
|
|
|
buildInputs = [ openssl ]
|
2021-01-23 12:26:19 +00:00
|
|
|
++ lib.optionals stdenv.isDarwin [ CoreFoundation libiconv Security ];
|
2020-06-18 11:19:44 +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;
|
2021-05-16 11:24:22 +00:00
|
|
|
maintainers = with maintainers; [ ];
|
2020-06-18 11:19:44 +00:00
|
|
|
};
|
|
|
|
}
|