Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python3packages.sip: 4.19.24 -> 5.5.0.dev2010041444 #100129

Closed
wants to merge 2 commits into from
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
76 changes: 29 additions & 47 deletions pkgs/development/python-modules/pyqt/5.x.nix
Expand Up @@ -13,20 +13,7 @@

let

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

sip = (pythonPackages.sip.override { sip-module = "PyQt5.sip"; }).overridePythonAttrs(oldAttrs: {
# If we install sip in another folder, then we need to create a __init__.py as well
# if we want to be able to import it with Python 2.
# Python 3 could rely on it being an implicit namespace package, however,
# PyQt5 we made an explicit namespace package so sip should be as well.
postInstall = ''
cat << EOF > $out/${python.sitePackages}/PyQt5/__init__.py
from pkgutil import extend_path
__path__ = extend_path(__path__, __name__)
EOF
'';
});
inherit (pythonPackages) buildPythonPackage python isPy3k dbus-python enum34 sip;

in buildPythonPackage rec {
pname = "PyQt5";
Expand Down Expand Up @@ -103,39 +90,34 @@ in buildPythonPackage rec {
runHook postConfigure
'';

postInstall = ''
ln -s ${sip}/${python.sitePackages}/PyQt5/sip.* $out/${python.sitePackages}/PyQt5/
for i in $out/bin/*; do
wrapProgram $i --prefix PYTHONPATH : "$PYTHONPATH"
done

# Let's make it a namespace package
cat << EOF > $out/${python.sitePackages}/PyQt5/__init__.py
from pkgutil import extend_path
__path__ = extend_path(__path__, __name__)
EOF
'';

installCheckPhase = let
modules = [
"PyQt5"
"PyQt5.QtCore"
"PyQt5.QtQml"
"PyQt5.QtWidgets"
"PyQt5.QtGui"
]
++ lib.optional withWebSockets "PyQt5.QtWebSockets"
++ lib.optional withWebKit "PyQt5.QtWebKit"
++ lib.optional withMultimedia "PyQt5.QtMultimedia"
++ lib.optional withConnectivity "PyQt5.QtConnectivity"
;
imports = lib.concatMapStrings (module: "import ${module};") modules;
in ''
echo "Checking whether modules can be imported..."
${python.interpreter} -c "${imports}"
'';

doCheck = true;
# postInstall = ''
# ln -s ${sip}/${python.sitePackages}/PyQt5/sip.* $out/${python.sitePackages}/PyQt5/
# for i in $out/bin/*; do
# wrapProgram $i --prefix PYTHONPATH : "$PYTHONPATH"
# done

# # Let's make it a namespace package
# cat << EOF > $out/${python.sitePackages}/PyQt5/__init__.py
# from pkgutil import extend_path
# __path__ = extend_path(__path__, __name__)
# EOF
# '';

pythonImportsCheck = [
"PyQt5"
"PyQt5.QtCore"
"PyQt5.QtQml"
"PyQt5.QtWidgets"
"PyQt5.QtGui"
]
++ lib.optional withWebSockets "PyQt5.QtWebSockets"
++ lib.optional withWebKit "PyQt5.QtWebKit"
++ lib.optional withMultimedia "PyQt5.QtMultimedia"
++ lib.optional withConnectivity "PyQt5.QtConnectivity"
;

# No tests
doCheck = false;

enableParallelBuilding = true;

Expand Down
51 changes: 24 additions & 27 deletions pkgs/development/python-modules/sip/default.nix
@@ -1,44 +1,41 @@
{ lib, fetchurl, buildPythonPackage, python, isPyPy, sip-module ? "sip" }:
{ lib
, fetchurl
, buildPythonPackage
, isPyPy
, packaging
, toml
, pythonOlder
, python
Copy link
Member Author

Choose a reason for hiding this comment

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

unused python

}:

buildPythonPackage rec {
pname = sip-module;
version = "4.19.24";
format = "other";
pname = "sip";
# Latest stable. No idea why they call it "dev".
version = "5.5.0.dev2010041444";

disabled = isPyPy;
disabled = pythonOlder "3.5" || isPyPy;

src = fetchurl {
url = "https://www.riverbankcomputing.com/static/Downloads/sip/${version}/sip-${version}.tar.gz";
sha256 = "1ra15vb5i9gkg2vdvh16cq9x2mmzw1yi3xphxs8q34q1pf83gkgd";
url = "https://www.riverbankcomputing.com/static/Downloads/sip/sip-${version}.tar.gz";
sha256 = "sha256-MNUzjRIuVVTZmRzjCAQwvcSZtlyfJ6W+ZacHfBv9c7g=";
};

configurePhase = ''
${python.executable} ./configure.py \
--sip-module ${sip-module} \
-d $out/${python.sitePackages} \
-b $out/bin -e $out/include
'';
propagatedBuildInputs = [
packaging
toml
];

enableParallelBuilding = true;
pythonImportsCheck = [
"sipbuild"
];

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;
# No tests in archive
doCheck = false;

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;
};
}