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

68 lines
1.8 KiB
Nix
Raw Normal View History

2021-08-18 22:31:15 +01:00
{ lib
, fetchFromGitHub
, makeDesktopItem
, python3
, python3Packages
, netcdf
, glew
, glm
, freeglut
, libpng
, libxml2
, tk
, freetype
, msgpack
}:
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;
2021-08-18 22:31:15 +01:00
version = "2.5.0";
2020-01-24 19:42:59 +00:00
src = fetchFromGitHub {
owner = "schrodinger";
repo = "pymol-open-source";
rev = "v${version}";
2021-08-18 22:31:15 +01:00
sha256 = "sha256-JdsgcVF1w1xFPZxVcyS+GcWg4a1Bd4SvxFOuSdlz9SM=";
2017-02-22 00:35:09 +00:00
};
2021-08-18 22:31:15 +01:00
buildInputs = [ python3Packages.numpy glew glm freeglut libpng libxml2 tk freetype msgpack netcdf ];
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; {
2021-08-18 22:31:15 +01:00
inherit 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
};
}