2022-08-12 12:06:08 +00:00
|
|
|
{ lib, stdenv, fetchPypi, buildPythonPackage, packaging, ply, toml, fetchpatch }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
2021-05-20 23:08:51 +00:00
|
|
|
pname = "sip";
|
2022-08-12 12:06:08 +00:00
|
|
|
version = "6.6.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
src = fetchPypi {
|
|
|
|
pname = "sip";
|
|
|
|
inherit version;
|
2022-08-12 12:06:08 +00:00
|
|
|
sha256 = "sha256-Dj76wcXf2OUlrlcUCSffJpk+E/WLidFXfDFPQQW/2Q0=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
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
|
2022-08-12 12:06:08 +00:00
|
|
|
|
|
|
|
# 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=";
|
|
|
|
})
|
2022-03-30 09:31:56 +00:00
|
|
|
];
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
propagatedBuildInputs = [ packaging ply toml ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
# There aren't tests
|
|
|
|
doCheck = false;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
pythonImportsCheck = [ "sipbuild" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
# 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";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Creates C++ bindings for Python modules";
|
2021-06-28 23:13:55 +00:00
|
|
|
homepage = "https://riverbankcomputing.com/";
|
2021-05-20 23:08:51 +00:00
|
|
|
license = licenses.gpl3Only;
|
2021-12-06 16:07:01 +00:00
|
|
|
maintainers = with maintainers; [ ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|