summary refs log tree commit diff
diff options
context:
space:
mode:
authormarkuskowa <markus.kowalewski@gmail.com>2020-01-25 23:44:48 +0100
committerGitHub <noreply@github.com>2020-01-25 23:44:48 +0100
commita30a49ca0b3cac55fcbe2779ccbab12b53d5c371 (patch)
tree65eea74353fcbaf8890e78ab7d8a0f5897bb4fc5
parentc4f1e93514ceef085bdee937557f2a61e2e6aaf6 (diff)
parent337662855748ebd4f8dbc05c54ca797aa36934e4 (diff)
downloadnixpkgs-a30a49ca0b3cac55fcbe2779ccbab12b53d5c371.tar
nixpkgs-a30a49ca0b3cac55fcbe2779ccbab12b53d5c371.tar.gz
nixpkgs-a30a49ca0b3cac55fcbe2779ccbab12b53d5c371.tar.bz2
nixpkgs-a30a49ca0b3cac55fcbe2779ccbab12b53d5c371.tar.lz
nixpkgs-a30a49ca0b3cac55fcbe2779ccbab12b53d5c371.tar.xz
nixpkgs-a30a49ca0b3cac55fcbe2779ccbab12b53d5c371.tar.zst
nixpkgs-a30a49ca0b3cac55fcbe2779ccbab12b53d5c371.zip
Merge pull request #78437 from samlich/pymol
pymol: 2.1.0 -> 2.3.0
-rw-r--r--maintainers/maintainer-list.nix10
-rw-r--r--pkgs/applications/science/chemistry/pymol/default.nix43
2 files changed, 34 insertions, 19 deletions
diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix
index e19c0b27714..a79221ce285 100644
--- a/maintainers/maintainer-list.nix
+++ b/maintainers/maintainer-list.nix
@@ -6187,6 +6187,16 @@
     githubId = 6022042;
     name = "Sam Parkinson";
   };
+  samlich = {
+    email = "nixos@samli.ch";
+    github = "samlich";
+    githubId = 1349989;
+    name = "samlich";
+    keys = [{
+      longkeyid = "rsa4096/B1568953B1939F1C";
+      fingerprint = "AE8C 0836 FDF6 3FFC 9580  C588 B156 8953 B193 9F1C";
+    }];
+  };
   samrose = {
    email = "samuel.rose@gmail.com";
    github = "samrose";
diff --git a/pkgs/applications/science/chemistry/pymol/default.nix b/pkgs/applications/science/chemistry/pymol/default.nix
index b1bd01fb2f7..e8b3b23ddd9 100644
--- a/pkgs/applications/science/chemistry/pymol/default.nix
+++ b/pkgs/applications/science/chemistry/pymol/default.nix
@@ -1,15 +1,10 @@
-{ stdenv, fetchurl, makeDesktopItem
+{ lib, stdenv, fetchurl, fetchFromGitHub, makeDesktopItem
 , python3, python3Packages
-, glew, freeglut, libpng, libxml2, tk, freetype, msgpack }:
+, glew, glm, freeglut, libpng, libxml2, tk, freetype, msgpack }:
 
 
-with stdenv.lib;
-
 let
   pname = "pymol";
-  ver_maj = "2";
-  ver_min = "1";
-  version = "${ver_maj}.${ver_min}.0";
   description = "A Python-enhanced molecular graphics tool";
 
   desktopItem = makeDesktopItem {
@@ -18,35 +13,45 @@ let
     desktopName = "PyMol Molecular Graphics System";
     genericName = "Molecular Modeler";
     comment = description;
+    icon = pname;
     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;";
   };
 in
-python3Packages.buildPythonApplication {
-  name = "pymol-${version}";
-  src = fetchurl {
-    url = "mirror://sourceforge/project/pymol/pymol/${ver_maj}/pymol-v${version}.tar.bz2";
-    sha256 = "1qpacd5w4r9a0nm5iqmkd92ym3ai00dp7v61cwd6jgakk6wfps3s";
+python3Packages.buildPythonApplication rec {
+  inherit pname;
+  version = "2.3.0";
+  src = fetchFromGitHub {
+    owner = "schrodinger";
+    repo = "pymol-open-source";
+    rev = "v${version}";
+    sha256 = "175cqi6gfmvv49i3ws19254m7ljs53fy6y82fm1ywshq2h2c93jh";
   };
 
-  buildInputs = [ python3Packages.numpy glew freeglut libpng libxml2 tk freetype msgpack ];
+  buildInputs = [ python3Packages.numpy glew glm freeglut libpng libxml2 tk freetype msgpack ];
   NIX_CFLAGS_COMPILE = "-I ${libxml2.dev}/include/libxml2";
+  hardeningDisable = [ "format" ];
+
+  setupPyBuildFlags = [ "--glut" ];
 
   installPhase = ''
-    python setup.py install --home=$out
-    cp -r ${desktopItem}/share/ $out/
+    python setup.py install --home="$out"
     runHook postInstall
   '';
 
   postInstall = with python3Packages; ''
     wrapProgram $out/bin/pymol \
-      --prefix PYTHONPATH : ${makeSearchPathOutput "lib" python3.sitePackages [ Pmw tkinter ]}
+      --prefix PYTHONPATH : ${lib.makeSearchPathOutput "lib" python3.sitePackages [ Pmw tkinter ]}
+
+    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/"
   '';
 
-  meta = {
+  meta = with lib; {
     description = description;
     homepage = https://www.pymol.org/;
-    license = licenses.psfl;
-    broken = true;
+    license = licenses.mit;
+    maintainers = with maintainers; [ samlich ];
   };
 }