3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/applications/science/chemistry/pymol/default.nix

58 lines
1.8 KiB
Nix
Raw Normal View History

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;
2020-01-24 19:51:08 +00:00
icon = pname;
2017-06-02 15:34:16 +01:00
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 ];
2020-01-25 19:58:36 +00:00
NIX_CFLAGS_COMPILE = "-I ${libxml2.dev}/include/libxml2";
hardeningDisable = [ "format" ];
2020-01-24 19:42:59 +00:00
setupPyBuildFlags = [ "--glut" ];
2017-02-22 00:35:09 +00:00
installPhase = ''
2020-01-24 19:51:08 +00:00
python setup.py install --home="$out"
2017-06-02 15:34:16 +01:00
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 ]}
2020-01-24 19:51:08 +00:00
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/"
2017-02-22 00:35:09 +00:00
'';
2020-01-25 19:58:36 +00:00
meta = with lib; {
2017-06-02 15:34:16 +01:00
description = description;
homepage = "https://www.pymol.org/";
2020-01-25 19:58:36 +00:00
license = licenses.mit;
maintainers = with maintainers; [ samlich ];
2017-02-22 00:35:09 +00:00
};
}