diff options
Diffstat (limited to 'pkgs/development/python-modules/sip')
| -rw-r--r-- | pkgs/development/python-modules/sip/4.x.nix | 44 | ||||
| -rw-r--r-- | pkgs/development/python-modules/sip/5.x.nix | 26 | ||||
| -rw-r--r-- | pkgs/development/python-modules/sip/default.nix | 56 |
3 files changed, 70 insertions, 56 deletions
diff --git a/pkgs/development/python-modules/sip/4.x.nix b/pkgs/development/python-modules/sip/4.x.nix new file mode 100644 index 000000000000..5334d1196344 --- /dev/null +++ b/pkgs/development/python-modules/sip/4.x.nix @@ -0,0 +1,44 @@ +{ lib, fetchurl, buildPythonPackage, python, isPyPy, sip-module ? "sip" }: + +buildPythonPackage rec { + pname = sip-module; + version = "4.19.25"; + format = "other"; + + disabled = isPyPy; + + src = fetchurl { + url = "https://www.riverbankcomputing.com/static/Downloads/sip/${version}/sip-${version}.tar.gz"; + sha256 = "04a23cgsnx150xq86w1z44b6vr2zyazysy9mqax0fy346zlr77dk"; + }; + + configurePhase = '' + ${python.executable} ./configure.py \ + --sip-module ${sip-module} \ + -d $out/${python.sitePackages} \ + -b $out/bin -e $out/include + ''; + + enableParallelBuilding = true; + + installCheckPhase = let + modules = [ + sip-module + "sipconfig" + ]; + imports = lib.concatMapStrings (module: "import ${module};") modules; + in '' + echo "Checking whether modules can be imported..." + PYTHONPATH=$out/${python.sitePackages}:$PYTHONPATH ${python.interpreter} -c "${imports}" + ''; + + doCheck = true; + + meta = with lib; { + description = "Creates C++ bindings for Python modules"; + homepage = "http://www.riverbankcomputing.co.uk/"; + license = licenses.gpl2Plus; + maintainers = with maintainers; [ lovek323 sander ]; + platforms = platforms.all; + }; +} diff --git a/pkgs/development/python-modules/sip/5.x.nix b/pkgs/development/python-modules/sip/5.x.nix deleted file mode 100644 index cebffd5765bd..000000000000 --- a/pkgs/development/python-modules/sip/5.x.nix +++ /dev/null @@ -1,26 +0,0 @@ -{ lib, fetchPypi, buildPythonPackage, packaging, toml }: - -buildPythonPackage rec { - pname = "sip"; - version = "5.5.0"; - - src = fetchPypi { - pname = "sip"; - inherit version; - sha256 = "1idaivamp1jvbbai9yzv471c62xbqxhaawccvskaizihkd0lq0jx"; - }; - - propagatedBuildInputs = [ packaging toml ]; - - # There aren't tests - doCheck = false; - - pythonImportsCheck = [ "sipbuild" ]; - - meta = with lib; { - description = "Creates C++ bindings for Python modules"; - homepage = "http://www.riverbankcomputing.co.uk/"; - license = licenses.gpl3Only; - maintainers = with maintainers; [ eduardosm ]; - }; -} diff --git a/pkgs/development/python-modules/sip/default.nix b/pkgs/development/python-modules/sip/default.nix index 0027c1c0ba5f..c15589b77bc8 100644 --- a/pkgs/development/python-modules/sip/default.nix +++ b/pkgs/development/python-modules/sip/default.nix @@ -1,44 +1,40 @@ -{ lib, fetchurl, buildPythonPackage, python, isPyPy, sip-module ? "sip" }: +{ lib, stdenv, fetchPypi, buildPythonPackage, packaging, toml }: buildPythonPackage rec { - pname = sip-module; - version = "4.19.24"; - format = "other"; + pname = "sip"; + version = "5.5.0"; - disabled = isPyPy; - - src = fetchurl { - url = "https://www.riverbankcomputing.com/static/Downloads/sip/${version}/sip-${version}.tar.gz"; - sha256 = "1ra15vb5i9gkg2vdvh16cq9x2mmzw1yi3xphxs8q34q1pf83gkgd"; + src = fetchPypi { + pname = "sip"; + inherit version; + sha256 = "1idaivamp1jvbbai9yzv471c62xbqxhaawccvskaizihkd0lq0jx"; }; - configurePhase = '' - ${python.executable} ./configure.py \ - --sip-module ${sip-module} \ - -d $out/${python.sitePackages} \ - -b $out/bin -e $out/include - ''; + propagatedBuildInputs = [ packaging toml ]; - enableParallelBuilding = true; + # There aren't tests + doCheck = false; - installCheckPhase = let - modules = [ - sip-module - "sipconfig" - ]; - imports = lib.concatMapStrings (module: "import ${module};") modules; - in '' - echo "Checking whether modules can be imported..." - PYTHONPATH=$out/${python.sitePackages}:$PYTHONPATH ${python.interpreter} -c "${imports}" - ''; + pythonImportsCheck = [ "sipbuild" ]; - doCheck = true; + # FIXME: Why isn't this detected automatically? + # Needs to be specified in pyproject.toml, e.g.: + # [tool.sip.bindings.MODULE] + # tags = [PLATFORM_TAG] + platform_tag = + if stdenv.targetPlatform.isLinux then + "WS_X11" + else if stdenv.targetPlatform.isDarwin then + "WS_MACX" + else if stdenv.targetPlatform.isWindows then + "WS_WIN" + else + throw "unsupported platform"; meta = with lib; { description = "Creates C++ bindings for Python modules"; homepage = "http://www.riverbankcomputing.co.uk/"; - license = licenses.gpl2Plus; - maintainers = with maintainers; [ lovek323 sander ]; - platforms = platforms.all; + license = licenses.gpl3Only; + maintainers = with maintainers; [ eduardosm ]; }; } |
