Subject: [PATCH] gnu: python-pymol: Fix launch script.

From: David Elsing <[email-masked]>
Date: Mon, 3 Jul 2023 21:31:10 +0000

* gnu/packages/chemistry.scm (python-pymol)[#:phases]: Add ‘disable-unchroot’.
[native-inputs]: Remove python-setuptools.
---
 gnu/packages/chemistry.scm | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/chemistry.scm b/gnu/packages/chemistry.scm
index cddccf8aea..1f8b051a85 100644
--- a/gnu/packages/chemistry.scm
+++ b/gnu/packages/chemistry.scm
@@ -6,7 +6,7 @@
 ;;; Copyright © 2020 Björn Höfling <[email-masked]>
 ;;; Copyright © 2020 Vincent Legoll <[email-masked]>
 ;;; Copyright © 2021 Ricardo Wurmus <[email-masked]>
-;;; Copyright © 2022 David Elsing <[email-masked]>
+;;; Copyright © 2022, 2023 David Elsing <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -554,6 +554,12 @@ (define-public python-pymol
                                     (assoc-ref inputs "libxml2")
                                     "/include/libxml2:"
                                     (getenv "CPLUS_INCLUDE_PATH")))))
+         ;; Prevent deleting the leading / in the __init__.py path in the
+         ;; launch script.
+         (add-after 'unpack 'disable-unchroot
+           (lambda _
+             (substitute* "setup.py"
+               (("self\\.unchroot") ""))))
          ;; The setup.py script does not support one of the Python build
          ;; system's default flags, "--single-version-externally-managed".
          (replace 'install
@@ -572,8 +578,7 @@ (define-public python-pymol
            python-pyqt
            glm
            netcdf))
-    (native-inputs
-     (list catch2 python-setuptools))
+    (native-inputs (list catch2))
     (home-page "https://pymol.org")
     (synopsis "Molecular visualization system")
     (description "PyMOL is a capable molecular viewer and renderer.  It can be
-- 
2.40.1