##// END OF EJS Templates
nix: Add backwardsCompatibleFetchgit...
Martin Bornhold -
r716:4af5d93c default
parent child Browse files
Show More
@@ -1,281 +1,295 b''
1 # Overrides for the generated python-packages.nix
1 # Overrides for the generated python-packages.nix
2 #
2 #
3 # This function is intended to be used as an extension to the generated file
3 # This function is intended to be used as an extension to the generated file
4 # python-packages.nix. The main objective is to add needed dependencies of C
4 # python-packages.nix. The main objective is to add needed dependencies of C
5 # libraries and tweak the build instructions where needed.
5 # libraries and tweak the build instructions where needed.
6
6
7 { pkgs, basePythonPackages }:
7 { pkgs, basePythonPackages }:
8
8
9 let
9 let
10 sed = "sed -i";
10 sed = "sed -i";
11 localLicenses = {
11 localLicenses = {
12 repoze = {
12 repoze = {
13 fullName = "Repoze License";
13 fullName = "Repoze License";
14 url = http://www.repoze.org/LICENSE.txt;
14 url = http://www.repoze.org/LICENSE.txt;
15 };
15 };
16 };
16 };
17
18 # johbo: Interim bridge which allows us to build with the upcoming
19 # nixos.16.09 branch (unstable at the moment of writing this note) and the
20 # current stable nixos-16.03.
21 backwardsCompatibleFetchgit = { ... }@args:
22 let
23 origSources = pkgs.fetchgit args;
24 in
25 pkgs.lib.overrideDerivation origSources (oldAttrs: {
26 NIX_PREFETCH_GIT_CHECKOUT_HOOK = ''
27 find $out -name '.git*' -print0 | xargs -0 rm -rf
28 '';
29 });
30
17 in
31 in
18
32
19 self: super: {
33 self: super: {
20
34
21 appenlight-client = super.appenlight-client.override (attrs: {
35 appenlight-client = super.appenlight-client.override (attrs: {
22 meta = {
36 meta = {
23 license = [ pkgs.lib.licenses.bsdOriginal ];
37 license = [ pkgs.lib.licenses.bsdOriginal ];
24 };
38 };
25 });
39 });
26
40
27 future = super.future.override (attrs: {
41 future = super.future.override (attrs: {
28 meta = {
42 meta = {
29 license = [ pkgs.lib.licenses.mit ];
43 license = [ pkgs.lib.licenses.mit ];
30 };
44 };
31 });
45 });
32
46
33 gnureadline = super.gnureadline.override (attrs: {
47 gnureadline = super.gnureadline.override (attrs: {
34 buildInputs = attrs.buildInputs ++ [
48 buildInputs = attrs.buildInputs ++ [
35 pkgs.ncurses
49 pkgs.ncurses
36 ];
50 ];
37 patchPhase = ''
51 patchPhase = ''
38 substituteInPlace setup.py --replace "/bin/bash" "${pkgs.bash}/bin/bash"
52 substituteInPlace setup.py --replace "/bin/bash" "${pkgs.bash}/bin/bash"
39 '';
53 '';
40 });
54 });
41
55
42 gunicorn = super.gunicorn.override (attrs: {
56 gunicorn = super.gunicorn.override (attrs: {
43 propagatedBuildInputs = attrs.propagatedBuildInputs ++ [
57 propagatedBuildInputs = attrs.propagatedBuildInputs ++ [
44 # johbo: futures is needed as long as we are on Python 2, otherwise
58 # johbo: futures is needed as long as we are on Python 2, otherwise
45 # gunicorn explodes if used with multiple threads per worker.
59 # gunicorn explodes if used with multiple threads per worker.
46 self.futures
60 self.futures
47 ];
61 ];
48 });
62 });
49
63
50 ipython = super.ipython.override (attrs: {
64 ipython = super.ipython.override (attrs: {
51 propagatedBuildInputs = attrs.propagatedBuildInputs ++ [
65 propagatedBuildInputs = attrs.propagatedBuildInputs ++ [
52 self.gnureadline
66 self.gnureadline
53 ];
67 ];
54 });
68 });
55
69
56 kombu = super.kombu.override (attrs: {
70 kombu = super.kombu.override (attrs: {
57 # The current version of kombu needs some patching to work with the
71 # The current version of kombu needs some patching to work with the
58 # other libs. Should be removed once we update celery and kombu.
72 # other libs. Should be removed once we update celery and kombu.
59 patches = [
73 patches = [
60 ./patch-kombu-py-2-7-11.diff
74 ./patch-kombu-py-2-7-11.diff
61 ./patch-kombu-msgpack.diff
75 ./patch-kombu-msgpack.diff
62 ];
76 ];
63 });
77 });
64
78
65 lxml = super.lxml.override (attrs: {
79 lxml = super.lxml.override (attrs: {
66 buildInputs = with self; [
80 buildInputs = with self; [
67 pkgs.libxml2
81 pkgs.libxml2
68 pkgs.libxslt
82 pkgs.libxslt
69 ];
83 ];
70 });
84 });
71
85
72 MySQL-python = super.MySQL-python.override (attrs: {
86 MySQL-python = super.MySQL-python.override (attrs: {
73 buildInputs = attrs.buildInputs ++ [
87 buildInputs = attrs.buildInputs ++ [
74 pkgs.openssl
88 pkgs.openssl
75 ];
89 ];
76 propagatedBuildInputs = attrs.propagatedBuildInputs ++ [
90 propagatedBuildInputs = attrs.propagatedBuildInputs ++ [
77 pkgs.mysql.lib
91 pkgs.mysql.lib
78 pkgs.zlib
92 pkgs.zlib
79 ];
93 ];
80 });
94 });
81
95
82 psutil = super.psutil.override (attrs: {
96 psutil = super.psutil.override (attrs: {
83 buildInputs = attrs.buildInputs ++
97 buildInputs = attrs.buildInputs ++
84 pkgs.lib.optional pkgs.stdenv.isDarwin pkgs.darwin.IOKit;
98 pkgs.lib.optional pkgs.stdenv.isDarwin pkgs.darwin.IOKit;
85 });
99 });
86
100
87 psycopg2 = super.psycopg2.override (attrs: {
101 psycopg2 = super.psycopg2.override (attrs: {
88 buildInputs = attrs.buildInputs ++
102 buildInputs = attrs.buildInputs ++
89 pkgs.lib.optional pkgs.stdenv.isDarwin pkgs.openssl;
103 pkgs.lib.optional pkgs.stdenv.isDarwin pkgs.openssl;
90 propagatedBuildInputs = attrs.propagatedBuildInputs ++ [
104 propagatedBuildInputs = attrs.propagatedBuildInputs ++ [
91 pkgs.postgresql
105 pkgs.postgresql
92 ];
106 ];
93 meta = {
107 meta = {
94 license = pkgs.lib.licenses.lgpl3Plus;
108 license = pkgs.lib.licenses.lgpl3Plus;
95 };
109 };
96 });
110 });
97
111
98 py-gfm = super.py-gfm.override {
112 py-gfm = super.py-gfm.override {
99 src = pkgs.fetchgit {
113 src = backwardsCompatibleFetchgit {
100 url = "https://code.rhodecode.com/upstream/py-gfm";
114 url = "https://code.rhodecode.com/upstream/py-gfm";
101 rev = "0d66a19bc16e3d49de273c0f797d4e4781e8c0f2";
115 rev = "0d66a19bc16e3d49de273c0f797d4e4781e8c0f2";
102 sha256 = "0ryp74jyihd3ckszq31bml5jr3bciimhfp7va7kw6ld92930ksv3";
116 sha256 = "0ryp74jyihd3ckszq31bml5jr3bciimhfp7va7kw6ld92930ksv3";
103 };
117 };
104 };
118 };
105
119
106 pycurl = super.pycurl.override (attrs: {
120 pycurl = super.pycurl.override (attrs: {
107 propagatedBuildInputs = attrs.propagatedBuildInputs ++ [
121 propagatedBuildInputs = attrs.propagatedBuildInputs ++ [
108 pkgs.curl
122 pkgs.curl
109 pkgs.openssl
123 pkgs.openssl
110 ];
124 ];
111 preConfigure = ''
125 preConfigure = ''
112 substituteInPlace setup.py --replace '--static-libs' '--libs'
126 substituteInPlace setup.py --replace '--static-libs' '--libs'
113 export PYCURL_SSL_LIBRARY=openssl
127 export PYCURL_SSL_LIBRARY=openssl
114 '';
128 '';
115 meta = {
129 meta = {
116 # TODO: It is LGPL and MIT
130 # TODO: It is LGPL and MIT
117 license = pkgs.lib.licenses.mit;
131 license = pkgs.lib.licenses.mit;
118 };
132 };
119 });
133 });
120
134
121 Pylons = super.Pylons.override (attrs: {
135 Pylons = super.Pylons.override (attrs: {
122 name = "Pylons-1.0.1-patch1";
136 name = "Pylons-1.0.1-patch1";
123 src = pkgs.fetchgit {
137 src = backwardsCompatibleFetchgit {
124 url = "https://code.rhodecode.com/upstream/pylons";
138 url = "https://code.rhodecode.com/upstream/pylons";
125 rev = "707354ee4261b9c10450404fc9852ccea4fd667d";
139 rev = "707354ee4261b9c10450404fc9852ccea4fd667d";
126 sha256 = "b2763274c2780523a335f83a1df65be22ebe4ff413a7bc9e9288d23c1f62032e";
140 sha256 = "b2763274c2780523a335f83a1df65be22ebe4ff413a7bc9e9288d23c1f62032e";
127 };
141 };
128 });
142 });
129
143
130 pyramid = super.pyramid.override (attrs: {
144 pyramid = super.pyramid.override (attrs: {
131 postFixup = ''
145 postFixup = ''
132 wrapPythonPrograms
146 wrapPythonPrograms
133 # TODO: johbo: "wrapPython" adds this magic line which
147 # TODO: johbo: "wrapPython" adds this magic line which
134 # confuses pserve.
148 # confuses pserve.
135 ${sed} '/import sys; sys.argv/d' $out/bin/.pserve-wrapped
149 ${sed} '/import sys; sys.argv/d' $out/bin/.pserve-wrapped
136 '';
150 '';
137 meta = {
151 meta = {
138 license = localLicenses.repoze;
152 license = localLicenses.repoze;
139 };
153 };
140 });
154 });
141
155
142 pyramid-debugtoolbar = super.pyramid-debugtoolbar.override (attrs: {
156 pyramid-debugtoolbar = super.pyramid-debugtoolbar.override (attrs: {
143 meta = {
157 meta = {
144 license = [ pkgs.lib.licenses.bsdOriginal localLicenses.repoze ];
158 license = [ pkgs.lib.licenses.bsdOriginal localLicenses.repoze ];
145 };
159 };
146 });
160 });
147
161
148 Pyro4 = super.Pyro4.override (attrs: {
162 Pyro4 = super.Pyro4.override (attrs: {
149 # TODO: Was not able to generate this version, needs further
163 # TODO: Was not able to generate this version, needs further
150 # investigation.
164 # investigation.
151 name = "Pyro4-4.35";
165 name = "Pyro4-4.35";
152 src = pkgs.fetchurl {
166 src = pkgs.fetchurl {
153 url = "https://pypi.python.org/packages/source/P/Pyro4/Pyro4-4.35.src.tar.gz";
167 url = "https://pypi.python.org/packages/source/P/Pyro4/Pyro4-4.35.src.tar.gz";
154 md5 = "cbe6cb855f086a0f092ca075005855f3";
168 md5 = "cbe6cb855f086a0f092ca075005855f3";
155 };
169 };
156 });
170 });
157
171
158 pysqlite = super.pysqlite.override (attrs: {
172 pysqlite = super.pysqlite.override (attrs: {
159 propagatedBuildInputs = [
173 propagatedBuildInputs = [
160 pkgs.sqlite
174 pkgs.sqlite
161 ];
175 ];
162 meta = {
176 meta = {
163 license = [ pkgs.lib.licenses.zlib pkgs.lib.licenses.libpng ];
177 license = [ pkgs.lib.licenses.zlib pkgs.lib.licenses.libpng ];
164 };
178 };
165 });
179 });
166
180
167 pytest-runner = super.pytest-runner.override (attrs: {
181 pytest-runner = super.pytest-runner.override (attrs: {
168 propagatedBuildInputs = [
182 propagatedBuildInputs = [
169 self.setuptools-scm
183 self.setuptools-scm
170 ];
184 ];
171 });
185 });
172
186
173 python-ldap = super.python-ldap.override (attrs: {
187 python-ldap = super.python-ldap.override (attrs: {
174 propagatedBuildInputs = attrs.propagatedBuildInputs ++ [
188 propagatedBuildInputs = attrs.propagatedBuildInputs ++ [
175 pkgs.cyrus_sasl
189 pkgs.cyrus_sasl
176 pkgs.openldap
190 pkgs.openldap
177 pkgs.openssl
191 pkgs.openssl
178 ];
192 ];
179 NIX_CFLAGS_COMPILE = "-I${pkgs.cyrus_sasl}/include/sasl";
193 NIX_CFLAGS_COMPILE = "-I${pkgs.cyrus_sasl}/include/sasl";
180 });
194 });
181
195
182 python-pam = super.python-pam.override (attrs:
196 python-pam = super.python-pam.override (attrs:
183 let
197 let
184 includeLibPam = pkgs.stdenv.isLinux;
198 includeLibPam = pkgs.stdenv.isLinux;
185 in {
199 in {
186 # TODO: johbo: Move the option up into the default.nix, we should
200 # TODO: johbo: Move the option up into the default.nix, we should
187 # include python-pam only on supported platforms.
201 # include python-pam only on supported platforms.
188 propagatedBuildInputs = attrs.propagatedBuildInputs ++
202 propagatedBuildInputs = attrs.propagatedBuildInputs ++
189 pkgs.lib.optional includeLibPam [
203 pkgs.lib.optional includeLibPam [
190 pkgs.pam
204 pkgs.pam
191 ];
205 ];
192 # TODO: johbo: Check if this can be avoided, or transform into
206 # TODO: johbo: Check if this can be avoided, or transform into
193 # a real patch
207 # a real patch
194 patchPhase = pkgs.lib.optionals includeLibPam ''
208 patchPhase = pkgs.lib.optionals includeLibPam ''
195 substituteInPlace pam.py \
209 substituteInPlace pam.py \
196 --replace 'find_library("pam")' '"${pkgs.pam}/lib/libpam.so.0"'
210 --replace 'find_library("pam")' '"${pkgs.pam}/lib/libpam.so.0"'
197 '';
211 '';
198 });
212 });
199
213
200 rhodecode-tools = super.rhodecode-tools.override (attrs: {
214 rhodecode-tools = super.rhodecode-tools.override (attrs: {
201 patches = [
215 patches = [
202 ./patch-rhodecode-tools-setup.diff
216 ./patch-rhodecode-tools-setup.diff
203 ];
217 ];
204 });
218 });
205
219
206 URLObject = super.URLObject.override (attrs: {
220 URLObject = super.URLObject.override (attrs: {
207 meta = {
221 meta = {
208 license = {
222 license = {
209 spdxId = "Unlicense";
223 spdxId = "Unlicense";
210 fullName = "The Unlicense";
224 fullName = "The Unlicense";
211 url = http://unlicense.org/;
225 url = http://unlicense.org/;
212 };
226 };
213 };
227 };
214 });
228 });
215
229
216 amqplib = super.amqplib.override (attrs: {
230 amqplib = super.amqplib.override (attrs: {
217 meta = {
231 meta = {
218 license = pkgs.lib.licenses.lgpl3;
232 license = pkgs.lib.licenses.lgpl3;
219 };
233 };
220 });
234 });
221
235
222 docutils = super.docutils.override (attrs: {
236 docutils = super.docutils.override (attrs: {
223 meta = {
237 meta = {
224 license = pkgs.lib.licenses.bsd2;
238 license = pkgs.lib.licenses.bsd2;
225 };
239 };
226 });
240 });
227
241
228 colander = super.colander.override (attrs: {
242 colander = super.colander.override (attrs: {
229 meta = {
243 meta = {
230 license = localLicenses.repoze;
244 license = localLicenses.repoze;
231 };
245 };
232 });
246 });
233
247
234 pyramid-beaker = super.pyramid-beaker.override (attrs: {
248 pyramid-beaker = super.pyramid-beaker.override (attrs: {
235 meta = {
249 meta = {
236 license = localLicenses.repoze;
250 license = localLicenses.repoze;
237 };
251 };
238 });
252 });
239
253
240 pyramid-mako = super.pyramid-mako.override (attrs: {
254 pyramid-mako = super.pyramid-mako.override (attrs: {
241 meta = {
255 meta = {
242 license = localLicenses.repoze;
256 license = localLicenses.repoze;
243 };
257 };
244 });
258 });
245
259
246 repoze.lru = super.repoze.lru.override (attrs: {
260 repoze.lru = super.repoze.lru.override (attrs: {
247 meta = {
261 meta = {
248 license = localLicenses.repoze;
262 license = localLicenses.repoze;
249 };
263 };
250 });
264 });
251
265
252 recaptcha-client = super.recaptcha-client.override (attrs: {
266 recaptcha-client = super.recaptcha-client.override (attrs: {
253 meta = {
267 meta = {
254 # TODO: It is MIT/X11
268 # TODO: It is MIT/X11
255 license = pkgs.lib.licenses.mit;
269 license = pkgs.lib.licenses.mit;
256 };
270 };
257 });
271 });
258
272
259 python-editor = super.python-editor.override (attrs: {
273 python-editor = super.python-editor.override (attrs: {
260 meta = {
274 meta = {
261 license = pkgs.lib.licenses.asl20;
275 license = pkgs.lib.licenses.asl20;
262 };
276 };
263 });
277 });
264
278
265 translationstring = super.translationstring.override (attrs: {
279 translationstring = super.translationstring.override (attrs: {
266 meta = {
280 meta = {
267 license = localLicenses.repoze;
281 license = localLicenses.repoze;
268 };
282 };
269 });
283 });
270
284
271 venusian = super.venusian.override (attrs: {
285 venusian = super.venusian.override (attrs: {
272 meta = {
286 meta = {
273 license = localLicenses.repoze;
287 license = localLicenses.repoze;
274 };
288 };
275 });
289 });
276
290
277 # Avoid that setuptools is replaced, this leads to trouble
291 # Avoid that setuptools is replaced, this leads to trouble
278 # with buildPythonPackage.
292 # with buildPythonPackage.
279 setuptools = basePythonPackages.setuptools;
293 setuptools = basePythonPackages.setuptools;
280
294
281 }
295 }
General Comments 0
You need to be logged in to leave comments. Login now