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