1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-25 03:17:13 +00:00
nixpkgs/pkgs/development/tools/rust/cargo-c/default.nix

51 lines
1.6 KiB
Nix
Raw Normal View History

{ rustPlatform, stdenv, lib, fetchFromGitHub, fetchurl
, pkg-config, openssl
2020-08-16 19:29:02 +01:00
, CoreFoundation, libiconv, Security
}:
rustPlatform.buildRustPackage rec {
pname = "cargo-c";
2021-01-17 10:56:43 +00:00
version = "0.7.1";
src = stdenv.mkDerivation rec {
name = "${pname}-source-${version}";
src = fetchFromGitHub {
owner = "lu-zero";
repo = pname;
rev = "v${version}";
2021-01-17 10:56:43 +00:00
sha256 = "1a348ys4lbgsr23px81kw985i5bp8z75wgzl9l2jv9sdzirpb8k4";
};
cargoLock = fetchurl {
url = "https://github.com/lu-zero/${pname}/releases/download/v${version}/Cargo.lock";
2021-01-17 10:56:43 +00:00
sha256 = "1f78wlid8jx26pqybmafzcl1656nnp87hdiib0v1p5k73mk4ymvy";
};
installPhase = ''
mkdir -p $out
cp -R ./* $out/
cp ${cargoLock} $out/Cargo.lock
'';
};
2021-01-17 10:56:43 +00:00
cargoSha256 = "1nj54igm57h9d8hhqdgkay2nnblcdxhpnha68jqvjazd8a0bq3la";
nativeBuildInputs = [ pkg-config ];
2020-08-16 19:29:02 +01:00
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 ];
};
}