2020-01-24 19:42:59 +00:00
|
|
|
{ lib, stdenv, fetchurl, fetchFromGitHub, makeDesktopItem
|
2017-06-02 21:55:16 +01:00
|
|
|
, python3, python3Packages
|
2020-01-24 19:42:59 +00:00
|
|
|
, glew, glm, freeglut, libpng, libxml2, tk, freetype, msgpack }:
|
2017-06-02 21:55:16 +01:00
|
|
|
|
|
|
|
|
2017-02-22 00:35:09 +00:00
|
|
|
let
|
2017-06-02 15:34:16 +01:00
|
|
|
pname = "pymol";
|
|
|
|
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
|
2020-01-24 19:42:59 +00:00
|
|
|
python3Packages.buildPythonApplication rec {
|
|
|
|
inherit pname;
|
|
|
|
version = "2.3.0";
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "schrodinger";
|
|
|
|
repo = "pymol-open-source";
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "175cqi6gfmvv49i3ws19254m7ljs53fy6y82fm1ywshq2h2c93jh";
|
2017-02-22 00:35:09 +00:00
|
|
|
};
|
|
|
|
|
2020-01-24 19:42:59 +00:00
|
|
|
buildInputs = [ python3Packages.numpy glew glm freeglut libpng libxml2 tk freetype msgpack ];
|
|
|
|
NIX_CFLAGS_COMPILE = "-I ${libxml2.dev}/include/libxml2 -Wno-error=format-security";
|
|
|
|
|
|
|
|
setupPyBuildFlags = [ "--glut" ];
|
2017-02-22 00:35:09 +00:00
|
|
|
|
|
|
|
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 \
|
2020-01-24 19:42:59 +00:00
|
|
|
--prefix PYTHONPATH : ${lib.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/;
|
2020-01-24 19:42:59 +00:00
|
|
|
license = lib.licenses.psfl;
|
2020-01-24 19:49:38 +00:00
|
|
|
maintainers = with lib.maintainers; [ samlich ];
|
2017-02-22 00:35:09 +00:00
|
|
|
};
|
|
|
|
}
|