1{ lib, fetchurl, buildPythonPackage, python, isPyPy, sip-module ? "sip" }:
2
3buildPythonPackage rec {
4 pname = sip-module;
5 version = "4.19.24";
6 format = "other";
7
8 disabled = isPyPy;
9
10 src = fetchurl {
11 url = "https://www.riverbankcomputing.com/static/Downloads/sip/${version}/sip-${version}.tar.gz";
12 sha256 = "1ra15vb5i9gkg2vdvh16cq9x2mmzw1yi3xphxs8q34q1pf83gkgd";
13 };
14
15 configurePhase = ''
16 ${python.executable} ./configure.py \
17 --sip-module ${sip-module} \
18 -d $out/${python.sitePackages} \
19 -b $out/bin -e $out/include
20 '';
21
22 enableParallelBuilding = true;
23
24 installCheckPhase = let
25 modules = [
26 sip-module
27 "sipconfig"
28 ];
29 imports = lib.concatMapStrings (module: "import ${module};") modules;
30 in ''
31 echo "Checking whether modules can be imported..."
32 PYTHONPATH=$out/${python.sitePackages}:$PYTHONPATH ${python.interpreter} -c "${imports}"
33 '';
34
35 doCheck = true;
36
37 meta = with lib; {
38 description = "Creates C++ bindings for Python modules";
39 homepage = "http://www.riverbankcomputing.co.uk/";
40 license = licenses.gpl2Plus;
41 maintainers = with maintainers; [ lovek323 sander ];
42 platforms = platforms.all;
43 };
44}