about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/pyqt
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2019-01-07 02:18:36 +0000
committerAlyssa Ross <hi@alyssa.is>2019-01-07 02:18:47 +0000
commit36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2 (patch)
treeb3faaf573407b32aa645237a4d16b82778a39a92 /nixpkgs/pkgs/development/python-modules/pyqt
parent4e31070265257dc67d120c27e0f75c2344fdfa9a (diff)
parentabf060725d7614bd3b9f96764262dfbc2f9c2199 (diff)
downloadnixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.gz
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.bz2
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.lz
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.xz
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.zst
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.zip
Add 'nixpkgs/' from commit 'abf060725d7614bd3b9f96764262dfbc2f9c2199'
git-subtree-dir: nixpkgs
git-subtree-mainline: 4e31070265257dc67d120c27e0f75c2344fdfa9a
git-subtree-split: abf060725d7614bd3b9f96764262dfbc2f9c2199
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/pyqt')
-rw-r--r--nixpkgs/pkgs/development/python-modules/pyqt/4.x.nix68
-rw-r--r--nixpkgs/pkgs/development/python-modules/pyqt/5.x.nix77
2 files changed, 145 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/pyqt/4.x.nix b/nixpkgs/pkgs/development/python-modules/pyqt/4.x.nix
new file mode 100644
index 000000000000..a747d42e418a
--- /dev/null
+++ b/nixpkgs/pkgs/development/python-modules/pyqt/4.x.nix
@@ -0,0 +1,68 @@
+{ stdenv, fetchurl, pythonPackages, qt4, pkgconfig, lndir, dbus, makeWrapper }:
+
+let
+  pname = "PyQt-x11-gpl";
+  version = "4.12";
+
+  inherit (pythonPackages) buildPythonPackage python dbus-python sip;
+in buildPythonPackage {
+  pname = pname;
+  name = pname + "-" + version;
+  version = version;
+  format = "other";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/pyqt/PyQt4_gpl_x11-${version}.tar.gz";
+    sha256 = "1nw8r88a5g2d550yvklawlvns8gd5slw53yy688kxnsa65aln79w";
+  };
+
+  configurePhase = ''
+    mkdir -p $out
+    lndir ${dbus-python} $out
+    rm -rf "$out/nix-support"
+
+    export PYTHONPATH=$PYTHONPATH:$out/lib/${python.libPrefix}/site-packages
+    ${stdenv.lib.optionalString stdenv.isDarwin ''
+      export QMAKESPEC="unsupported/macx-clang-libc++" # macOS target after bootstrapping phase \
+    ''}
+
+    substituteInPlace configure.py \
+      --replace 'install_dir=pydbusmoddir' "install_dir='$out/lib/${python.libPrefix}/site-packages/dbus/mainloop'" \
+    ${stdenv.lib.optionalString stdenv.isDarwin ''
+      --replace "qt_macx_spec = 'macx-g++'" "qt_macx_spec = 'unsupported/macx-clang-libc++'" # for bootstrapping phase \
+    ''}
+
+    configureFlagsArray=( \
+      --confirm-license --bindir $out/bin \
+      --destdir $out/${python.sitePackages} \
+      --plugin-destdir $out/lib/qt4/plugins --sipdir $out/share/sip/PyQt4 \
+      --dbus=${dbus-python}/include/dbus-1.0 --verbose)
+
+    ${python.executable} configure.py $configureFlags "''${configureFlagsArray[@]}"
+  '';
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ makeWrapper qt4 lndir dbus ];
+
+  propagatedBuildInputs = [ sip ];
+
+  postInstall = ''
+    for i in $out/bin/*; do
+      wrapProgram $i --prefix PYTHONPATH : "$PYTHONPATH"
+    done
+  '';
+
+  enableParallelBuilding = true;
+
+  passthru = {
+    qt = qt4;
+  };
+
+  meta = {
+    description = "Python bindings for Qt";
+    license = "GPL";
+    homepage = http://www.riverbankcomputing.co.uk;
+    maintainers = [ stdenv.lib.maintainers.sander ];
+    platforms = stdenv.lib.platforms.mesaPlatforms;
+  };
+}
diff --git a/nixpkgs/pkgs/development/python-modules/pyqt/5.x.nix b/nixpkgs/pkgs/development/python-modules/pyqt/5.x.nix
new file mode 100644
index 000000000000..14d7bddbb709
--- /dev/null
+++ b/nixpkgs/pkgs/development/python-modules/pyqt/5.x.nix
@@ -0,0 +1,77 @@
+{ lib, fetchurl, fetchpatch, pythonPackages, pkgconfig
+, qmake, lndir, qtbase, qtsvg, qtwebkit, qtwebengine, dbus
+, withWebSockets ? false, qtwebsockets
+, withConnectivity ? false, qtconnectivity
+}:
+
+let
+  pname = "PyQt";
+  version = "5.11.3";
+
+  inherit (pythonPackages) buildPythonPackage python isPy3k dbus-python enum34;
+
+  sip = pythonPackages.sip.override { sip-module = "PyQt5.sip"; };
+
+in buildPythonPackage {
+  pname = pname;
+  version = version;
+  format = "other";
+
+  meta = with lib; {
+    description = "Python bindings for Qt5";
+    homepage    = http://www.riverbankcomputing.co.uk;
+    license     = licenses.gpl3;
+    platforms   = platforms.mesaPlatforms;
+    maintainers = with maintainers; [ sander ];
+  };
+
+  src = fetchurl {
+    url = "mirror://sourceforge/pyqt/PyQt5/PyQt-${version}/PyQt5_gpl-${version}.tar.gz";
+    sha256 = "0wqh4srqkcc03rvkwrcshaa028psrq58xkys6npnyhqxc0apvdf9";
+  };
+
+  outputs = [ "out" "dev" ];
+
+  nativeBuildInputs = [ pkgconfig qmake lndir ];
+
+  buildInputs = [ dbus sip ];
+
+  propagatedBuildInputs = [
+    qtbase qtsvg qtwebkit qtwebengine
+  ] ++ lib.optional (!isPy3k) enum34 ++ lib.optional withWebSockets qtwebsockets ++ lib.optional withConnectivity qtconnectivity;
+
+  configurePhase = ''
+    runHook preConfigure
+
+    mkdir -p $out
+    lndir ${dbus-python} $out
+    rm -rf "$out/nix-support"
+
+    export PYTHONPATH=$PYTHONPATH:$out/${python.sitePackages}
+
+    substituteInPlace configure.py \
+      --replace 'install_dir=pydbusmoddir' "install_dir='$out/${python.sitePackages}/dbus/mainloop'" \
+      --replace "ModuleMetadata(qmake_QT=['webkitwidgets'])" "ModuleMetadata(qmake_QT=['webkitwidgets', 'printsupport'])"
+
+    ${python.executable} configure.py  -w \
+      --confirm-license \
+      --dbus=${dbus.dev}/include/dbus-1.0 \
+      --no-qml-plugin \
+      --bindir=$out/bin \
+      --destdir=$out/${python.sitePackages} \
+      --stubsdir=$out/${python.sitePackages}/PyQt5 \
+      --sipdir=$out/share/sip/PyQt5 \
+      --designer-plugindir=$out/plugins/designer
+
+    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
+  '';
+
+  enableParallelBuilding = true;
+}