Ticket #44284: python-pil-pillow-openmaintainer.diff

File python-pil-pillow-openmaintainer.diff, 8.7 KB (added by Ionic (Mihai Moldovan), 10 years ago)

Switch from py*-pil to path:-based dependency satisfiable by both py*-pil and py*-Pillow. Fix issue reported by ipe-tools maintainer. Add Pillow compat patches to comix.

  • graphics/comix/Portfile

    diff --git a/graphics/comix/Portfile b/graphics/comix/Portfile
    index f6a466f..5580ce1 100644
    a b PortSystem 1.0 
    44
    55name                comix
    66version             4.0.4
    7 revision            2
     7revision            3
    88categories          graphics
    99maintainers         perry openmaintainer
    1010platforms           darwin
    livecheck.regex {Comix (.*) released} 
    2222livecheck.type      regex
    2323livecheck.url       ${homepage}
    2424
    25 depends_lib         port:py26-pygtk port:py26-pil port:python26 port:unrar
     25patchfiles          patch-pillow-compat.diff
     26
     27set python.version  26
     28set python.branch   "[string range ${python.version} 0 end-1].[string index ${python.version} end]"
     29
     30depends_lib         port:py${python.version}-pygtk \
     31                    path:${frameworks_dir}/Python.framework/Versions/${python.branch}/lib/python${python.branch}/site-packages/PIL:py${python.version}-Pillow \
     32                    port:python${python.version} \
     33                    port:unrar
    2634
    2735master_sites        sourceforge
    2836
    use_configure no 
    3240
    3341build               {}
    3442
    35 set python.bin      ${prefix}/bin/python2.6
     43set python.bin      ${prefix}/bin/python${python.branch}
    3644
    3745pre-destroot {
    3846    reinplace "s|^#!/usr/bin/env python\$|#!${python.bin}|" ${worksrcpath}/src/comix.py
  • new file graphics/comix/files/patch-pillow-compat.diff

    diff --git a/graphics/comix/files/patch-pillow-compat.diff b/graphics/comix/files/patch-pillow-compat.diff
    new file mode 100644
    index 0000000..520cbbe
    - +  
     1--- install.py.old      2014-07-10 20:19:31.000000000 +0200
     2+++ install.py  2014-07-10 20:20:08.000000000 +0200
     3@@ -240,7 +240,7 @@
     4         print '    !!! PyGTK .................... Not found'
     5         required_found = False
     6     try:
     7-        import Image
     8+        from PIL import Image
     9         assert Image.VERSION >= '1.1.5'
     10         print '    Python Imaging Library ....... OK'
     11     except ImportError:
     12--- mime/comicthumb.old 2014-07-10 20:19:32.000000000 +0200
     13+++ mime/comicthumb     2014-07-10 20:20:08.000000000 +0200
     14@@ -22,7 +22,7 @@
     15 import subprocess
     16 
     17 try:
     18-    import Image
     19+    from PIL import Image
     20 except ImportError:
     21     print '! Could not import the Image module (PIL).'
     22     print __doc__
     23--- src/comix.py.old    2014-07-10 20:19:32.000000000 +0200
     24+++ src/comix.py        2014-07-10 20:20:08.000000000 +0200
     25@@ -49,7 +49,7 @@
     26     sys.exit(1)
     27 
     28 try:
     29-    import Image
     30+    from PIL import Image
     31     assert Image.VERSION >= '1.1.5'
     32 except AssertionError:
     33     print "You don't have the required version of the Python Imaging",
     34--- src/histogram.py.old        2014-07-10 20:19:32.000000000 +0200
     35+++ src/histogram.py    2014-07-10 20:20:08.000000000 +0200
     36@@ -1,9 +1,9 @@
     37 """histogram.py - Draw histograms (RGB) from pixbufs."""
     38 
     39 import gtk
     40-import Image
     41-import ImageDraw
     42-import ImageOps
     43+from PIL import Image
     44+from PIL import ImageDraw
     45+from PIL import ImageOps
     46 
     47 import image
     48 
     49--- src/image.py.old    2014-07-10 20:19:32.000000000 +0200
     50+++ src/image.py        2014-07-10 20:20:08.000000000 +0200
     51@@ -1,10 +1,10 @@
     52 """image.py - Various image manipulations."""
     53 
     54 import gtk
     55-import Image
     56-import ImageEnhance
     57-import ImageOps
     58-import ImageStat
     59+from PIL import Image
     60+from PIL import ImageEnhance
     61+from PIL import ImageOps
     62+from PIL import ImageStat
     63 
     64 from preferences import prefs
     65 
     66--- src/library.py.old  2014-07-10 20:19:32.000000000 +0200
     67+++ src/library.py      2014-07-10 20:20:08.000000000 +0200
     68@@ -8,8 +8,8 @@
     69 import gtk
     70 import gobject
     71 import pango
     72-import Image
     73-import ImageDraw
     74+from PIL import Image
     75+from PIL import ImageDraw
     76 
     77 import archive
     78 import encoding
     79--- src/thumbbar.py.old 2014-07-10 20:19:32.000000000 +0200
     80+++ src/thumbbar.py     2014-07-10 20:20:08.000000000 +0200
     81@@ -4,8 +4,8 @@
     82 
     83 import gtk
     84 import gobject
     85-import Image
     86-import ImageDraw
     87+from PIL import Image
     88+from PIL import ImageDraw
     89 
     90 import image
     91 from preferences import prefs
     92--- src/thumbnail.py.old        2014-07-10 20:19:32.000000000 +0200
     93+++ src/thumbnail.py    2014-07-10 20:20:08.000000000 +0200
     94@@ -15,7 +15,7 @@
     95 import tempfile
     96 
     97 import gtk
     98-import Image
     99+from PIL import Image
     100 
     101 import archive
     102 import constants
     103--- src/thumbremover.py.old     2014-07-10 20:19:32.000000000 +0200
     104+++ src/thumbremover.py 2014-07-10 20:20:08.000000000 +0200
     105@@ -7,7 +7,7 @@
     106 
     107 import gtk
     108 import pango
     109-import Image
     110+from PIL import Image
     111 
     112 import encoding
     113 import labels
  • graphics/ipe-tools/Portfile

    diff --git a/graphics/ipe-tools/Portfile b/graphics/ipe-tools/Portfile
    index 7ed8452..0bf479b 100644
    a b eval build.env CPPFLAGS+='${configure.cppflags}' \ 
    5959                        LDFLAGS+='${configure.cc_archflags}' \
    6060                        CC=${configure.cc} CXX=${configure.cxx}
    6161
     62set python.version  "DUMMY_VALUE_WILL_BE_OVERWRITTEN"
     63set python.branch   "DUMMY_VALUE_WILL_BE_OVERWRITTEN"
     64
    6265build {
    6366        system "cd ${workpath}/figtoipe-${figtoipe-vers} && ${build.env} ${build.cmd} ${build.target} CXX=${configure.cxx}"
    6467        system "cd ${workpath}/ipe5toxml && ${build.env} ${build.cmd}"
    variant python25 conflicts python24 python26 python27 description {Use PIL from 
    8992}
    9093
    9194variant python26 conflicts python24 python25 python27 description {Use PIL from MacPorts Python 2.6} {
    92     depends_lib-append port:py26-pil
     95    set python.version  26
     96    set python.branch   "[string range ${python.version} 0 end-1].[string index ${python.version} end]"
     97
     98    depends_lib-append  path:${frameworks_dir}/Python.framework/Versions/${python.branch}/lib/python${python.branch}/site-packages/PIL:py${python.version}-Pillow
    9399    post-patch {
    94         reinplace "s|__MP_PYTHON_BIN__|${prefix}/bin/python2.6|" ${workpath}/svgtoipe-${svgtoipe-vers}/svgtoipe.py
     100        reinplace "s|__MP_PYTHON_BIN__|${prefix}/bin/python${python.branch}|" ${workpath}/svgtoipe-${svgtoipe-vers}/svgtoipe.py
    95101    }
    96102}
    97103
    98104variant python27 conflicts python24 python25 python26 description {Use PIL from MacPorts Python 2.7} {
    99     depends_lib-append port:py27-pil
     105    set python.version  27
     106    set python.branch   "[string range ${python.version} 0 end-1].[string index ${python.version} end]"
     107
     108    depends_lib-append  path:${frameworks_dir}/Python.framework/Versions/${python.branch}/lib/python${python.branch}/site-packages/PIL:py${python.version}-Pillow
    100109    post-patch {
    101         reinplace "s|__MP_PYTHON_BIN__|${prefix}/bin/python2.7|" ${workpath}/svgtoipe-${svgtoipe-vers}/svgtoipe.py
     110        reinplace "s|__MP_PYTHON_BIN__|${prefix}/bin/python${python.branch}|" ${workpath}/svgtoipe-${svgtoipe-vers}/svgtoipe.py
    102111    }
    103112}
    104113
  • python/py-astlib/Portfile

    diff --git a/python/py-astlib/Portfile b/python/py-astlib/Portfile
    index 373aa5d..c996ffb 100644
    a b if {${name} ne ${subport}} { 
    3131                        port:py${python.version}-pyfits \
    3232                        port:py${python.version}-numpy \
    3333                        port:py${python.version}-scipy \
    34                         port:py${python.version}-matplotlib
    35 
    36     if {[expr ${python.branch} < 3]} {
    37         depends_lib-append \
    38                         port:py${python.version}-pil
    39     } else {
    40         depends_lib-append \
    41                         port:py${python.version}-pillow
    42     }
     34                        port:py${python.version}-matplotlib \
     35                        path:${python.pkgd}/PIL:py${python.version}-Pillow
    4336
    4437}
    4538
  • python/py-spyder-devel/Portfile

    diff --git a/python/py-spyder-devel/Portfile b/python/py-spyder-devel/Portfile
    index aedd863..293916e 100644
    a b if {${name} ne ${subport}} { 
    128128
    129129    if { ${python.version} < 30 } {
    130130        variant pil description {
    131            Support image objects in editor through PIL (many dependencies.)
     131           Support image objects in editor through PIL or Pillow (many dependencies.)
    132132        } {
    133133            depends_lib-append \
    134                 port:py${python.version}-pil
     134                path:${python.pkgd}/PIL:py${python.version}-Pillow
    135135        }
    136136    }
    137137
  • python/py-spyder/Portfile

    diff --git a/python/py-spyder/Portfile b/python/py-spyder/Portfile
    index af760d5..2cbaa31 100644
    a b if {${name} ne ${subport}} { 
    120120    }
    121121
    122122    variant pil description {
    123        Support image objects in editor through PIL (many dependencies.)
     123       Support image objects in editor through PIL or Pillow (many dependencies.)
    124124    } {
    125125        depends_lib-append \
    126             port:py${python.version}-pil
     126            path:${python.pkgd}/PIL:py${python.version}-Pillow
    127127    }
    128128
    129129    post-extract {