Show More
@@ -1,208 +1,208 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 | args@ |
|
7 | args@ | |
8 | { system ? builtins.currentSystem |
|
8 | { system ? builtins.currentSystem | |
9 | , pythonPackages ? "python27Packages" |
|
9 | , pythonPackages ? "python27Packages" | |
10 | , pythonExternalOverrides ? self: super: {} |
|
10 | , pythonExternalOverrides ? self: super: {} | |
11 | , doCheck ? false |
|
11 | , doCheck ? false | |
12 | , ... |
|
12 | , ... | |
13 | }: |
|
13 | }: | |
14 |
|
14 | |||
15 | let |
|
15 | let | |
16 | pkgs_ = args.pkgs or (import <nixpkgs> { inherit system; }); |
|
16 | pkgs_ = args.pkgs or (import <nixpkgs> { inherit system; }); | |
17 | in |
|
17 | in | |
18 |
|
18 | |||
19 | let |
|
19 | let | |
20 | pkgs = import <nixpkgs> { |
|
20 | pkgs = import <nixpkgs> { | |
21 | overlays = [ |
|
21 | overlays = [ | |
22 | (import ./pkgs/overlays.nix) |
|
22 | (import ./pkgs/overlays.nix) | |
23 | ]; |
|
23 | ]; | |
24 | inherit |
|
24 | inherit | |
25 | (pkgs_) |
|
25 | (pkgs_) | |
26 | system; |
|
26 | system; | |
27 | }; |
|
27 | }; | |
28 |
|
28 | |||
29 | # Works with the new python-packages, still can fallback to the old |
|
29 | # Works with the new python-packages, still can fallback to the old | |
30 | # variant. |
|
30 | # variant. | |
31 | basePythonPackagesUnfix = basePythonPackages.__unfix__ or ( |
|
31 | basePythonPackagesUnfix = basePythonPackages.__unfix__ or ( | |
32 | self: basePythonPackages.override (a: { inherit self; })); |
|
32 | self: basePythonPackages.override (a: { inherit self; })); | |
33 |
|
33 | |||
34 | # Evaluates to the last segment of a file system path. |
|
34 | # Evaluates to the last segment of a file system path. | |
35 | basename = path: with pkgs.lib; last (splitString "/" path); |
|
35 | basename = path: with pkgs.lib; last (splitString "/" path); | |
36 | startsWith = prefix: full: let |
|
36 | startsWith = prefix: full: let | |
37 | actualPrefix = builtins.substring 0 (builtins.stringLength prefix) full; |
|
37 | actualPrefix = builtins.substring 0 (builtins.stringLength prefix) full; | |
38 | in actualPrefix == prefix; |
|
38 | in actualPrefix == prefix; | |
39 |
|
39 | |||
40 | # source code filter used as arugment to builtins.filterSource. |
|
40 | # source code filter used as arugment to builtins.filterSource. | |
41 | src-filter = path: type: with pkgs.lib; |
|
41 | src-filter = path: type: with pkgs.lib; | |
42 | let |
|
42 | let | |
43 | ext = last (splitString "." path); |
|
43 | ext = last (splitString "." path); | |
44 | parts = last (splitString "/" path); |
|
44 | parts = last (splitString "/" path); | |
45 | in |
|
45 | in | |
46 | !builtins.elem (basename path) [ |
|
46 | !builtins.elem (basename path) [ | |
47 | ".git" ".hg" "__pycache__" ".eggs" ".idea" ".dev" |
|
47 | ".git" ".hg" "__pycache__" ".eggs" ".idea" ".dev" | |
48 | "node_modules" "node_binaries" |
|
48 | "node_modules" "node_binaries" | |
49 | "build" "data" "result" "tmp"] && |
|
49 | "build" "data" "result" "tmp"] && | |
50 | !builtins.elem ext ["egg-info" "pyc"] && |
|
50 | !builtins.elem ext ["egg-info" "pyc"] && | |
51 | !startsWith "result" (basename path); |
|
51 | !startsWith "result" (basename path); | |
52 |
|
52 | |||
53 | sources = |
|
53 | sources = | |
54 | let |
|
54 | let | |
55 | inherit |
|
55 | inherit | |
56 | (pkgs.lib) |
|
56 | (pkgs.lib) | |
57 | all |
|
57 | all | |
58 | isString |
|
58 | isString | |
59 | attrValues; |
|
59 | attrValues; | |
60 |
|
60 | |||
61 | sourcesConfig = pkgs.config.rc.sources or {}; |
|
61 | sourcesConfig = pkgs.config.rc.sources or {}; | |
62 | in |
|
62 | in | |
63 | # Ensure that sources are configured as strings. Using a path |
|
63 | # Ensure that sources are configured as strings. Using a path | |
64 | # would result in a copy into the nix store. |
|
64 | # would result in a copy into the nix store. | |
65 | assert all isString (attrValues sourcesConfig); |
|
65 | assert all isString (attrValues sourcesConfig); | |
66 | sourcesConfig; |
|
66 | sourcesConfig; | |
67 |
|
67 | |||
68 | version = builtins.readFile "${rhodecode-vcsserver-src}/vcsserver/VERSION"; |
|
68 | version = builtins.readFile "${rhodecode-vcsserver-src}/vcsserver/VERSION"; | |
69 | rhodecode-vcsserver-src = builtins.filterSource src-filter ./.; |
|
69 | rhodecode-vcsserver-src = builtins.filterSource src-filter ./.; | |
70 |
|
70 | |||
71 | pythonLocalOverrides = self: super: { |
|
71 | pythonLocalOverrides = self: super: { | |
72 | rhodecode-vcsserver = |
|
72 | rhodecode-vcsserver = | |
73 | let |
|
73 | let | |
74 | releaseName = "RhodeCodeVCSServer-${version}"; |
|
74 | releaseName = "RhodeCodeVCSServer-${version}"; | |
75 | in super.rhodecode-vcsserver.override (attrs: { |
|
75 | in super.rhodecode-vcsserver.override (attrs: { | |
76 | inherit |
|
76 | inherit | |
77 | doCheck |
|
77 | doCheck | |
78 | version; |
|
78 | version; | |
79 |
|
79 | |||
80 | name = "rhodecode-vcsserver-${version}"; |
|
80 | name = "rhodecode-vcsserver-${version}"; | |
81 | releaseName = releaseName; |
|
81 | releaseName = releaseName; | |
82 | src = rhodecode-vcsserver-src; |
|
82 | src = rhodecode-vcsserver-src; | |
83 | dontStrip = true; # prevent strip, we don't need it. |
|
83 | dontStrip = true; # prevent strip, we don't need it. | |
84 |
|
84 | |||
85 | # expose following attributed outside |
|
85 | # expose following attributed outside | |
86 | passthru = { |
|
86 | passthru = { | |
87 | pythonPackages = self; |
|
87 | pythonPackages = self; | |
88 | vcs_pkgs = pkgs; |
|
88 | vcs_pkgs = pkgs; | |
89 | }; |
|
89 | }; | |
90 |
|
90 | |||
91 | buildInputs = |
|
91 | buildInputs = | |
92 | attrs.buildInputs or [] ++ [ |
|
92 | attrs.buildInputs or [] ++ [ | |
93 |
|
93 | |||
94 | ]; |
|
94 | ]; | |
95 |
|
95 | |||
96 | #NOTE: option to inject additional propagatedBuildInputs |
|
96 | #NOTE: option to inject additional propagatedBuildInputs | |
97 | propagatedBuildInputs = |
|
97 | propagatedBuildInputs = | |
98 | attrs.propagatedBuildInputs or [] ++ [ |
|
98 | attrs.propagatedBuildInputs or [] ++ [ | |
99 | pkgs.git |
|
99 | pkgs.git | |
100 | pkgs.subversion |
|
100 | pkgs.subversion | |
101 | ]; |
|
101 | ]; | |
102 |
|
102 | |||
103 | preBuild = '' |
|
103 | preBuild = '' | |
104 | export NIX_PATH=nixpkgs=${pkgs.path} |
|
104 | export NIX_PATH=nixpkgs=${pkgs.path} | |
105 | export SSL_CERT_FILE=${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt |
|
105 | export SSL_CERT_FILE=${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt | |
106 | ''; |
|
106 | ''; | |
107 |
|
107 | |||
108 | # Add bin directory to path so that tests can find 'vcsserver'. |
|
108 | # Add bin directory to path so that tests can find 'vcsserver'. | |
109 | preCheck = '' |
|
109 | preCheck = '' | |
110 | export PATH="$out/bin:$PATH" |
|
110 | export PATH="$out/bin:$PATH" | |
111 | ''; |
|
111 | ''; | |
112 |
|
112 | |||
113 | # custom check phase for testing |
|
113 | # custom check phase for testing | |
114 | checkPhase = '' |
|
114 | checkPhase = '' | |
115 | runHook preCheck |
|
115 | runHook preCheck | |
116 | PYTHONHASHSEED=random py.test -vv -p no:sugar -r xw --cov-config=.coveragerc --cov=vcsserver --cov-report=term-missing vcsserver |
|
116 | PYTHONHASHSEED=random py.test -vv -p no:sugar -r xw --cov-config=.coveragerc --cov=vcsserver --cov-report=term-missing vcsserver | |
117 | runHook postCheck |
|
117 | runHook postCheck | |
118 | ''; |
|
118 | ''; | |
119 |
|
119 | |||
120 | postCheck = '' |
|
120 | postCheck = '' | |
121 | echo "Cleanup of vcsserver/tests" |
|
121 | echo "Cleanup of vcsserver/tests" | |
122 | rm -rf $out/lib/${self.python.libPrefix}/site-packages/vcsserver/tests |
|
122 | rm -rf $out/lib/${self.python.libPrefix}/site-packages/vcsserver/tests | |
123 | ''; |
|
123 | ''; | |
124 |
|
124 | |||
125 | postInstall = '' |
|
125 | postInstall = '' | |
126 | echo "Writing vcsserver meta information for rccontrol to nix-support/rccontrol" |
|
126 | echo "Writing vcsserver meta information for rccontrol to nix-support/rccontrol" | |
127 | mkdir -p $out/nix-support/rccontrol |
|
127 | mkdir -p $out/nix-support/rccontrol | |
128 | cp -v vcsserver/VERSION $out/nix-support/rccontrol/version |
|
128 | cp -v vcsserver/VERSION $out/nix-support/rccontrol/version | |
129 | echo "DONE: vcsserver meta information for rccontrol written" |
|
129 | echo "DONE: vcsserver meta information for rccontrol written" | |
130 |
|
130 | |||
131 | mkdir -p $out/etc |
|
131 | mkdir -p $out/etc | |
132 | cp configs/production.ini $out/etc |
|
132 | cp configs/production.ini $out/etc | |
133 | echo "DONE: saved vcsserver production.ini into $out/etc" |
|
133 | echo "DONE: saved vcsserver production.ini into $out/etc" | |
134 |
|
134 | |||
135 | echo "saving env in $out/etc/env_vars.txt" |
|
135 | echo "saving env in $out/etc/env_vars.txt" | |
136 | touch $out/etc/env_vars.txt |
|
136 | touch $out/etc/env_vars.txt | |
137 | echo "# RhodeCode build env vars" >> $out/etc/env_vars.txt |
|
137 | echo "# RhodeCode build env vars" >> $out/etc/env_vars.txt | |
138 | echo "LOCALE_ARCHIVE=\"${pkgs.glibcLocales}/lib/locale/locale-archive\"" >> $out/etc/env_vars.txt |
|
138 | echo "LOCALE_ARCHIVE=\"${pkgs.glibcLocales}/lib/locale/locale-archive\"" >> $out/etc/env_vars.txt | |
139 | echo "LC_ALL=\"en_US.UTF-8\"" >> $out/etc/env_vars.txt |
|
139 | echo "LC_ALL=\"en_US.UTF-8\"" >> $out/etc/env_vars.txt | |
140 |
|
140 | |||
141 | # python based programs need to be wrapped |
|
141 | # python based programs need to be wrapped | |
142 | mkdir -p $out/bin |
|
142 | mkdir -p $out/bin | |
143 |
|
143 | |||
144 | # expose python |
|
144 | # expose python | |
145 |
ln -s ${s |
|
145 | ln -s ${pkgs.pythonWithSetuptools}/bin/python $out/bin/ | |
146 |
|
146 | |||
147 | # required binaries from dependencies |
|
147 | # required binaries from dependencies | |
148 | ln -s ${self.gunicorn}/bin/gunicorn $out/bin/ |
|
148 | ln -s ${self.gunicorn}/bin/gunicorn $out/bin/ | |
149 | ln -s ${self.pyramid}/bin/prequest $out/bin/ |
|
149 | ln -s ${self.pyramid}/bin/prequest $out/bin/ | |
150 | ln -s ${self.pyramid}/bin/pserve $out/bin/ |
|
150 | ln -s ${self.pyramid}/bin/pserve $out/bin/ | |
151 |
|
151 | |||
152 | # Symlink version control utilities |
|
152 | # Symlink version control utilities | |
153 | # We ensure that always the correct version is available as a symlink. |
|
153 | # We ensure that always the correct version is available as a symlink. | |
154 | # So that users calling them via the profile path will always use the |
|
154 | # So that users calling them via the profile path will always use the | |
155 | # correct version. Wrapping is required so those can "import" |
|
155 | # correct version. Wrapping is required so those can "import" | |
156 | # vcsserver python hooks. |
|
156 | # vcsserver python hooks. | |
157 |
|
157 | |||
158 | ln -s ${pkgs.git}/bin/git $out/bin |
|
158 | ln -s ${pkgs.git}/bin/git $out/bin | |
159 | ln -s ${self.mercurial}/bin/hg $out/bin |
|
159 | ln -s ${self.mercurial}/bin/hg $out/bin | |
160 | ln -s ${pkgs.subversion}/bin/svn* $out/bin |
|
160 | ln -s ${pkgs.subversion}/bin/svn* $out/bin | |
161 |
|
161 | |||
162 | echo "DONE: created symlinks into $out/bin" |
|
162 | echo "DONE: created symlinks into $out/bin" | |
163 | DEPS="$out/bin/*" |
|
163 | DEPS="$out/bin/*" | |
164 |
|
164 | |||
165 | # wrap only dependency scripts, they require to have full PYTHONPATH set |
|
165 | # wrap only dependency scripts, they require to have full PYTHONPATH set | |
166 | # to be able to import all packages |
|
166 | # to be able to import all packages | |
167 | for file in $DEPS; |
|
167 | for file in $DEPS; | |
168 | do |
|
168 | do | |
169 | wrapProgram $file \ |
|
169 | wrapProgram $file \ | |
170 | --prefix PATH : $PATH \ |
|
170 | --prefix PATH : $PATH \ | |
171 | --prefix PYTHONPATH : $PYTHONPATH \ |
|
171 | --prefix PYTHONPATH : $PYTHONPATH \ | |
172 | --set PYTHONHASHSEED random |
|
172 | --set PYTHONHASHSEED random | |
173 | done |
|
173 | done | |
174 |
|
174 | |||
175 | echo "DONE: vcsserver binary wrapping" |
|
175 | echo "DONE: vcsserver binary wrapping" | |
176 |
|
176 | |||
177 | ''; |
|
177 | ''; | |
178 |
|
178 | |||
179 | }); |
|
179 | }); | |
180 | }; |
|
180 | }; | |
181 |
|
181 | |||
182 |
|
182 | |||
183 | basePythonPackages = with builtins; |
|
183 | basePythonPackages = with builtins; | |
184 | if isAttrs pythonPackages then |
|
184 | if isAttrs pythonPackages then | |
185 | pythonPackages |
|
185 | pythonPackages | |
186 | else |
|
186 | else | |
187 | getAttr pythonPackages pkgs; |
|
187 | getAttr pythonPackages pkgs; | |
188 |
|
188 | |||
189 | pythonGeneratedPackages = import ./pkgs/python-packages.nix { |
|
189 | pythonGeneratedPackages = import ./pkgs/python-packages.nix { | |
190 | inherit pkgs; |
|
190 | inherit pkgs; | |
191 | inherit (pkgs) fetchurl fetchgit fetchhg; |
|
191 | inherit (pkgs) fetchurl fetchgit fetchhg; | |
192 | }; |
|
192 | }; | |
193 |
|
193 | |||
194 | pythonVCSServerOverrides = import ./pkgs/python-packages-overrides.nix { |
|
194 | pythonVCSServerOverrides = import ./pkgs/python-packages-overrides.nix { | |
195 | inherit pkgs basePythonPackages; |
|
195 | inherit pkgs basePythonPackages; | |
196 | }; |
|
196 | }; | |
197 |
|
197 | |||
198 | # Apply all overrides and fix the final package set |
|
198 | # Apply all overrides and fix the final package set | |
199 | myPythonPackagesUnfix = with pkgs.lib; |
|
199 | myPythonPackagesUnfix = with pkgs.lib; | |
200 | (extends pythonExternalOverrides |
|
200 | (extends pythonExternalOverrides | |
201 | (extends pythonLocalOverrides |
|
201 | (extends pythonLocalOverrides | |
202 | (extends pythonVCSServerOverrides |
|
202 | (extends pythonVCSServerOverrides | |
203 | (extends pythonGeneratedPackages |
|
203 | (extends pythonGeneratedPackages | |
204 | basePythonPackagesUnfix)))); |
|
204 | basePythonPackagesUnfix)))); | |
205 |
|
205 | |||
206 | myPythonPackages = (pkgs.lib.fix myPythonPackagesUnfix); |
|
206 | myPythonPackages = (pkgs.lib.fix myPythonPackagesUnfix); | |
207 |
|
207 | |||
208 | in myPythonPackages.rhodecode-vcsserver |
|
208 | in myPythonPackages.rhodecode-vcsserver |
@@ -1,17 +1,25 b'' | |||||
1 | { pkgs |
|
1 | { pkgs | |
2 | , pythonPackages |
|
2 | , pythonPackages | |
3 | }: |
|
3 | }: | |
4 |
|
4 | |||
5 | rec { |
|
5 | rec { | |
6 | pip2nix-src = pkgs.fetchzip { |
|
6 | pip2nix-src = pkgs.fetchzip { | |
7 | url = https://github.com/johbo/pip2nix/archive/51e6fdae34d0e8ded9efeef7a8601730249687a6.tar.gz; |
|
7 | url = https://github.com/johbo/pip2nix/archive/51e6fdae34d0e8ded9efeef7a8601730249687a6.tar.gz; | |
8 | sha256 = "02a4jjgi7lsvf8mhrxsd56s9a3yg20081rl9bgc2m84w60v2gbz2"; |
|
8 | sha256 = "02a4jjgi7lsvf8mhrxsd56s9a3yg20081rl9bgc2m84w60v2gbz2"; | |
9 | }; |
|
9 | }; | |
10 |
|
10 | |||
11 | pip2nix = import pip2nix-src { |
|
11 | pip2nix = import pip2nix-src { | |
12 | inherit |
|
12 | inherit | |
13 | pkgs |
|
13 | pkgs | |
14 | pythonPackages; |
|
14 | pythonPackages; | |
15 | }; |
|
15 | }; | |
16 |
|
16 | |||
|
17 | pip-tools = pythonPackages.pip-tools; | |||
|
18 | ||||
|
19 | setuptools = pythonPackages.setuptools; | |||
|
20 | ||||
|
21 | wheel = pythonPackages.wheel; | |||
|
22 | ||||
|
23 | pip = pythonPackages.pip; | |||
|
24 | ||||
17 | } |
|
25 | } |
@@ -1,72 +1,75 b'' | |||||
1 | self: super: { |
|
1 | self: super: { | |
2 |
|
2 | |||
|
3 | pythonWithSetuptools = self.python.withPackages(ps: with ps; [ | |||
|
4 | setuptools | |||
|
5 | ]); | |||
|
6 | ||||
3 | # change GIT version |
|
7 | # change GIT version | |
4 | # latest supported are in: https://github.com/NixOS/nixpkgs/tree/master/pkgs/applications/version-management/git-and-tools/git |
|
8 | # latest supported are in: https://github.com/NixOS/nixpkgs/tree/master/pkgs/applications/version-management/git-and-tools/git | |
5 | git = super.lib.overrideDerivation super.git (oldAttrs: { |
|
9 | git = super.lib.overrideDerivation super.git (oldAttrs: { | |
6 | name = "git-2.25.3"; |
|
10 | name = "git-2.25.3"; | |
7 | src = self.fetchurl { |
|
11 | src = self.fetchurl { | |
8 | url = "https://www.kernel.org/pub/software/scm/git/git-2.25.3.tar.xz"; |
|
12 | url = "https://www.kernel.org/pub/software/scm/git/git-2.25.3.tar.xz"; | |
9 | sha256 = "0yvr97cl0dvj3fwblq1mb0cp97v8hrn9l98p8b1jx8815mbsnz9h"; |
|
13 | sha256 = "0yvr97cl0dvj3fwblq1mb0cp97v8hrn9l98p8b1jx8815mbsnz9h"; | |
10 | }; |
|
14 | }; | |
11 |
|
15 | |||
12 | # patches come from: https://github.com/NixOS/nixpkgs/tree/master/pkgs/applications/version-management/git-and-tools/git |
|
16 | # patches come from: https://github.com/NixOS/nixpkgs/tree/master/pkgs/applications/version-management/git-and-tools/git | |
13 | patches = [ |
|
17 | patches = [ | |
14 | ./patches/git/docbook2texi.patch |
|
18 | ./patches/git/docbook2texi.patch | |
15 | ./patches/git/git-sh-i18n.patch |
|
19 | ./patches/git/git-sh-i18n.patch | |
16 | ./patches/git/ssh-path.patch |
|
20 | ./patches/git/ssh-path.patch | |
17 | ./patches/git/git-send-email-honor-PATH.patch |
|
21 | ./patches/git/git-send-email-honor-PATH.patch | |
18 | ./patches/git/installCheck-path.patch |
|
22 | ./patches/git/installCheck-path.patch | |
19 | ]; |
|
23 | ]; | |
20 |
|
24 | |||
21 | }); |
|
25 | }); | |
22 |
|
26 | |||
23 | libgit2rc = super.lib.overrideDerivation super.libgit2 (oldAttrs: { |
|
27 | libgit2rc = super.lib.overrideDerivation super.libgit2 (oldAttrs: { | |
24 | name = "libgit2-0.28.2"; |
|
28 | name = "libgit2-0.28.2"; | |
25 | version = "0.28.2"; |
|
29 | version = "0.28.2"; | |
26 |
|
30 | |||
27 | src = self.fetchFromGitHub { |
|
31 | src = self.fetchFromGitHub { | |
28 | owner = "libgit2"; |
|
32 | owner = "libgit2"; | |
29 | repo = "libgit2"; |
|
33 | repo = "libgit2"; | |
30 | rev = "v0.28.2"; |
|
34 | rev = "v0.28.2"; | |
31 | sha256 = "0cm8fvs05rj0baigs2133q5a0sm3pa234y8h6hmwhl2bz9xq3k4b"; |
|
35 | sha256 = "0cm8fvs05rj0baigs2133q5a0sm3pa234y8h6hmwhl2bz9xq3k4b"; | |
32 | }; |
|
36 | }; | |
33 |
|
37 | |||
34 | cmakeFlags = [ "-DTHREADSAFE=ON" "-DUSE_HTTPS=no"]; |
|
38 | cmakeFlags = [ "-DTHREADSAFE=ON" "-DUSE_HTTPS=no"]; | |
35 |
|
39 | |||
36 | buildInputs = [ |
|
40 | buildInputs = [ | |
37 | super.zlib |
|
41 | super.zlib | |
38 | super.libssh2 |
|
42 | super.libssh2 | |
39 | super.openssl |
|
43 | super.openssl | |
40 | super.curl |
|
44 | super.curl | |
41 | ]; |
|
45 | ]; | |
42 |
|
46 | |||
43 |
|
47 | |||
44 | }); |
|
48 | }); | |
45 |
|
49 | |||
46 | # Override subversion derivation to |
|
50 | # Override subversion derivation to | |
47 | # - activate python bindings |
|
51 | # - activate python bindings | |
48 | subversion = |
|
52 | subversion = | |
49 | let |
|
53 | let | |
50 | subversionWithPython = super.subversion.override { |
|
54 | subversionWithPython = super.subversion.override { | |
51 | httpSupport = true; |
|
55 | httpSupport = true; | |
52 | pythonBindings = true; |
|
56 | pythonBindings = true; | |
53 | python = self.python27Packages.python; |
|
57 | python = self.python27Packages.python; | |
54 | }; |
|
58 | }; | |
55 | in |
|
59 | in | |
56 | super.lib.overrideDerivation subversionWithPython (oldAttrs: { |
|
60 | super.lib.overrideDerivation subversionWithPython (oldAttrs: { | |
57 | name = "subversion-1.13.0"; |
|
61 | name = "subversion-1.13.0"; | |
58 | src = self.fetchurl { |
|
62 | src = self.fetchurl { | |
59 | url = "https://archive.apache.org/dist/subversion/subversion-1.13.0.tar.gz"; |
|
63 | url = "https://archive.apache.org/dist/subversion/subversion-1.13.0.tar.gz"; | |
60 | sha256 = "0cb9p7f5hg0l4k32hz8vmvy2r45igchq5sh4m366za5q0c649bfs"; |
|
64 | sha256 = "0cb9p7f5hg0l4k32hz8vmvy2r45igchq5sh4m366za5q0c649bfs"; | |
61 | }; |
|
65 | }; | |
62 |
|
66 | |||
63 | ## use internal lz4/utf8proc because it is stable and shipped with SVN |
|
67 | ## use internal lz4/utf8proc because it is stable and shipped with SVN | |
64 | configureFlags = oldAttrs.configureFlags ++ [ |
|
68 | configureFlags = oldAttrs.configureFlags ++ [ | |
65 | " --with-lz4=internal" |
|
69 | " --with-lz4=internal" | |
66 | " --with-utf8proc=internal" |
|
70 | " --with-utf8proc=internal" | |
67 | ]; |
|
71 | ]; | |
68 |
|
72 | |||
69 | }); |
|
73 | }); | |
70 |
|
74 | |||
71 |
|
||||
72 | } |
|
75 | } |
@@ -1,59 +1,60 b'' | |||||
1 | { pkgs ? (import <nixpkgs> {}) |
|
1 | { pkgs ? (import <nixpkgs> {}) | |
2 | , pythonPackages ? "python27Packages" |
|
2 | , pythonPackages ? "python27Packages" | |
3 | }: |
|
3 | }: | |
4 |
|
4 | |||
5 | with pkgs.lib; |
|
5 | with pkgs.lib; | |
6 |
|
6 | |||
7 | let |
|
7 | let | |
8 | _pythonPackages = pythonPackages; |
|
8 | _pythonPackages = pythonPackages; | |
9 |
|
9 | |||
10 | in |
|
10 | in | |
11 |
|
11 | |||
12 | let |
|
12 | let | |
13 | pythonPackages = getAttr _pythonPackages pkgs; |
|
13 | pythonPackages = getAttr _pythonPackages pkgs; | |
14 |
|
14 | |||
15 | pip2nix = import ./nix-common/pip2nix.nix { |
|
15 | pip2nix = import ./nix-common/pip2nix.nix { | |
16 | inherit |
|
16 | inherit | |
17 | pkgs |
|
17 | pkgs | |
18 | pythonPackages; |
|
18 | pythonPackages; | |
19 | }; |
|
19 | }; | |
20 |
|
20 | |||
21 | in |
|
21 | in | |
22 |
|
22 | |||
23 | pkgs.stdenv.mkDerivation { |
|
23 | pkgs.stdenv.mkDerivation { | |
24 | name = "pip2nix-generated"; |
|
24 | name = "pip2nix-generated"; | |
25 |
|
25 | |||
26 | buildInputs = [ |
|
26 | buildInputs = [ | |
27 | # Allows to generate python packages |
|
27 | # Allows to generate python packages | |
28 | pip2nix.pip2nix |
|
28 | pip2nix.pip2nix | |
29 | pythonPackages.pip-tools |
|
29 | pip2nix.pip | |
|
30 | pip2nix.pip-tools | |||
|
31 | ||||
30 | # compile using ffi |
|
32 | # compile using ffi | |
31 | pkgs.libffi |
|
33 | pkgs.libffi | |
32 |
|
34 | |||
33 | pkgs.apr |
|
35 | pkgs.apr | |
34 | pkgs.aprutil |
|
36 | pkgs.aprutil | |
35 | ]; |
|
37 | ]; | |
36 |
|
38 | |||
37 | shellHook = '' |
|
39 | shellHook = '' | |
38 | runHook preShellHook |
|
40 | runHook preShellHook | |
39 | echo "Setting SVN_* variables" |
|
41 | echo "Setting SVN_* variables" | |
40 | export SVN_LIBRARY_PATH=${pkgs.subversion}/lib |
|
42 | export SVN_LIBRARY_PATH=${pkgs.subversion}/lib | |
41 | export SVN_HEADER_PATH=${pkgs.subversion.dev}/include |
|
43 | export SVN_HEADER_PATH=${pkgs.subversion.dev}/include | |
42 | runHook postShellHook |
|
44 | runHook postShellHook | |
43 | ''; |
|
45 | ''; | |
44 |
|
46 | |||
45 | preShellHook = '' |
|
47 | preShellHook = '' | |
46 | echo "Starting Generate Shell" |
|
48 | echo "Starting Generate Shell" | |
47 | # set unpack source date to 1980 to fix ZIP problems that does not support <1980 |
|
49 | # set unpack source date to 1980 to fix ZIP problems that does not support <1980 | |
48 | export SOURCE_DATE_EPOCH=315532800 |
|
50 | export SOURCE_DATE_EPOCH=315532800 | |
49 | export TMPDIR=/tmp |
|
51 | export TMPDIR=/tmp | |
50 | export LOCALE_ARCHIVE="${pkgs.glibcLocales}/lib/locale/locale-archive" |
|
52 | export LOCALE_ARCHIVE="${pkgs.glibcLocales}/lib/locale/locale-archive" | |
51 | export LC_ALL="en_US.UTF-8" |
|
53 | export LC_ALL="en_US.UTF-8" | |
|
54 | export PYCURL_SSL_LIBRARY=openssl | |||
52 |
|
55 | |||
53 | # Custom prompt to distinguish from other dev envs. |
|
56 | # Custom prompt to distinguish from other dev envs. | |
54 | export PS1="\n\[\033[1;32m\][pip2nix-generate-shell]$\[\033[0m\] " |
|
57 | export PS1="\n\[\033[1;32m\][pip2nix-generate-shell]$\[\033[0m\] " | |
55 |
|
58 | |||
56 | export PYCURL_SSL_LIBRARY=openssl |
|
|||
57 |
|
||||
58 | ''; |
|
59 | ''; | |
59 | } |
|
60 | } |
General Comments 0
You need to be logged in to leave comments.
Login now