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