forked from mirrors/nixpkgs
51 lines
1.6 KiB
Nix
51 lines
1.6 KiB
Nix
{ rustPlatform, stdenv, lib, fetchFromGitHub, fetchurl
|
|
, pkg-config, openssl
|
|
, CoreFoundation, libiconv, Security
|
|
}:
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
pname = "cargo-c";
|
|
version = "0.7.0";
|
|
|
|
src = stdenv.mkDerivation rec {
|
|
name = "${pname}-source-${version}";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "lu-zero";
|
|
repo = pname;
|
|
rev = "v${version}";
|
|
sha256 = "0pd1vnpy29fxmf47pvkyxd6bydar8cykfjx0f1bbw3gfk7vychbj";
|
|
};
|
|
cargoLock = fetchurl {
|
|
url = "https://github.com/lu-zero/${pname}/releases/download/v${version}/Cargo.lock";
|
|
sha256 = "10xhd5m63r928gfvr4djmis30mra8wdsx55kgin9kiig2kylx69h";
|
|
};
|
|
|
|
installPhase = ''
|
|
mkdir -p $out
|
|
cp -R ./* $out/
|
|
cp ${cargoLock} $out/Cargo.lock
|
|
'';
|
|
};
|
|
|
|
cargoSha256 = "1axg0kr8xsb5fm3r8qgc7s3g70pa8g9vc68d6icm7ms77phczx4r";
|
|
|
|
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 ];
|
|
};
|
|
}
|