##// END OF EJS Templates
dev-env: Improve build inputs formatting.
Martin Bornhold -
r433:95232319 default
parent child Browse files
Show More
@@ -1,56 +1,58 b''
1 { pkgs ? (import <nixpkgs> {})
1 { pkgs ? (import <nixpkgs> {})
2 , vcsserverPath ? "./../rhodecode-vcsserver"
2 , vcsserverPath ? "./../rhodecode-vcsserver"
3 , vcsserverNix ? "shell.nix"
3 , vcsserverNix ? "shell.nix"
4 , doCheck ? true
4 , doCheck ? true
5 }:
5 }:
6
6
7 let
7 let
8
8
9 # Convert vcsserverPath to absolute path.
9 # Convert vcsserverPath to absolute path.
10 vcsserverAbsPath =
10 vcsserverAbsPath =
11 if pkgs.lib.strings.hasPrefix "/" vcsserverPath then
11 if pkgs.lib.strings.hasPrefix "/" vcsserverPath then
12 builtins.toPath "${vcsserverPath}"
12 builtins.toPath "${vcsserverPath}"
13 else
13 else
14 builtins.toPath ("${builtins.getEnv "PWD"}/${vcsserverPath}");
14 builtins.toPath ("${builtins.getEnv "PWD"}/${vcsserverPath}");
15
15
16 # Import vcsserver if nix file exists, otherwise set it to null.
16 # Import vcsserver if nix file exists, otherwise set it to null.
17 vcsserver =
17 vcsserver =
18 let
18 let
19 nixFile = "${vcsserverAbsPath}/${vcsserverNix}";
19 nixFile = "${vcsserverAbsPath}/${vcsserverNix}";
20 in
20 in
21 if pkgs.lib.pathExists "${nixFile}" then
21 if pkgs.lib.pathExists "${nixFile}" then
22 builtins.trace
22 builtins.trace
23 "Using local vcsserver from ${nixFile}"
23 "Using local vcsserver from ${nixFile}"
24 import "${nixFile}" {inherit pkgs;}
24 import "${nixFile}" {inherit pkgs;}
25 else
25 else
26 null;
26 null;
27
27
28 hasVcsserver = !isNull vcsserver;
28 hasVcsserver = !isNull vcsserver;
29
29
30 enterprise = import ./default.nix {
30 enterprise = import ./default.nix {
31 inherit pkgs doCheck;
31 inherit pkgs doCheck;
32 };
32 };
33
33
34 pythonPackages = enterprise.pythonPackages;
34 pythonPackages = enterprise.pythonPackages;
35
35
36 in enterprise.override (attrs: {
36 in enterprise.override (attrs: {
37 # Avoid that we dump any sources into the store when entering the shell and
37 # Avoid that we dump any sources into the store when entering the shell and
38 # make development a little bit more convenient.
38 # make development a little bit more convenient.
39 src = null;
39 src = null;
40
40
41 buildInputs = attrs.buildInputs ++
41 buildInputs =
42 pkgs.lib.optionals (hasVcsserver) vcsserver.propagatedNativeBuildInputs ++ [
42 attrs.buildInputs ++
43 pythonPackages.bumpversion
43 pkgs.lib.optionals (hasVcsserver) vcsserver.propagatedNativeBuildInputs ++
44 pythonPackages.invoke
44 (with pythonPackages; [
45 pythonPackages.ipdb
45 bumpversion
46 pythonPackages.locustio
46 invoke
47 ];
47 ipdb
48 locustio
49 ]);
48
50
49 shellHook = attrs.shellHook +
51 shellHook = attrs.shellHook +
50 pkgs.lib.strings.optionalString (hasVcsserver) ''
52 pkgs.lib.strings.optionalString (hasVcsserver) ''
51 # Setup the vcsserver development egg.
53 # Setup the vcsserver development egg.
52 pushd ${vcsserverAbsPath}
54 pushd ${vcsserverAbsPath}
53 python setup.py develop --prefix $tmp_path --allow-hosts ""
55 python setup.py develop --prefix $tmp_path --allow-hosts ""
54 popd
56 popd
55 '';
57 '';
56 })
58 })
General Comments 0
You need to be logged in to leave comments. Login now