3
0
Fork 0
forked from mirrors/nixpkgs

Merge pull request #26317 from Mounium/pymol

pymol: added Pmw + python version bump
This commit is contained in:
Jörg Thalheim 2017-06-02 21:58:27 +01:00 committed by GitHub
commit cb2f0d3aab
3 changed files with 59 additions and 7 deletions

View file

@ -1,24 +1,50 @@
{ stdenv, fetchurl, python27Packages, glew, freeglut, libpng, libxml2, tk, freetype }:
{ stdenv, fetchurl, makeDesktopItem
, python3, python3Packages
, glew, freeglut, libpng, libxml2, tk, freetype }:
with stdenv.lib;
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
'';
meta = with stdenv.lib; {
description = "A Python-enhanced molecular graphics tool";
postInstall = with python3Packages; ''
wrapProgram $out/bin/pymol \
--prefix PYTHONPATH : ${makeSearchPathOutput "lib" python3.sitePackages [ Pmw tkinter ]}
'';
meta = {
description = description;
homepage = "https://www.pymol.org/";
license = licenses.psfl;
};

View file

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

View file

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