File tree 1 file changed +19
-17
lines changed
1 file changed +19
-17
lines changed Original file line number Diff line number Diff line change 26
26
craneLib = crane . lib . ${ system } ;
27
27
28
28
src = craneLib . cleanCargoSource ( craneLib . path ./. ) ;
29
+ # The following could be done automatically by Crane, but it will look for a
30
+ # top-level package name as well (not present in PineAPPL). Thus, doing it
31
+ # manually will save a Crane warning.
32
+ version =
33
+ ( builtins . fromTOML ( builtins . readFile ( src
34
+ + "/Cargo.toml" ) ) )
35
+ . workspace
36
+ . package
37
+ . version ;
29
38
commonArgs = {
30
- inherit src ;
39
+ inherit src version ;
31
40
strictDeps = false ;
32
41
buildInputs = with pkgs ; [ lhapdf ] ;
33
42
nativeBuildInputs = with pkgs ; [ pkg-config ] ;
43
+ doCheck = false ;
34
44
} ;
35
45
36
- individualCrateArgs =
37
- commonArgs
38
- // {
39
- inherit
40
- ( ( builtins . fromTOML ( builtins . readFile ( src
41
- + "/Cargo.toml" ) ) )
42
- . workspace
43
- . package )
44
- version
45
- ;
46
- doCheck = false ;
47
- } ;
48
-
49
46
fileSetForCrate = crate :
50
47
lib . fileset . toSource {
51
48
root = ./. ;
65
62
] ;
66
63
} ;
67
64
68
- cli = craneLib . buildPackage ( individualCrateArgs
65
+ defaultName = "pineappl" ;
66
+ cargoArtifacts = craneLib . buildDepsOnly ( commonArgs // { pname = defaultName ; } ) ;
67
+ cli = craneLib . buildPackage (
68
+ commonArgs
69
69
// {
70
- pname = "pineappl" ;
70
+ pname = defaultName ;
71
71
cargoExtraArgs = "-p pineappl_cli" ;
72
+ inherit cargoArtifacts ;
72
73
src = fileSetForCrate ./pineappl_cli ;
73
- } ) ;
74
+ }
75
+ ) ;
74
76
# TODO: build with maturin
75
77
py = null ;
76
78
in
You can’t perform that action at this time.
0 commit comments