python-packages-overrides.nix
315 lines
| 7.2 KiB
| text/x-nix
|
NixLexer
/ pkgs / python-packages-overrides.nix
r1 | # Overrides for the generated python-packages.nix | |||
# | ||||
# This function is intended to be used as an extension to the generated file | ||||
# python-packages.nix. The main objective is to add needed dependencies of C | ||||
# libraries and tweak the build instructions where needed. | ||||
r2824 | { pkgs | |||
, basePythonPackages | ||||
}: | ||||
r1 | ||||
let | ||||
sed = "sed -i"; | ||||
r2824 | ||||
r202 | localLicenses = { | |||
repoze = { | ||||
fullName = "Repoze License"; | ||||
url = http://www.repoze.org/LICENSE.txt; | ||||
}; | ||||
r4756 | ||||
unlicense = { | ||||
spdxId = "Unlicense"; | ||||
fullName = "The Unlicense"; | ||||
url = http://unlicense.org/; | ||||
}; | ||||
r202 | }; | |||
Martin Bornhold
|
r716 | |||
r1 | in | |||
self: super: { | ||||
r2824 | "beaker" = super."beaker".override (attrs: { | |||
r2680 | patches = [ | |||
r3138 | ./patches/beaker/patch-beaker-lock-func-debug.diff | |||
./patches/beaker/patch-beaker-metadata-reuse.diff | ||||
r2680 | ]; | |||
}); | ||||
r3518 | "cffi" = super."cffi".override (attrs: { | |||
r4756 | buildInputs = with self; attrs.buildInputs ++ [ | |||
r3518 | pkgs.libffi | |||
]; | ||||
}); | ||||
"cryptography" = super."cryptography".override (attrs: { | ||||
r4756 | buildInputs = with self; attrs.buildInputs ++ [ | |||
r3518 | pkgs.openssl | |||
]; | ||||
}); | ||||
r2825 | "gevent" = super."gevent".override (attrs: { | |||
r4756 | propagatedBuildInputs = with self; attrs.propagatedBuildInputs ++ [ | |||
r2825 | # NOTE: (marcink) odd requirements from gevent aren't set properly, | |||
# thus we need to inject psutil manually | ||||
self."psutil" | ||||
]; | ||||
}); | ||||
r2824 | "gnureadline" = super."gnureadline".override (attrs: { | |||
r4756 | buildInputs = with self; attrs.buildInputs ++ [ | |||
r1 | pkgs.ncurses | |||
]; | ||||
patchPhase = '' | ||||
substituteInPlace setup.py --replace "/bin/bash" "${pkgs.bash}/bin/bash" | ||||
''; | ||||
}); | ||||
r2824 | "gunicorn" = super."gunicorn".override (attrs: { | |||
r4756 | propagatedBuildInputs = with self; attrs.propagatedBuildInputs ++ [ | |||
r143 | # johbo: futures is needed as long as we are on Python 2, otherwise | |||
# gunicorn explodes if used with multiple threads per worker. | ||||
r2824 | self."futures" | |||
r143 | ]; | |||
}); | ||||
r3217 | "nbconvert" = super."nbconvert".override (attrs: { | |||
r4756 | propagatedBuildInputs = with self; attrs.propagatedBuildInputs ++ [ | |||
r1488 | # marcink: plug in jupyter-client for notebook rendering | |||
r2824 | self."jupyter-client" | |||
r1488 | ]; | |||
}); | ||||
r2824 | "ipython" = super."ipython".override (attrs: { | |||
r4756 | propagatedBuildInputs = with self; attrs.propagatedBuildInputs ++ [ | |||
r2824 | self."gnureadline" | |||
r164 | ]; | |||
}); | ||||
r2824 | "lxml" = super."lxml".override (attrs: { | |||
r4756 | nativeBuildInputs = with self; attrs.nativeBuildInputs ++ [ | |||
pkgs.libxml2.dev | ||||
pkgs.libxslt.dev | ||||
self.cython | ||||
]; | ||||
buildInputs = with self; attrs.buildInputs ++ [ | ||||
r1 | pkgs.libxml2 | |||
pkgs.libxslt | ||||
r4756 | pkgs.zlib | |||
r1 | ]; | |||
r4756 | ||||
# propagatedBuildInputs = [ | ||||
# # Needed, so that "setup.py bdist_wheel" does work | ||||
# self."wheel" | ||||
# ]; | ||||
r1 | }); | |||
r4756 | "mysqlclient" = super."mysqlclient".override (attrs: { | |||
nativeBuildInputs = with self; attrs.nativeBuildInputs ++ [ | ||||
pkgs.libmysqlclient | ||||
r1 | pkgs.openssl | |||
pkgs.zlib | ||||
]; | ||||
r4756 | ||||
r1 | }); | |||
r2824 | "psycopg2" = super."psycopg2".override (attrs: { | |||
r4756 | nativeBuildInputs = with self; attrs.nativeBuildInputs ++ [ | |||
r1 | pkgs.postgresql | |||
]; | ||||
r202 | meta = { | |||
license = pkgs.lib.licenses.lgpl3Plus; | ||||
}; | ||||
r1 | }); | |||
r2824 | "pycurl" = super."pycurl".override (attrs: { | |||
r4756 | nativeBuildInputs = with self; attrs.nativeBuildInputs ++ [ | |||
pkgs.curl | ||||
pkgs.openssl | ||||
]; | ||||
propagatedBuildInputs = with self; attrs.propagatedBuildInputs ++ [ | ||||
r1 | pkgs.curl | |||
pkgs.openssl | ||||
]; | ||||
r3217 | ||||
r1 | preConfigure = '' | |||
substituteInPlace setup.py --replace '--static-libs' '--libs' | ||||
export PYCURL_SSL_LIBRARY=openssl | ||||
''; | ||||
r3217 | ||||
r202 | meta = { | |||
license = pkgs.lib.licenses.mit; | ||||
}; | ||||
r1 | }); | |||
r2824 | "pysqlite" = super."pysqlite".override (attrs: { | |||
r4756 | propagatedBuildInputs = with self; attrs.propagatedBuildInputs ++ [ | |||
r1 | pkgs.sqlite | |||
]; | ||||
r202 | meta = { | |||
license = [ pkgs.lib.licenses.zlib pkgs.lib.licenses.libpng ]; | ||||
}; | ||||
r1 | }); | |||
r2824 | "python-ldap" = super."python-ldap".override (attrs: { | |||
propagatedBuildInputs = attrs.propagatedBuildInputs ++ [ | ||||
pkgs.openldap | ||||
pkgs.cyrus_sasl | ||||
pkgs.openssl | ||||
r1 | ]; | |||
}); | ||||
r2824 | "python-pam" = super."python-pam".override (attrs: { | |||
r4756 | propagatedBuildInputs = with self; attrs.propagatedBuildInputs ++ [ | |||
r2824 | pkgs.pam | |||
r1 | ]; | |||
r3217 | ||||
r2824 | # TODO: johbo: Check if this can be avoided, or transform into | |||
# a real patch | ||||
patchPhase = '' | ||||
substituteInPlace pam.py \ | ||||
--replace 'find_library("pam")' '"${pkgs.pam}/lib/libpam.so.0"' | ||||
''; | ||||
r3217 | ||||
r2824 | }); | |||
r3217 | "python-saml" = super."python-saml".override (attrs: { | |||
r4756 | nativeBuildInputs = with self; attrs.nativeBuildInputs ++ [ | |||
r3217 | pkgs.libxml2 | |||
pkgs.libxslt | ||||
]; | ||||
}); | ||||
"dm.xmlsec.binding" = super."dm.xmlsec.binding".override (attrs: { | ||||
r4756 | nativeBuildInputs = with self; attrs.nativeBuildInputs ++ [ | |||
pkgs.libxml2.dev | ||||
pkgs.libxslt.dev | ||||
pkgs.xmlsec | ||||
pkgs.libtool | ||||
pkgs.zlib | ||||
]; | ||||
buildInputs = with self; attrs.buildInputs ++ [ | ||||
r3217 | pkgs.libxml2 | |||
pkgs.libxslt | ||||
pkgs.xmlsec | ||||
pkgs.libtool | ||||
r4756 | pkgs.zlib | |||
r3217 | ]; | |||
}); | ||||
r2824 | "pyzmq" = super."pyzmq".override (attrs: { | |||
buildInputs = [ | ||||
pkgs.czmq | ||||
]; | ||||
r1 | }); | |||
r4756 | "supervisor" = super."supervisor".override (attrs: { | |||
patches = [ | ||||
./patches/supervisor/patch-rlimits-old-kernel.diff | ||||
]; | ||||
}); | ||||
"py" = super."py".override (attrs: { | ||||
buildInputs = with self; attrs.buildInputs ++ [ | ||||
self."setuptools-scm" | ||||
]; | ||||
}); | ||||
"importlib-metadata" = super."importlib-metadata".override (attrs: { | ||||
buildInputs = with self; attrs.buildInputs ++ [ | ||||
self."setuptools-scm" | ||||
]; | ||||
}); | ||||
# License fixes | ||||
"appenlight-client" = super."appenlight-client".override (attrs: { | ||||
meta = { | ||||
license = [ pkgs.lib.licenses.bsdOriginal ]; | ||||
}; | ||||
}); | ||||
r2824 | "urlobject" = super."urlobject".override (attrs: { | |||
r201 | meta = { | |||
r4756 | license = localLicenses.unlicense; | |||
}; | ||||
}); | ||||
"future" = super."future".override (attrs: { | ||||
meta = { | ||||
license = [ pkgs.lib.licenses.mit ]; | ||||
}; | ||||
}); | ||||
"testpath" = super."testpath".override (attrs: { | ||||
meta = { | ||||
license = [ pkgs.lib.licenses.mit ]; | ||||
r201 | }; | |||
}); | ||||
r2824 | "docutils" = super."docutils".override (attrs: { | |||
r202 | meta = { | |||
license = pkgs.lib.licenses.bsd2; | ||||
}; | ||||
}); | ||||
r2824 | "colander" = super."colander".override (attrs: { | |||
r202 | meta = { | |||
license = localLicenses.repoze; | ||||
}; | ||||
}); | ||||
r2824 | "pyramid-beaker" = super."pyramid-beaker".override (attrs: { | |||
r202 | meta = { | |||
license = localLicenses.repoze; | ||||
}; | ||||
}); | ||||
r2824 | "pyramid-mako" = super."pyramid-mako".override (attrs: { | |||
r202 | meta = { | |||
license = localLicenses.repoze; | ||||
}; | ||||
}); | ||||
r4756 | "pyramid" = super."pyramid".override (attrs: { | |||
meta = { | ||||
license = localLicenses.repoze; | ||||
}; | ||||
}); | ||||
"pyramid-debugtoolbar" = super."pyramid-debugtoolbar".override (attrs: { | ||||
meta = { | ||||
license = [ pkgs.lib.licenses.bsdOriginal localLicenses.repoze ]; | ||||
}; | ||||
}); | ||||
r2824 | "repoze.lru" = super."repoze.lru".override (attrs: { | |||
r202 | meta = { | |||
license = localLicenses.repoze; | ||||
}; | ||||
}); | ||||
r2824 | "python-editor" = super."python-editor".override (attrs: { | |||
r202 | meta = { | |||
license = pkgs.lib.licenses.asl20; | ||||
}; | ||||
}); | ||||
r2824 | "translationstring" = super."translationstring".override (attrs: { | |||
r202 | meta = { | |||
license = localLicenses.repoze; | ||||
}; | ||||
}); | ||||
r2824 | "venusian" = super."venusian".override (attrs: { | |||
r202 | meta = { | |||
license = localLicenses.repoze; | ||||
}; | ||||
}); | ||||
r2824 | # Avoid that base packages screw up the build process | |||
inherit (basePythonPackages) | ||||
setuptools; | ||||
r1 | ||||
} | ||||