2022-06-16 17:23:12 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
2021-08-22 07:53:02 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, makeDesktopItem
|
|
|
|
, python3
|
|
|
|
, python3Packages
|
|
|
|
, netcdf
|
|
|
|
, glew
|
|
|
|
, glm
|
|
|
|
, libpng
|
|
|
|
, libxml2
|
|
|
|
, freetype
|
|
|
|
, msgpack
|
2022-10-06 18:32:54 +00:00
|
|
|
, qt5
|
2021-08-22 07:53:02 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
let
|
|
|
|
pname = "pymol";
|
|
|
|
description = "A Python-enhanced molecular graphics tool";
|
|
|
|
|
|
|
|
desktopItem = makeDesktopItem {
|
|
|
|
name = pname;
|
|
|
|
exec = pname;
|
|
|
|
desktopName = "PyMol Molecular Graphics System";
|
|
|
|
genericName = "Molecular Modeler";
|
|
|
|
comment = description;
|
|
|
|
icon = pname;
|
2022-03-05 16:20:37 +00:00
|
|
|
mimeTypes = [
|
|
|
|
"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" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
in
|
|
|
|
python3Packages.buildPythonApplication rec {
|
|
|
|
inherit pname;
|
2021-08-22 07:53:02 +00:00
|
|
|
version = "2.5.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "schrodinger";
|
|
|
|
repo = "pymol-open-source";
|
|
|
|
rev = "v${version}";
|
2021-08-22 07:53:02 +00:00
|
|
|
sha256 = "sha256-JdsgcVF1w1xFPZxVcyS+GcWg4a1Bd4SvxFOuSdlz9SM=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-10-06 18:32:54 +00:00
|
|
|
nativeBuildInputs = [ qt5.wrapQtAppsHook ];
|
|
|
|
buildInputs = [ python3Packages.numpy python3Packages.pyqt5 glew glm libpng libxml2 freetype msgpack netcdf ];
|
2023-03-04 12:14:45 +00:00
|
|
|
env.NIX_CFLAGS_COMPILE = "-I ${libxml2.dev}/include/libxml2";
|
2020-04-24 23:36:52 +00:00
|
|
|
hardeningDisable = [ "format" ];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
python setup.py install --home="$out"
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = with python3Packages; ''
|
|
|
|
wrapProgram $out/bin/pymol \
|
2022-10-06 18:32:54 +00:00
|
|
|
--prefix PYTHONPATH : ${lib.makeSearchPathOutput "lib" python3.sitePackages [ pyqt5 pyqt5.pyqt5_sip ]}
|
2020-04-24 23:36:52 +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/"
|
|
|
|
'';
|
|
|
|
|
2022-10-06 18:32:54 +00:00
|
|
|
preFixup = ''
|
|
|
|
wrapQtApp "$out/bin/pymol"
|
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
2021-08-22 07:53:02 +00:00
|
|
|
inherit description;
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://www.pymol.org/";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ samlich ];
|
|
|
|
};
|
|
|
|
}
|