From ab3f0771a42aef7e691815209119bb49d1c63f93 Mon Sep 17 00:00:00 2001 From: samlich <1349989+samlich@users.noreply.github.com> Date: Fri, 23 Sep 2022 19:22:04 +0000 Subject: [PATCH] pymol: use Qt instead of Tk; fixes #192555 --- .../science/chemistry/pymol/default.nix | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/pkgs/applications/science/chemistry/pymol/default.nix b/pkgs/applications/science/chemistry/pymol/default.nix index c281f63b3bf8..4ad0380ef1e3 100644 --- a/pkgs/applications/science/chemistry/pymol/default.nix +++ b/pkgs/applications/science/chemistry/pymol/default.nix @@ -7,12 +7,11 @@ , netcdf , glew , glm -, freeglut , libpng , libxml2 -, tk , freetype , msgpack +, qt5 }: let pname = "pymol"; @@ -47,12 +46,11 @@ python3Packages.buildPythonApplication rec { sha256 = "sha256-JdsgcVF1w1xFPZxVcyS+GcWg4a1Bd4SvxFOuSdlz9SM="; }; - buildInputs = [ python3Packages.numpy glew glm freeglut libpng libxml2 tk freetype msgpack netcdf ]; + nativeBuildInputs = [ qt5.wrapQtAppsHook ]; + buildInputs = [ python3Packages.numpy python3Packages.pyqt5 glew glm libpng libxml2 freetype msgpack netcdf ]; NIX_CFLAGS_COMPILE = "-I ${libxml2.dev}/include/libxml2"; hardeningDisable = [ "format" ]; - setupPyBuildFlags = [ "--glut" ]; - installPhase = '' python setup.py install --home="$out" runHook postInstall @@ -60,13 +58,17 @@ python3Packages.buildPythonApplication rec { postInstall = with python3Packages; '' wrapProgram $out/bin/pymol \ - --prefix PYTHONPATH : ${lib.makeSearchPathOutput "lib" python3.sitePackages [ Pmw tkinter ]} + --prefix PYTHONPATH : ${lib.makeSearchPathOutput "lib" python3.sitePackages [ pyqt5 pyqt5.pyqt5_sip ]} mkdir -p "$out/share/icons/" ln -s ../../lib/python/pymol/pymol_path/data/pymol/icons/icon2.svg "$out/share/icons/pymol.svg" cp -r "${desktopItem}/share/applications/" "$out/share/" ''; + preFixup = '' + wrapQtApp "$out/bin/pymol" + ''; + meta = with lib; { broken = stdenv.isDarwin; inherit description;