Repository navigation
Expand file tree
/
Copy pathrust.nix
More file actions
59 lines (56 loc) · 1.45 KB
/
Copy pathrust.nix
File metadata and controls
59 lines (56 loc) · 1.45 KB
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
55
56
57
58
59
{ pkgs, craneLib }:
let
sourceRoot = toString ./.;
source = pkgs.lib.cleanSourceWith {
src = ./.;
filter =
path: type:
let
relative = pkgs.lib.removePrefix "${sourceRoot}/" (toString path);
in
pkgs.lib.cleanSourceFilter path type
&& relative != ".raindex"
&& !(pkgs.lib.hasPrefix ".raindex/" relative)
&& relative != "infra"
&& !(pkgs.lib.hasPrefix "infra/" relative);
};
commonArgs = {
pname = "raindex-api";
version = "0.0.0-alpha.0";
src = source;
strictDeps = true;
cargoExtraArgs = "-p raindex_rest_api";
nativeBuildInputs = [
pkgs.pkg-config
]
++ pkgs.lib.optionals pkgs.stdenv.hostPlatform.isDarwin [ pkgs.darwin.DarwinTools ];
buildInputs = [
pkgs.libusb1
pkgs.openssl
pkgs.sqlite
]
++ pkgs.lib.optionals pkgs.stdenv.hostPlatform.isDarwin [ pkgs.apple-sdk_15 ];
};
cargoArtifacts = craneLib.buildDepsOnly commonArgs;
in
{
package = craneLib.buildPackage (
commonArgs
// {
inherit cargoArtifacts;
doCheck = true;
cargoTestExtraArgs = "-p raindex_rest_api";
meta = {
description = "Raindex public market data API";
homepage = "https://github.com/rainlanguage/rain.orderbook";
};
}
);
clippy = craneLib.cargoClippy (
commonArgs
// {
inherit cargoArtifacts;
cargoClippyExtraArgs = "-p raindex_rest_api --all-targets -- -D warnings";
}
);
}