17 description = "A Python-enhanced molecular graphics tool";
19 desktopItem = makeDesktopItem {
22 desktopName = "PyMol Molecular Graphics System";
23 genericName = "Molecular Modeler";
24 comment = description;
28 "chemical/x-mdl-molfile"
30 "chemical/seq-aa-fasta"
31 "chemical/seq-na-fasta"
35 categories = [ "Graphics" "Education" "Science" "Chemistry" ];
38 python3Packages.buildPythonApplication rec {
43 src = fetchFromGitHub {
44 owner = "schrodinger";
45 repo = "pymol-open-source";
47 hash = "sha256-GhTHxacjGN7XklZ6gileBMRZAGq4Pp4JknNL+qGqrVE=";
51 substituteInPlace setup.py \
52 --replace-fail "self.install_libbase" '"${placeholder "out"}/${python3Packages.python.sitePackages}"'
56 python3Packages.setuptools
59 nativeBuildInputs = [ qt5.wrapQtAppsHook ];
60 buildInputs = [ python3Packages.numpy python3Packages.pyqt5 glew glm libpng libxml2 freetype msgpack netcdf ];
61 env.NIX_CFLAGS_COMPILE = "-I ${libxml2.dev}/include/libxml2";
63 postInstall = with python3Packages; ''
64 wrapProgram $out/bin/pymol \
65 --prefix PYTHONPATH : ${lib.makeSearchPathOutput "lib" python3Packages.python.sitePackages [ pyqt5 pyqt5.pyqt5-sip ]}
67 mkdir -p "$out/share/icons/"
68 ln -s $out/${python3Packages.python.sitePackages}/pymol/pymol_path/data/pymol/icons/icon2.svg "$out/share/icons/pymol.svg"
69 '' + lib.optionalString stdenv.hostPlatform.isLinux ''
70 cp -r "${desktopItem}/share/applications/" "$out/share/"
73 pythonImportsCheck = [
77 nativeCheckInputs = with python3Packages; [
78 python3Packages.msgpack
83 # some tests hang for some reason
84 doCheck = !(stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64);
87 # require biopython which is broken as of 2024-04-20
88 "tests/api/seqalign.py"
92 # the output image does not exactly match
96 # requires collada2gltf which is not included in nixpkgs
98 # require mmtf-cpp which does not support darwin
100 "testSave_symmetry__mmtf"
107 __darwinAllowLocalNetworking = true;
110 wrapQtApp "$out/bin/pymol"
115 mainProgram = "pymol";
116 homepage = "https://www.pymol.org/";
117 license = licenses.mit;
118 maintainers = with maintainers; [ natsukium samlich ];