From d5fe7d15343982baf23da77dd096f9945f5bc993 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Katona=20L=C3=A1szl=C3=B3?= Date: Fri, 2 Jun 2017 16:20:51 +0200 Subject: [PATCH 1/3] pythonPackages.Pmw: init at 2.0.1 --- .../python-modules/Pmw/default.nix | 24 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 ++ 2 files changed, 26 insertions(+) create mode 100644 pkgs/development/python-modules/Pmw/default.nix diff --git a/pkgs/development/python-modules/Pmw/default.nix b/pkgs/development/python-modules/Pmw/default.nix new file mode 100644 index 000000000000..893caa88d676 --- /dev/null +++ b/pkgs/development/python-modules/Pmw/default.nix @@ -0,0 +1,24 @@ +{ lib , buildPythonPackage , fetchPypi, tkinter }: + +buildPythonPackage rec { + pname = "Pmw"; + version = "2.0.1"; + name = "${pname}-${version}"; + + src = fetchPypi { + inherit pname version; + sha256 = "080iml3868nxniyn56kcwnbghm10j7fw74a5nj0s19sm4zsji78b"; + }; + + propagatedBuildInputs = [ tkinter ]; + + # Disable tests due to their xserver requirement + doCheck = false; + + meta = { + description = "A toolkit for building high-level compound widgets in Python using the Tkinter module"; + homepage = "http://pmw.sourceforge.net/"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ mounium ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 98c7fb77cb35..fedb255773ef 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -240,6 +240,8 @@ in { plantuml = callPackage ../tools/misc/plantuml { }; + Pmw = callPackage ../development/python-modules/Pmw { }; + pyaes = callPackage ../development/python-modules/pyaes.nix { }; pyatspi = if isPy3k then callPackage ../development/python-modules/pyatspi { } else throw "pyatspi not supported for interpreter ${python.executable}"; From 2a1c535b7ed8cf294b559fd76e4ca2b8c872e4a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Katona=20L=C3=A1szl=C3=B3?= Date: Fri, 2 Jun 2017 16:34:16 +0200 Subject: [PATCH 2/3] pymol: added Pmw + python version bump --- .../science/chemistry/pymol/default.nix | 34 +++++++++++++++---- 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/pkgs/applications/science/chemistry/pymol/default.nix b/pkgs/applications/science/chemistry/pymol/default.nix index af0c2e855498..200d00395e2a 100644 --- a/pkgs/applications/science/chemistry/pymol/default.nix +++ b/pkgs/applications/science/chemistry/pymol/default.nix @@ -1,24 +1,46 @@ -{ stdenv, fetchurl, python27Packages, glew, freeglut, libpng, libxml2, tk, freetype }: +{ stdenv, fetchurl, makeDesktopItem, python3Packages, glew, freeglut, libpng, libxml2, tk, freetype }: let - version = "1.8.4.0"; + pname = "pymol"; + ver_maj = "1.8"; + ver_min = "4"; + version = "${ver_maj}.${ver_min}.0"; + description = "A Python-enhanced molecular graphics tool"; + + desktopItem = makeDesktopItem { + name = "${pname}"; + exec = "${pname}"; + desktopName = "PyMol Molecular Graphics System"; + genericName = "Molecular Modeller"; + comment = description; + mimeType = "chemical/x-pdb;chemical/x-mdl-molfile;chemical/x-mol2;chemical/seq-aa-fasta;chemical/seq-na-fasta;chemical/x-xyz;chemical/x-mdl-sdf;"; + categories = "Graphics;Education;Science;Chemistry;"; + }; in -python27Packages.buildPythonApplication { +python3Packages.buildPythonApplication { name = "pymol-${version}"; src = fetchurl { - url = "mirror://sourceforge/project/pymol/pymol/1.8/pymol-v1.8.4.0.tar.bz2"; + url = "mirror://sourceforge/project/pymol/pymol/${ver_maj}/pymol-v${version}.tar.bz2"; sha256 = "0yfj8g5yic9zz6f0bw2n8h6ifvgsn8qvhq84alixsi28wzppn55n"; }; - buildInputs = [ python27Packages.numpy glew freeglut libpng libxml2 tk freetype ]; + buildInputs = [ python3Packages.numpy glew freeglut libpng libxml2 tk freetype ]; NIX_CFLAGS_COMPILE = "-I ${libxml2.dev}/include/libxml2"; installPhase = '' python setup.py install --home=$out + cp -r ${desktopItem}/share/ $out/ + runHook postInstall + ''; + + postInstall = '' + wrapProgram $out/bin/pymol \ + --prefix PYTHONPATH : ${python3Packages.Pmw}/lib/python3.6/site-packages \ + --prefix PYTHONPATH : ${python3Packages.tkinter}/lib/python3.6/site-packages ''; meta = with stdenv.lib; { - description = "A Python-enhanced molecular graphics tool"; + description = description; homepage = "https://www.pymol.org/"; license = licenses.psfl; }; From c972f01e2d670f9483a980312c0e12b81094cebb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Fri, 2 Jun 2017 21:55:16 +0100 Subject: [PATCH 3/3] pymol: set PYTHONPATH in a future way --- .../science/chemistry/pymol/default.nix | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/pkgs/applications/science/chemistry/pymol/default.nix b/pkgs/applications/science/chemistry/pymol/default.nix index 200d00395e2a..ed208014f7d9 100644 --- a/pkgs/applications/science/chemistry/pymol/default.nix +++ b/pkgs/applications/science/chemistry/pymol/default.nix @@ -1,4 +1,9 @@ -{ stdenv, fetchurl, makeDesktopItem, python3Packages, glew, freeglut, libpng, libxml2, tk, freetype }: +{ stdenv, fetchurl, makeDesktopItem +, python3, python3Packages +, glew, freeglut, libpng, libxml2, tk, freetype }: + + +with stdenv.lib; let pname = "pymol"; @@ -33,13 +38,12 @@ python3Packages.buildPythonApplication { runHook postInstall ''; - postInstall = '' + postInstall = with python3Packages; '' wrapProgram $out/bin/pymol \ - --prefix PYTHONPATH : ${python3Packages.Pmw}/lib/python3.6/site-packages \ - --prefix PYTHONPATH : ${python3Packages.tkinter}/lib/python3.6/site-packages + --prefix PYTHONPATH : ${makeSearchPathOutput "lib" python3.sitePackages [ Pmw tkinter ]} ''; - meta = with stdenv.lib; { + meta = { description = description; homepage = "https://www.pymol.org/"; license = licenses.psfl;