##// END OF EJS Templates
svn: bumped to version 1.9.7 with latest security releases
marcink -
r253:b656298d default
parent child Browse files
Show More
@@ -1,157 +1,158 b''
1 # Nix environment for the community edition
1 # Nix environment for the community edition
2 #
2 #
3 # This shall be as lean as possible, just producing the rhodecode-vcsserver
3 # This shall be as lean as possible, just producing the rhodecode-vcsserver
4 # derivation. For advanced tweaks to pimp up the development environment we use
4 # derivation. For advanced tweaks to pimp up the development environment we use
5 # "shell.nix" so that it does not have to clutter this file.
5 # "shell.nix" so that it does not have to clutter this file.
6
6
7 { pkgs ? (import <nixpkgs> {})
7 { pkgs ? (import <nixpkgs> {})
8 , pythonPackages ? "python27Packages"
8 , pythonPackages ? "python27Packages"
9 , pythonExternalOverrides ? self: super: {}
9 , pythonExternalOverrides ? self: super: {}
10 , doCheck ? true
10 , doCheck ? true
11 }:
11 }:
12
12
13 let pkgs_ = pkgs; in
13 let pkgs_ = pkgs; in
14
14
15 let
15 let
16 pkgs = pkgs_.overridePackages (self: super: {
16 pkgs = pkgs_.overridePackages (self: super: {
17 # bump GIT version
17 # bump GIT version
18 git = pkgs.lib.overrideDerivation pkgs_.git (oldAttrs: {
18 git = pkgs.lib.overrideDerivation pkgs_.git (oldAttrs: {
19 name = "git-2.9.5";
19 name = "git-2.9.5";
20 src = pkgs.fetchurl {
20 src = pkgs.fetchurl {
21 url = "https://www.kernel.org/pub/software/scm/git/git-2.9.5.tar.xz";
21 url = "https://www.kernel.org/pub/software/scm/git/git-2.9.5.tar.xz";
22 sha256 = "00ir7qmgfszwrhxjzxwixk7wp35gxvvw467gr30bagwsrdza7gm4";
22 sha256 = "00ir7qmgfszwrhxjzxwixk7wp35gxvvw467gr30bagwsrdza7gm4";
23 };
23 };
24
24
25 });
25 });
26
26
27 # Override subversion derivation to
27 # Override subversion derivation to
28 # - activate python bindings
28 # - activate python bindings
29 subversion = let
29 subversion = let
30 subversionWithPython = super.subversion.override {
30 subversionWithPython = super.subversion.override {
31 httpSupport = true;
31 httpSupport = true;
32 pythonBindings = true;
32 pythonBindings = true;
33 python = self.python27Packages.python;
33 python = self.python27Packages.python;
34 };
34 };
35
35
36 in
36 in
37
37
38 pkgs.lib.overrideDerivation subversionWithPython (oldAttrs: {
38 pkgs.lib.overrideDerivation subversionWithPython (oldAttrs: {
39 patches = (oldAttrs.patches or []) ++
39 name = "subversion-1.9.7";
40 pkgs.lib.optionals pkgs.stdenv.isDarwin [
40 src = pkgs.fetchurl {
41 # johbo: "import svn.client" fails on darwin currently.
41 url = "https://www.apache.org/dist/subversion/subversion-1.9.7.tar.gz";
42 ./pkgs/subversion-1.9.4-darwin.patch
42 sha256 = "0g3cs2h008z8ymgkhbk54jp87bjh7y049rn42igj881yi2f20an7";
43 ];
43 };
44
44 });
45 });
45
46
46 });
47 });
47
48
48 inherit (pkgs.lib) fix extends;
49 inherit (pkgs.lib) fix extends;
49 basePythonPackages = with builtins; if isAttrs pythonPackages
50 basePythonPackages = with builtins; if isAttrs pythonPackages
50 then pythonPackages
51 then pythonPackages
51 else getAttr pythonPackages pkgs;
52 else getAttr pythonPackages pkgs;
52
53
53 elem = builtins.elem;
54 elem = builtins.elem;
54 basename = path: with pkgs.lib; last (splitString "/" path);
55 basename = path: with pkgs.lib; last (splitString "/" path);
55 startsWith = prefix: full: let
56 startsWith = prefix: full: let
56 actualPrefix = builtins.substring 0 (builtins.stringLength prefix) full;
57 actualPrefix = builtins.substring 0 (builtins.stringLength prefix) full;
57 in actualPrefix == prefix;
58 in actualPrefix == prefix;
58
59
59 src-filter = path: type: with pkgs.lib;
60 src-filter = path: type: with pkgs.lib;
60 let
61 let
61 ext = last (splitString "." path);
62 ext = last (splitString "." path);
62 in
63 in
63 !elem (basename path) [".hg" ".git" "__pycache__" ".eggs"
64 !elem (basename path) [".hg" ".git" "__pycache__" ".eggs"
64 "node_modules" "build" "data" "tmp"] &&
65 "node_modules" "build" "data" "tmp"] &&
65 !elem ext ["egg-info" "pyc"] &&
66 !elem ext ["egg-info" "pyc"] &&
66 !startsWith "result" path;
67 !startsWith "result" path;
67
68
68 rhodecode-vcsserver-src = builtins.filterSource src-filter ./.;
69 rhodecode-vcsserver-src = builtins.filterSource src-filter ./.;
69
70
70 pythonGeneratedPackages = self: basePythonPackages.override (a: {
71 pythonGeneratedPackages = self: basePythonPackages.override (a: {
71 inherit self;
72 inherit self;
72 }) // (scopedImport {
73 }) // (scopedImport {
73 self = self;
74 self = self;
74 super = basePythonPackages;
75 super = basePythonPackages;
75 inherit pkgs;
76 inherit pkgs;
76 inherit (pkgs) fetchurl fetchgit;
77 inherit (pkgs) fetchurl fetchgit;
77 } ./pkgs/python-packages.nix);
78 } ./pkgs/python-packages.nix);
78
79
79 pythonOverrides = import ./pkgs/python-packages-overrides.nix {
80 pythonOverrides = import ./pkgs/python-packages-overrides.nix {
80 inherit basePythonPackages pkgs;
81 inherit basePythonPackages pkgs;
81 };
82 };
82
83
83 version = builtins.readFile ./vcsserver/VERSION;
84 version = builtins.readFile ./vcsserver/VERSION;
84
85
85 pythonLocalOverrides = self: super: {
86 pythonLocalOverrides = self: super: {
86 rhodecode-vcsserver = super.rhodecode-vcsserver.override (attrs: {
87 rhodecode-vcsserver = super.rhodecode-vcsserver.override (attrs: {
87 inherit doCheck version;
88 inherit doCheck version;
88
89
89 name = "rhodecode-vcsserver-${version}";
90 name = "rhodecode-vcsserver-${version}";
90 releaseName = "RhodeCodeVCSServer-${version}";
91 releaseName = "RhodeCodeVCSServer-${version}";
91 src = rhodecode-vcsserver-src;
92 src = rhodecode-vcsserver-src;
92 dontStrip = true; # prevent strip, we don't need it.
93 dontStrip = true; # prevent strip, we don't need it.
93
94
94 propagatedBuildInputs = attrs.propagatedBuildInputs ++ ([
95 propagatedBuildInputs = attrs.propagatedBuildInputs ++ ([
95 pkgs.git
96 pkgs.git
96 pkgs.subversion
97 pkgs.subversion
97 ]);
98 ]);
98
99
99 # TODO: johbo: Make a nicer way to expose the parts. Maybe
100 # TODO: johbo: Make a nicer way to expose the parts. Maybe
100 # pkgs/default.nix?
101 # pkgs/default.nix?
101 passthru = {
102 passthru = {
102 pythonPackages = self;
103 pythonPackages = self;
103 };
104 };
104
105
105 # Add VCSServer bin directory to path so that tests can find 'vcsserver'.
106 # Add VCSServer bin directory to path so that tests can find 'vcsserver'.
106 preCheck = ''
107 preCheck = ''
107 export PATH="$out/bin:$PATH"
108 export PATH="$out/bin:$PATH"
108 '';
109 '';
109
110
110 # put custom attrs here
111 # put custom attrs here
111 checkPhase = ''
112 checkPhase = ''
112 runHook preCheck
113 runHook preCheck
113 PYTHONHASHSEED=random py.test -p no:sugar -vv --cov-config=.coveragerc --cov=vcsserver --cov-report=term-missing vcsserver
114 PYTHONHASHSEED=random py.test -p no:sugar -vv --cov-config=.coveragerc --cov=vcsserver --cov-report=term-missing vcsserver
114 runHook postCheck
115 runHook postCheck
115 '';
116 '';
116
117
117 postInstall = ''
118 postInstall = ''
118 echo "Writing meta information for rccontrol to nix-support/rccontrol"
119 echo "Writing meta information for rccontrol to nix-support/rccontrol"
119 mkdir -p $out/nix-support/rccontrol
120 mkdir -p $out/nix-support/rccontrol
120 cp -v vcsserver/VERSION $out/nix-support/rccontrol/version
121 cp -v vcsserver/VERSION $out/nix-support/rccontrol/version
121 echo "DONE: Meta information for rccontrol written"
122 echo "DONE: Meta information for rccontrol written"
122
123
123 # python based programs need to be wrapped
124 # python based programs need to be wrapped
124 ln -s ${self.pyramid}/bin/* $out/bin/
125 ln -s ${self.pyramid}/bin/* $out/bin/
125 ln -s ${self.gunicorn}/bin/gunicorn $out/bin/
126 ln -s ${self.gunicorn}/bin/gunicorn $out/bin/
126
127
127 # Symlink version control utilities
128 # Symlink version control utilities
128 #
129 #
129 # We ensure that always the correct version is available as a symlink.
130 # We ensure that always the correct version is available as a symlink.
130 # So that users calling them via the profile path will always use the
131 # So that users calling them via the profile path will always use the
131 # correct version.
132 # correct version.
132 ln -s ${pkgs.git}/bin/git $out/bin
133 ln -s ${pkgs.git}/bin/git $out/bin
133 ln -s ${self.mercurial}/bin/hg $out/bin
134 ln -s ${self.mercurial}/bin/hg $out/bin
134 ln -s ${pkgs.subversion}/bin/svn* $out/bin
135 ln -s ${pkgs.subversion}/bin/svn* $out/bin
135
136
136 for file in $out/bin/*;
137 for file in $out/bin/*;
137 do
138 do
138 wrapProgram $file \
139 wrapProgram $file \
139 --set PATH $PATH \
140 --set PATH $PATH \
140 --set PYTHONPATH $PYTHONPATH \
141 --set PYTHONPATH $PYTHONPATH \
141 --set PYTHONHASHSEED random
142 --set PYTHONHASHSEED random
142 done
143 done
143
144
144 '';
145 '';
145
146
146 });
147 });
147 };
148 };
148
149
149 # Apply all overrides and fix the final package set
150 # Apply all overrides and fix the final package set
150 myPythonPackages =
151 myPythonPackages =
151 (fix
152 (fix
152 (extends pythonExternalOverrides
153 (extends pythonExternalOverrides
153 (extends pythonLocalOverrides
154 (extends pythonLocalOverrides
154 (extends pythonOverrides
155 (extends pythonOverrides
155 pythonGeneratedPackages))));
156 pythonGeneratedPackages))));
156
157
157 in myPythonPackages.rhodecode-vcsserver
158 in myPythonPackages.rhodecode-vcsserver
1 NO CONTENT: file was removed
NO CONTENT: file was removed
General Comments 0
You need to be logged in to leave comments. Login now