depot/third_party/nixpkgs/pkgs/development/python-modules/sip/default.nix
Default email 02cf88bb76 Project import generated by Copybara.
GitOrigin-RevId: c4a0efdd5a728e20791b8d8d2f26f90ac228ee8d
2022-08-12 15:06:08 +03:00

54 lines
1.6 KiB
Nix

{ lib, stdenv, fetchPypi, buildPythonPackage, packaging, ply, toml, fetchpatch }:
buildPythonPackage rec {
pname = "sip";
version = "6.6.2";
src = fetchPypi {
pname = "sip";
inherit version;
sha256 = "sha256-Dj76wcXf2OUlrlcUCSffJpk+E/WLidFXfDFPQQW/2Q0=";
};
patches = [
# on non-x86 Linux platforms, sip incorrectly detects the manylinux version
# and PIP will refuse to install the resulting wheel.
# remove once upstream fixes this, hopefully in 6.5.2
./fix-manylinux-version.patch
# fix issue triggered by QGIS 3.26.x, already fixed upstream
# in SIP, waiting for release past 6.6.2
(fetchpatch {
url = "https://riverbankcomputing.com/hg/sip/raw-diff/323d39a2d602/sipbuild/generator/parser/instantiations.py";
hash = "sha256-QEQuRzXA+wK9Dt22U/LgIwtherY9pJURGJYpKpJkiok=";
})
];
propagatedBuildInputs = [ packaging ply toml ];
# There aren't tests
doCheck = false;
pythonImportsCheck = [ "sipbuild" ];
# 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 = "https://riverbankcomputing.com/";
license = licenses.gpl3Only;
maintainers = with maintainers; [ ];
};
}