Ticket #44306: gpodder-cleanup-python-usage.patch

File gpodder-cleanup-python-usage.patch, 3.5 KB (added by Ionic (Mihai Moldovan), 10 years ago)

Introduce common variables and set them in python variants to simplify python usage via those variables -- set only once.

  • gnome/gpodder/Portfile

    commit dcf55ea583d68e00a02a6c1f647e2814544e2b0d
    Author: Mihai Moldovan <ionic@ionic.de>
    Date:   Wed Jul 9 00:37:21 2014 +0200
    
        Change python based and using ports to not depend on py*-pil, but instead a path:-based alternative which allows usage of both PIL and Pillow.
    
    diff --git a/gnome/gpodder/Portfile b/gnome/gpodder/Portfile
    index 0efaa4a..78fc434 100644
    a b depends_build port:help2man\ 
    3131depends_lib         port:vorbis-tools\
    3232                    port:lame
    3333
    34 set my_python "DUMMY_VALUE_WILL_BE_OVERWRITTEN"
     34set my_python       "DUMMY_VALUE_WILL_BE_OVERWRITTEN"
     35set python.version  "DUMMY_VALUE_WILL_BE_OVERWRITTEN"
     36set python.branch   "DUMMY_VALUE_WILL_BE_OVERWRITTEN"
    3537
    3638variant python26 conflicts description {Use Python 2.6} {
    37     depends_lib-append  port:py26-feedparser\
    38                         port:dbus-python26\
    39                         port:py26-mygpoclient \
    40                         port:py26-pygtk
    41    
    42     set my_python "${frameworks_dir}/Python.framework/Versions/2.6"
     39    set python.version  26
     40    set python.branch "[string range ${python.version} 0 end-1].[string index ${python.version} end]"
     41
     42    set my_python "${frameworks_dir}/Python.framework/Versions/${python.branch}"
     43
     44    depends_lib-append  port:py${python.version}-feedparser \
     45                        port:dbus-python${python.version} \
     46                        port:py${python.version}-mygpoclient \
     47                        port:py${python.version}-pygtk
    4348
    4449    post-patch {
    4550        reinplace s|python|${my_python}/bin/python|g ${worksrcpath}/Makefile
    4651    }
    4752   
    4853    # install in python 2.6 prefix, see bug #22522
    49     destroot.args PREFIX=${frameworks_dir}/Python.framework/Versions/2.6
     54    destroot.args PREFIX=${my_python}
    5055   
    5156    # Install the 2.6 apps in the standard path :
    5257    # the 2 variants can't be active simultaneously.
    variant python26 conflicts description {Use Python 2.6} { 
    5863}
    5964
    6065variant python27 conflicts python26 conflicts description {Use Python 2.7} {
    61     depends_lib-append  port:py27-feedparser\
    62                         port:dbus-python27\
    63                         port:py27-mygpoclient \
    64                         port:py27-pygtk
     66    set python.version  27
     67    set python.branch   "[string range ${python.version} 0 end-1].[string index ${python.version} end]"
     68
     69    set my_python "${frameworks_dir}/Python.framework/Versions/${python.branch}"
     70
     71    depends_lib-append  port:py${python.version}-feedparser \
     72                        port:dbus-python${python.version} \
     73                        port:py${python.version}-mygpoclient \
     74                        port:py${python.version}-pygtk
    6575
    66     set my_python "${frameworks_dir}/Python.framework/Versions/2.7"
    67    
    6876    post-patch {
    6977        reinplace s|python|${my_python}/bin/python|g ${worksrcpath}/Makefile
    7078    }
    7179
    7280    # install in python 2.7 prefix, see bug #22522
    73     destroot.args PREFIX=${frameworks_dir}/Python.framework/Versions/2.7
     81    destroot.args PREFIX=${my_python}
    7482
    7583    # Install the 2.7 apps in the standard path :
    7684    # the 2 variants can't be active simultaneously.
    variant quartz { 
    99107}
    100108
    101109variant html_notes description {Use WebkitGtk+ to show episode notes in HTML format} {
    102         if {[variant_isset python26]} {
    103                 depends_lib-append  port:py26-webkitgtk
    104         } else {
    105                 depends_lib-append  port:py27-webkitgtk
     110        if {[variant_isset python26] || [variant_isset python27]} {
     111                depends_lib-append  port:py${python.version}-webkitgtk
    106112        }
    107113}
    108114