From 97410b59f3f6b04e0102f75315390877383892aa Mon Sep 17 00:00:00 2001 From: samlich <1349989+samlich@users.noreply.github.com> Date: Fri, 24 Jan 2020 19:42:59 +0000 Subject: [PATCH 1/5] pymol: 2.1.0 -> 2.3.0 --- .../science/chemistry/pymol/default.nix | 33 +++++++++---------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/pkgs/applications/science/chemistry/pymol/default.nix b/pkgs/applications/science/chemistry/pymol/default.nix index b1bd01fb2f7f..2169aef4fc08 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 { @@ -22,15 +17,20 @@ let 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 ]; - NIX_CFLAGS_COMPILE = "-I ${libxml2.dev}/include/libxml2"; + buildInputs = [ python3Packages.numpy glew glm freeglut libpng libxml2 tk freetype msgpack ]; + NIX_CFLAGS_COMPILE = "-I ${libxml2.dev}/include/libxml2 -Wno-error=format-security"; + + setupPyBuildFlags = [ "--glut" ]; installPhase = '' python setup.py install --home=$out @@ -40,13 +40,12 @@ python3Packages.buildPythonApplication { postInstall = with python3Packages; '' wrapProgram $out/bin/pymol \ - --prefix PYTHONPATH : ${makeSearchPathOutput "lib" python3.sitePackages [ Pmw tkinter ]} + --prefix PYTHONPATH : ${lib.makeSearchPathOutput "lib" python3.sitePackages [ Pmw tkinter ]} ''; meta = { description = description; homepage = https://www.pymol.org/; - license = licenses.psfl; - broken = true; + license = lib.licenses.psfl; }; } From db6ef4dccfa6ca05c6bf368137a48f9d6b94b238 Mon Sep 17 00:00:00 2001 From: samlich <1349989+samlich@users.noreply.github.com> Date: Fri, 24 Jan 2020 19:43:52 +0000 Subject: [PATCH 2/5] maintainers: add samlich --- maintainers/maintainer-list.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index bcfc7007b6b1..acd8bbcde8fd 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -6181,6 +6181,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"; From 3638755ff37ef01c8a95a2e54d209aea4e2e0aa9 Mon Sep 17 00:00:00 2001 From: samlich <1349989+samlich@users.noreply.github.com> Date: Fri, 24 Jan 2020 19:49:38 +0000 Subject: [PATCH 3/5] pymol: add samlich as maintainer --- pkgs/applications/science/chemistry/pymol/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/applications/science/chemistry/pymol/default.nix b/pkgs/applications/science/chemistry/pymol/default.nix index 2169aef4fc08..b20e7480657c 100644 --- a/pkgs/applications/science/chemistry/pymol/default.nix +++ b/pkgs/applications/science/chemistry/pymol/default.nix @@ -47,5 +47,6 @@ python3Packages.buildPythonApplication rec { description = description; homepage = https://www.pymol.org/; license = lib.licenses.psfl; + maintainers = with lib.maintainers; [ samlich ]; }; } From 77317774ce91f6e6aedcfa62ec7c9c2e30d4d5c0 Mon Sep 17 00:00:00 2001 From: samlich <1349989+samlich@users.noreply.github.com> Date: Fri, 24 Jan 2020 19:51:08 +0000 Subject: [PATCH 4/5] pymol: link desktop icon --- pkgs/applications/science/chemistry/pymol/default.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/science/chemistry/pymol/default.nix b/pkgs/applications/science/chemistry/pymol/default.nix index b20e7480657c..a0e1fa5a3aef 100644 --- a/pkgs/applications/science/chemistry/pymol/default.nix +++ b/pkgs/applications/science/chemistry/pymol/default.nix @@ -13,6 +13,7 @@ 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;"; }; @@ -33,14 +34,17 @@ python3Packages.buildPythonApplication rec { 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 : ${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 = { From 337662855748ebd4f8dbc05c54ca797aa36934e4 Mon Sep 17 00:00:00 2001 From: samlich <1349989+samlich@users.noreply.github.com> Date: Sat, 25 Jan 2020 19:58:36 +0000 Subject: [PATCH 5/5] pymol: cleanup --- pkgs/applications/science/chemistry/pymol/default.nix | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pkgs/applications/science/chemistry/pymol/default.nix b/pkgs/applications/science/chemistry/pymol/default.nix index a0e1fa5a3aef..e8b3b23ddd9d 100644 --- a/pkgs/applications/science/chemistry/pymol/default.nix +++ b/pkgs/applications/science/chemistry/pymol/default.nix @@ -29,7 +29,8 @@ python3Packages.buildPythonApplication rec { }; buildInputs = [ python3Packages.numpy glew glm freeglut libpng libxml2 tk freetype msgpack ]; - NIX_CFLAGS_COMPILE = "-I ${libxml2.dev}/include/libxml2 -Wno-error=format-security"; + NIX_CFLAGS_COMPILE = "-I ${libxml2.dev}/include/libxml2"; + hardeningDisable = [ "format" ]; setupPyBuildFlags = [ "--glut" ]; @@ -47,10 +48,10 @@ python3Packages.buildPythonApplication rec { cp -r "${desktopItem}/share/applications/" "$out/share/" ''; - meta = { + meta = with lib; { description = description; homepage = https://www.pymol.org/; - license = lib.licenses.psfl; - maintainers = with lib.maintainers; [ samlich ]; + license = licenses.mit; + maintainers = with maintainers; [ samlich ]; }; }