##// END OF EJS Templates
dependencies: Add futures as a dependency of Gunicorn....
johbo -
r143:578aa36d default
parent child Browse files
Show More
@@ -1,151 +1,159 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 in
11 in
12
12
13 self: super: {
13 self: super: {
14
14
15 gnureadline = super.gnureadline.override (attrs: {
15 gnureadline = super.gnureadline.override (attrs: {
16 buildInputs = attrs.buildInputs ++ [
16 buildInputs = attrs.buildInputs ++ [
17 pkgs.ncurses
17 pkgs.ncurses
18 ];
18 ];
19 patchPhase = ''
19 patchPhase = ''
20 substituteInPlace setup.py --replace "/bin/bash" "${pkgs.bash}/bin/bash"
20 substituteInPlace setup.py --replace "/bin/bash" "${pkgs.bash}/bin/bash"
21 '';
21 '';
22 });
22 });
23
23
24 gunicorn = super.gunicorn.override (attrs: {
25 propagatedBuildInputs = attrs.propagatedBuildInputs ++ [
26 # johbo: futures is needed as long as we are on Python 2, otherwise
27 # gunicorn explodes if used with multiple threads per worker.
28 self.futures
29 ];
30 });
31
24 kombu = super.kombu.override (attrs: {
32 kombu = super.kombu.override (attrs: {
25 # The current version of kombu needs some patching to work with the
33 # The current version of kombu needs some patching to work with the
26 # other libs. Should be removed once we update celery and kombu.
34 # other libs. Should be removed once we update celery and kombu.
27 patches = [
35 patches = [
28 ./patch-kombu-py-2-7-11.diff
36 ./patch-kombu-py-2-7-11.diff
29 ./patch-kombu-msgpack.diff
37 ./patch-kombu-msgpack.diff
30 ];
38 ];
31 });
39 });
32
40
33 lxml = super.lxml.override (attrs: {
41 lxml = super.lxml.override (attrs: {
34 buildInputs = with self; [
42 buildInputs = with self; [
35 pkgs.libxml2
43 pkgs.libxml2
36 pkgs.libxslt
44 pkgs.libxslt
37 ];
45 ];
38 });
46 });
39
47
40 MySQL-python = super.MySQL-python.override (attrs: {
48 MySQL-python = super.MySQL-python.override (attrs: {
41 buildInputs = attrs.buildInputs ++ [
49 buildInputs = attrs.buildInputs ++ [
42 pkgs.openssl
50 pkgs.openssl
43 ];
51 ];
44 propagatedBuildInputs = attrs.propagatedBuildInputs ++ [
52 propagatedBuildInputs = attrs.propagatedBuildInputs ++ [
45 pkgs.mysql.lib
53 pkgs.mysql.lib
46 pkgs.zlib
54 pkgs.zlib
47 ];
55 ];
48 });
56 });
49
57
50 psutil = super.psutil.override (attrs: {
58 psutil = super.psutil.override (attrs: {
51 buildInputs = attrs.buildInputs ++
59 buildInputs = attrs.buildInputs ++
52 pkgs.lib.optional pkgs.stdenv.isDarwin pkgs.darwin.IOKit;
60 pkgs.lib.optional pkgs.stdenv.isDarwin pkgs.darwin.IOKit;
53 });
61 });
54
62
55 psycopg2 = super.psycopg2.override (attrs: {
63 psycopg2 = super.psycopg2.override (attrs: {
56 buildInputs = attrs.buildInputs ++
64 buildInputs = attrs.buildInputs ++
57 pkgs.lib.optional pkgs.stdenv.isDarwin pkgs.openssl;
65 pkgs.lib.optional pkgs.stdenv.isDarwin pkgs.openssl;
58 propagatedBuildInputs = attrs.propagatedBuildInputs ++ [
66 propagatedBuildInputs = attrs.propagatedBuildInputs ++ [
59 pkgs.postgresql
67 pkgs.postgresql
60 ];
68 ];
61 });
69 });
62
70
63 pycurl = super.pycurl.override (attrs: {
71 pycurl = super.pycurl.override (attrs: {
64 propagatedBuildInputs = attrs.propagatedBuildInputs ++ [
72 propagatedBuildInputs = attrs.propagatedBuildInputs ++ [
65 pkgs.curl
73 pkgs.curl
66 pkgs.openssl
74 pkgs.openssl
67 ];
75 ];
68 preConfigure = ''
76 preConfigure = ''
69 substituteInPlace setup.py --replace '--static-libs' '--libs'
77 substituteInPlace setup.py --replace '--static-libs' '--libs'
70 export PYCURL_SSL_LIBRARY=openssl
78 export PYCURL_SSL_LIBRARY=openssl
71 '';
79 '';
72 });
80 });
73
81
74 Pylons = super.Pylons.override (attrs: {
82 Pylons = super.Pylons.override (attrs: {
75 name = "Pylons-1.0.1-patch1";
83 name = "Pylons-1.0.1-patch1";
76 src = pkgs.fetchgit {
84 src = pkgs.fetchgit {
77 url = "https://code.rhodecode.com/upstream/pylons";
85 url = "https://code.rhodecode.com/upstream/pylons";
78 rev = "707354ee4261b9c10450404fc9852ccea4fd667d";
86 rev = "707354ee4261b9c10450404fc9852ccea4fd667d";
79 sha256 = "b2763274c2780523a335f83a1df65be22ebe4ff413a7bc9e9288d23c1f62032e";
87 sha256 = "b2763274c2780523a335f83a1df65be22ebe4ff413a7bc9e9288d23c1f62032e";
80 };
88 };
81 });
89 });
82
90
83 pyramid = super.pyramid.override (attrs: {
91 pyramid = super.pyramid.override (attrs: {
84 postFixup = ''
92 postFixup = ''
85 wrapPythonPrograms
93 wrapPythonPrograms
86 # TODO: johbo: "wrapPython" adds this magic line which
94 # TODO: johbo: "wrapPython" adds this magic line which
87 # confuses pserve.
95 # confuses pserve.
88 ${sed} '/import sys; sys.argv/d' $out/bin/.pserve-wrapped
96 ${sed} '/import sys; sys.argv/d' $out/bin/.pserve-wrapped
89 '';
97 '';
90 });
98 });
91
99
92 Pyro4 = super.Pyro4.override (attrs: {
100 Pyro4 = super.Pyro4.override (attrs: {
93 # TODO: Was not able to generate this version, needs further
101 # TODO: Was not able to generate this version, needs further
94 # investigation.
102 # investigation.
95 name = "Pyro4-4.35";
103 name = "Pyro4-4.35";
96 src = pkgs.fetchurl {
104 src = pkgs.fetchurl {
97 url = "https://pypi.python.org/packages/source/P/Pyro4/Pyro4-4.35.src.tar.gz";
105 url = "https://pypi.python.org/packages/source/P/Pyro4/Pyro4-4.35.src.tar.gz";
98 md5 = "cbe6cb855f086a0f092ca075005855f3";
106 md5 = "cbe6cb855f086a0f092ca075005855f3";
99 };
107 };
100 });
108 });
101
109
102 pysqlite = super.pysqlite.override (attrs: {
110 pysqlite = super.pysqlite.override (attrs: {
103 propagatedBuildInputs = [
111 propagatedBuildInputs = [
104 pkgs.sqlite
112 pkgs.sqlite
105 ];
113 ];
106 });
114 });
107
115
108 pytest-runner = super.pytest-runner.override (attrs: {
116 pytest-runner = super.pytest-runner.override (attrs: {
109 propagatedBuildInputs = [
117 propagatedBuildInputs = [
110 self.setuptools-scm
118 self.setuptools-scm
111 ];
119 ];
112 });
120 });
113
121
114 python-ldap = super.python-ldap.override (attrs: {
122 python-ldap = super.python-ldap.override (attrs: {
115 propagatedBuildInputs = attrs.propagatedBuildInputs ++ [
123 propagatedBuildInputs = attrs.propagatedBuildInputs ++ [
116 pkgs.cyrus_sasl
124 pkgs.cyrus_sasl
117 pkgs.openldap
125 pkgs.openldap
118 pkgs.openssl
126 pkgs.openssl
119 ];
127 ];
120 NIX_CFLAGS_COMPILE = "-I${pkgs.cyrus_sasl}/include/sasl";
128 NIX_CFLAGS_COMPILE = "-I${pkgs.cyrus_sasl}/include/sasl";
121 });
129 });
122
130
123 python-pam = super.python-pam.override (attrs:
131 python-pam = super.python-pam.override (attrs:
124 let
132 let
125 includeLibPam = pkgs.stdenv.isLinux;
133 includeLibPam = pkgs.stdenv.isLinux;
126 in {
134 in {
127 # TODO: johbo: Move the option up into the default.nix, we should
135 # TODO: johbo: Move the option up into the default.nix, we should
128 # include python-pam only on supported platforms.
136 # include python-pam only on supported platforms.
129 propagatedBuildInputs = attrs.propagatedBuildInputs ++
137 propagatedBuildInputs = attrs.propagatedBuildInputs ++
130 pkgs.lib.optional includeLibPam [
138 pkgs.lib.optional includeLibPam [
131 pkgs.pam
139 pkgs.pam
132 ];
140 ];
133 # TODO: johbo: Check if this can be avoided, or transform into
141 # TODO: johbo: Check if this can be avoided, or transform into
134 # a real patch
142 # a real patch
135 patchPhase = pkgs.lib.optionals includeLibPam ''
143 patchPhase = pkgs.lib.optionals includeLibPam ''
136 substituteInPlace pam.py \
144 substituteInPlace pam.py \
137 --replace 'find_library("pam")' '"${pkgs.pam}/lib/libpam.so.0"'
145 --replace 'find_library("pam")' '"${pkgs.pam}/lib/libpam.so.0"'
138 '';
146 '';
139 });
147 });
140
148
141 rhodecode-tools = super.rhodecode-tools.override (attrs: {
149 rhodecode-tools = super.rhodecode-tools.override (attrs: {
142 patches = [
150 patches = [
143 ./patch-rhodecode-tools-setup.diff
151 ./patch-rhodecode-tools-setup.diff
144 ];
152 ];
145 });
153 });
146
154
147 # Avoid that setuptools is replaced, this leads to trouble
155 # Avoid that setuptools is replaced, this leads to trouble
148 # with buildPythonPackage.
156 # with buildPythonPackage.
149 setuptools = basePythonPackages.setuptools;
157 setuptools = basePythonPackages.setuptools;
150
158
151 }
159 }
General Comments 0
You need to be logged in to leave comments. Login now