mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-25 03:17:13 +00:00
571c71e6f7
We are migrating packages that meet below requirements: 1. using `callPackage` 2. called path is a directory 3. overriding set is empty (`{ }`) 4. not containing path expressions other than relative path (to makenixpkgs-vet happy) 5. not referenced by nix files outside of the directory, other than`pkgs/top-level/all-packages.nix` 6. not referencing nix files outside of the directory 7. not referencing `default.nix` (since it's changed to `package.nix`) 8. `outPath` doesn't change after migration The tool is here: https://github.com/Aleksanaa/by-name-migrate.
57 lines
1.2 KiB
Nix
57 lines
1.2 KiB
Nix
{ lib
|
|
, stdenv
|
|
, fetchFromGitHub
|
|
, cargo
|
|
, cmake
|
|
, rustc
|
|
, libiconv
|
|
}:
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "corrosion";
|
|
version = "0.5";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "corrosion-rs";
|
|
repo = "corrosion";
|
|
rev = "v${version}";
|
|
hash = "sha256-vaNXXXaGqYNmhonU+ANN857LAUgwv+PMcON+nBuUoeo=";
|
|
};
|
|
|
|
buildInputs = lib.optional stdenv.hostPlatform.isDarwin libiconv;
|
|
|
|
nativeBuildInputs = [
|
|
cmake
|
|
cargo
|
|
rustc
|
|
];
|
|
|
|
doCheck = true;
|
|
|
|
checkPhase = let
|
|
excludedTests = [
|
|
"cbindgen_rust2cpp_build"
|
|
"cbindgen_rust2cpp_run_cpp-exe"
|
|
"hostbuild_build"
|
|
"hostbuild_run_rust-host-program"
|
|
"parse_target_triple_build"
|
|
"rustup_proxy_build"
|
|
];
|
|
excludedTestsRegex = lib.concatStringsSep "|" excludedTests;
|
|
in ''
|
|
runHook preCheck
|
|
|
|
ctest -E "${excludedTestsRegex}"
|
|
|
|
runHook postCheck
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "Tool for integrating Rust into an existing CMake project";
|
|
homepage = "https://github.com/corrosion-rs/corrosion";
|
|
changelog = "https://github.com/corrosion-rs/corrosion/blob/${src.rev}/RELEASES.md";
|
|
license = licenses.mit;
|
|
maintainers = with maintainers; [ dotlambda ];
|
|
};
|
|
}
|