blob: 2285579b0bbd6d3c00b4f7e59acec632dfa743e3 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
{ lib
, stdenv
, fetchFromGitHub
, cmake
, rustPlatform
}:
stdenv.mkDerivation rec {
pname = "corrosion";
version = "unstable-2021-02-23";
src = fetchFromGitHub {
owner = "AndrewGaspar";
repo = "corrosion";
rev = "e6c35c7e55a59c8223577b5abc4d253b4a82898b";
sha256 = "0vq6g3ggnqiln0q8gsr8rr5rrdgpfcgfly79jwcygxrviw37m44d";
};
patches = [
# https://github.com/AndrewGaspar/corrosion/issues/84
./cmake-install-full-dir.patch
];
cargoRoot = "generator";
cargoDeps = rustPlatform.fetchCargoTarball {
inherit src;
sourceRoot = "${src.name}/${cargoRoot}";
name = "${pname}-${version}";
sha256 = "1fsq8zzzq28fj2fh92wmg8kmdj4y10mcpdmlgxsygy5lbh4xs13f";
};
nativeBuildInputs = [
cmake
] ++ (with rustPlatform; [
cargoSetupHook
rust.cargo
rust.rustc
]);
cmakeFlags = [
"-DRust_CARGO=${rustPlatform.rust.cargo}/bin/cargo"
# tests cannot find cargo because Rust_CARGO is unset before tests
"-DCORROSION_BUILD_TESTS=OFF"
];
meta = with lib; {
description = "Tool for integrating Rust into an existing CMake project";
homepage = "https://github.com/AndrewGaspar/corrosion";
license = licenses.mit;
maintainers = with maintainers; [ dotlambda ];
};
}
|