From 5464957a5ec7cd831ed1aa5f73b25635a9c5860a Mon Sep 17 00:00:00 2001
From: Pjotr Prins
Date: Fri, 6 Sep 2019 03:17:41 -0500
Subject: Added old pil package

---
 gn/packages/python.scm | 120 +++++++++++++++++++++++++++++++++++++------------
 1 file changed, 91 insertions(+), 29 deletions(-)

diff --git a/gn/packages/python.scm b/gn/packages/python.scm
index 3c03e26..1a85744 100644
--- a/gn/packages/python.scm
+++ b/gn/packages/python.scm
@@ -560,9 +560,98 @@ project)")
   (description #f)
   (license #f)))
 
+(define-public python2-pil1-gn ; guix obsolete
+  (package
+    (name "python2-pil1") ; works with GN2
+    (version "1.1.6")
+    (source (origin
+             (method url-fetch)
+             (uri (string-append
+                   "http://files.genenetwork.org/software/contrib/Imaging-"
+                   version "-gn.tar.gz"))
+             (sha256
+              (base32
+               "0jhinbcq2k899c76m1jc5a3z39k6ajghiavpzi6991hbg6xhxdzg"))
+    (modules '((guix build utils)))
+    (snippet
+     ;; Adapt to newer freetype. As the package is unmaintained upstream,
+     ;; there is no use in creating a patch and reporting it.
+     '(substitute* "_imagingft.c"
+                   (("freetype/")
+                    "freetype2/freetype/")))))
+    (build-system python-build-system)
+    (inputs
+      `(("freetype" ,freetype)
+        ("libjpeg" ,libjpeg)
+        ("libtiff" ,libtiff)
+        ("python2-setuptools" ,python2-setuptools)
+        ("zlib" ,zlib)))
+    (arguments
+     ;; Only the fork python-pillow works with Python 3.
+     `(#:python ,python-2
+       #:tests? #f ; no check target
+       #:phases
+         (alist-cons-before
+          'build 'configure
+          ;; According to README and setup.py, manual configuration is
+          ;; the preferred way of "searching" for inputs.
+          ;; lcms is not found, TCL_ROOT refers to the unavailable tkinter.
+          (lambda* (#:key inputs #:allow-other-keys)
+            (let ((jpeg (assoc-ref inputs "libjpeg"))
+                  (zlib (assoc-ref inputs "zlib"))
+                  (tiff (assoc-ref inputs "libtiff"))
+                  (freetype (assoc-ref inputs "freetype")))
+              (substitute* "setup.py"
+                (("JPEG_ROOT = None")
+                 (string-append "JPEG_ROOT = libinclude(\"" jpeg "\")"))
+                (("ZLIB_ROOT = None")
+                 (string-append "ZLIB_ROOT = libinclude(\"" zlib "\")"))
+                (("TIFF_ROOT = None")
+                 (string-append "TIFF_ROOT = libinclude(\"" tiff "\")"))
+                (("FREETYPE_ROOT = None")
+                 (string-append "FREETYPE_ROOT = libinclude(\""
+                                freetype "\")")))))
+          %standard-phases)))
+    (home-page "http://www.pythonware.com/products/pil/")
+    (synopsis "Python Imaging Library")
+    (description "The Python Imaging Library (PIL) adds image processing
+capabilities to the Python interpreter.")
+    (license (license:x11-style
+               "file://README"
+               "See 'README' in the distribution."))))
+
+(define-public python2-piddle-gn ; guix obsolete
+  (package
+    (name "python2-piddle")
+    (version "1.0.15-gn-PIL1")
+    (source (origin
+     (method url-fetch)
+     (uri (string-append
+           "http://files.genenetwork.org/software/contrib/piddle-"
+version ".tgz"))
+     (sha256
+      (base32
+       "1m89xp0d7d5a0nd483qir7zq99ci6wab1r018i698wjdpr8zf86b"))))
+
+    (build-system python-build-system)
+    (native-inputs
+     `(("python2-setuptools" ,python2-setuptools)))
+    (propagated-inputs
+     `(("python2-pil1" ,python2-pil1-gn)))
+    (arguments
+     `(
+       #:python ,python-2
+       #:tests? #f   ; no 'setup.py test' really!
+    ))
+    (home-page #f)
+    (synopsis "Canvas drawing library for python2 (old!)")
+    (description #f)
+    (license #f)))
+
+
 (define-public python2-pil1 ; guix obsolete
   (package
-    (name "python2-pil1")
+    (name "python2-pil1") ; this version is NOT used by genenetwork
     (version "1.1.7")
     (source (origin
              (method url-fetch)
@@ -629,34 +718,7 @@ NOTE: This package is superseded by python-pillow")
                "file://README"
                "See 'README' in the distribution."))))
 
-(define-public python2-piddle-gn ; guix obsolete
-  (package
-    (name "python2-piddle")
-    (version "1.0.15-gn-PIL1")
-    (source (origin
-     (method url-fetch)
-     (uri (string-append
-           "http://files.genenetwork.org/software/contrib/piddle-"
-version ".tgz"))
-     (sha256
-      (base32
-       "1m89xp0d7d5a0nd483qir7zq99ci6wab1r018i698wjdpr8zf86b"))))
-
-    (build-system python-build-system)
-    (native-inputs
-     `(("python2-setuptools" ,python2-setuptools)))
-    (propagated-inputs
-     `(("python2-pil1" ,python2-pil1)))
-    (arguments
-     `(
-       #:python ,python-2
-       #:tests? #f   ; no 'setup.py test' really!
-    ))
-    (home-page #f)
-    (synopsis "Canvas drawing library for python2 (old!)")
-    (description #f)
-    (license #f)))
-
+; upstream version won't work with gn2
 (define-public python2-piddle-1.0.15
   (package
     (name "python2-piddle")
-- 
cgit v1.2.3