pythonPackages.sip_5: add platform_tag attribute

It's value is platform dependend and needs to be specified in `pyproject.toml` for modules that use sip_5. Instead of defining it for each module, we can add it to sip_5, so it can be reused.
This commit is contained in:
Eduardo Sánchez Muñoz
2021-04-28 17:52:42 +02:00
parent 5ba2e4e9c6
commit 9078c50982
2 changed files with 16 additions and 10 deletions
+15 -1
View File
@@ -1,4 +1,4 @@
{ lib, fetchPypi, buildPythonPackage, packaging, toml }:
{ lib, stdenv, fetchPypi, buildPythonPackage, packaging, toml }:
buildPythonPackage rec {
pname = "sip";
@@ -17,6 +17,20 @@ buildPythonPackage rec {
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 = "http://www.riverbankcomputing.co.uk/";