2017-06-02 21:55:16 +01:00
|
|
|
{ stdenv, fetchurl, makeDesktopItem
|
|
|
|
, python3, python3Packages
|
2018-08-18 00:53:33 +01:00
|
|
|
, glew, freeglut, libpng, libxml2, tk, freetype, msgpack }:
|
2017-06-02 21:55:16 +01:00
|
|
|
|
|
|
|
|
|
|
|
with stdenv.lib;
|
2017-02-22 00:35:09 +00:00
|
|
|
|
|
|
|
let
|
2017-06-02 15:34:16 +01:00
|
|
|
pname = "pymol";
|
2018-03-26 12:01:25 +01:00
|
|
|
ver_maj = "2";
|
|
|
|
ver_min = "1";
|
2017-06-02 15:34:16 +01:00
|
|
|
version = "${ver_maj}.${ver_min}.0";
|
|
|
|
description = "A Python-enhanced molecular graphics tool";
|
|
|
|
|
|
|
|
desktopItem = makeDesktopItem {
|
2019-09-09 00:38:31 +01:00
|
|
|
name = pname;
|
|
|
|
exec = pname;
|
2017-06-02 15:34:16 +01:00
|
|
|
desktopName = "PyMol Molecular Graphics System";
|
2018-03-26 12:01:25 +01:00
|
|
|
genericName = "Molecular Modeler";
|
2017-06-02 15:34:16 +01:00
|
|
|
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;";
|
|
|
|
};
|
2017-02-22 00:35:09 +00:00
|
|
|
in
|
2017-06-02 15:34:16 +01:00
|
|
|
python3Packages.buildPythonApplication {
|
2017-02-22 00:35:09 +00:00
|
|
|
name = "pymol-${version}";
|
|
|
|
src = fetchurl {
|
2017-06-02 15:34:16 +01:00
|
|
|
url = "mirror://sourceforge/project/pymol/pymol/${ver_maj}/pymol-v${version}.tar.bz2";
|
2018-03-26 12:01:25 +01:00
|
|
|
sha256 = "1qpacd5w4r9a0nm5iqmkd92ym3ai00dp7v61cwd6jgakk6wfps3s";
|
2017-02-22 00:35:09 +00:00
|
|
|
};
|
|
|
|
|
2018-08-18 00:53:33 +01:00
|
|
|
buildInputs = [ python3Packages.numpy glew freeglut libpng libxml2 tk freetype msgpack ];
|
2017-02-22 00:35:09 +00:00
|
|
|
NIX_CFLAGS_COMPILE = "-I ${libxml2.dev}/include/libxml2";
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
python setup.py install --home=$out
|
2017-06-02 15:34:16 +01:00
|
|
|
cp -r ${desktopItem}/share/ $out/
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
2017-06-02 21:55:16 +01:00
|
|
|
postInstall = with python3Packages; ''
|
2017-06-02 15:34:16 +01:00
|
|
|
wrapProgram $out/bin/pymol \
|
2017-06-02 21:55:16 +01:00
|
|
|
--prefix PYTHONPATH : ${makeSearchPathOutput "lib" python3.sitePackages [ Pmw tkinter ]}
|
2017-02-22 00:35:09 +00:00
|
|
|
'';
|
|
|
|
|
2017-06-02 21:55:16 +01:00
|
|
|
meta = {
|
2017-06-02 15:34:16 +01:00
|
|
|
description = description;
|
2017-08-01 21:03:30 +01:00
|
|
|
homepage = https://www.pymol.org/;
|
2017-02-22 07:48:42 +00:00
|
|
|
license = licenses.psfl;
|
2019-10-07 16:20:23 +01:00
|
|
|
broken = true;
|
2017-02-22 00:35:09 +00:00
|
|
|
};
|
|
|
|
}
|