Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions pkgs/development/python-modules/pyqt/5.x.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ let
pname = "PyQt";
version = "5.11.3";

inherit (pythonPackages) buildPythonPackage python isPy3k dbus-python enum34;
inherit (pythonPackages) buildPythonPackage python isPy3k dbus-python enum34 sip;

sip = pythonPackages.sip.override { sip-module = "PyQt5.sip"; };
pyqt5-sip = sip.override { sipModule = "PyQt5.sip"; };

in buildPythonPackage {
pname = pname;
Expand All @@ -32,9 +32,9 @@ in buildPythonPackage {

outputs = [ "out" "dev" ];

nativeBuildInputs = [ pkgconfig qmake lndir ];
nativeBuildInputs = [ pkgconfig qmake lndir sip ];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be pyqt5-sip?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it seems that the upstream envisions that there is one tool sip which generates multiple modules according to sip -n module_name parameter. This is why sip-the-tool is a native build input, and pyqt5-sip-module is a propagated build input.

After this PR sip ships both the tool and the module sip (as before), but pyqt5-sip ships only the module PyQt5.sip.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. Could you include the explanation as a comment?


buildInputs = [ dbus sip ];
buildInputs = [ dbus ];

propagatedBuildInputs = [
qtbase qtsvg qtwebkit qtwebengine
Expand Down Expand Up @@ -67,7 +67,7 @@ in buildPythonPackage {
'';

postInstall = ''
ln -s ${sip}/${python.sitePackages}/PyQt5/sip.* $out/${python.sitePackages}/PyQt5/
ln -s ${pyqt5-sip}/${python.sitePackages}/PyQt5/* $out/${python.sitePackages}/PyQt5/
for i in $out/bin/*; do
wrapProgram $i --prefix PYTHONPATH : "$PYTHONPATH"
done
Expand Down
31 changes: 23 additions & 8 deletions pkgs/development/python-modules/sip/default.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
{ lib, fetchurl, buildPythonPackage, python, isPyPy, sip-module ? "sip" }:
{ lib, fetchurl, buildPythonPackage, python, isPyPy
, sipModule ? "sip"
, withModule ? true
, withTools ? sipModule == "sip"
}:

buildPythonPackage rec {
pname = sip-module;
pname = sipModule;
version = "4.19.13";
format = "other";

Expand All @@ -12,12 +16,23 @@ buildPythonPackage rec {
sha256 = "0pniq03jk1n5bs90yjihw3s3rsmjd8m89y9zbnymzgwrcl2sflz3";
};

configurePhase = ''
${python.executable} ./configure.py \
--sip-module ${sip-module} \
-d $out/lib/${python.libPrefix}/site-packages \
-b $out/bin -e $out/include
'';
nativeBuildInputs = [ python ];

configureScript = "python configure.py";

configureFlags = (
if (!withModule) then [ "--no-module" ] else [
"--sip-module" sipModule
"-d" "${placeholder "out"}/${python.sitePackages}"
]
) ++ (
if (!withTools) then [ "--no-tools" ] else [
"-b" "${placeholder "out"}/bin"
"-e" "${placeholder "out"}/include"
]
);

dontAddPrefix = true;

enableParallelBuilding = true;

Expand Down