Commits

Zero King authored df0e28fb49e
weechat: refactor python variants

Fixes: https://trac.macports.org/ticket/59819
No tags

irc/weechat/Portfile

Modified
51 51 \n - and much more!
52 52
53 53 categories irc
54 54 maintainers {gmail.com:starkhalo @harciga} \
55 55 openmaintainer
56 56 platforms darwin
57 57
58 58 depends_build-append \
59 59 port:asciidoctor \
60 60 port:libxslt \
61 + port:pkgconfig \
61 62 port:docbook-xsl-nons
62 63
63 64 depends_lib-append \
64 65 port:curl \
65 66 port:gettext \
66 67 port:libgcrypt \
67 68 port:libiconv \
68 69 port:ncurses
69 70
70 71 license_noconflict asciidoctor
85 86 -DENABLE_TCL=OFF \
86 87 -DENABLE_JAVASCRIPT=OFF \
87 88 -DENABLE_PHP=OFF \
88 89 -DENABLE_MAN=ON
89 90
90 91 variant python requires python27 description {Compatibility variant, requires +python27} {}
91 92
92 93 variant python27 description "Bindings for python 2.7 plugins" conflicts python36 {
93 94 configure.args-replace -DENABLE_PYTHON=OFF -DENABLE_PYTHON=ON
94 95 configure.args-replace -DENABLE_PYTHON2=OFF -DENABLE_PYTHON2=ON
95 - configure.args-append -DPYTHON_EXECUTABLE=${prefix}/bin/python2.7
96 - configure.args-append -DPYTHON_INCLUDE_PATH=${frameworks_dir}/Python.framework/Versions/2.7/Headers
97 - configure.args-append -DPYTHON_LIBRARY=${frameworks_dir}/Python.framework/Versions/2.7/Python
98 96 depends_lib-append port:python27
99 97 }
100 98
101 99 variant python36 description "Bindings for python 3.6 plugins" conflicts python27 {
102 100 configure.args-replace -DENABLE_PYTHON=OFF -DENABLE_PYTHON=ON
103 - configure.args-append -DPYTHON_EXECUTABLE=${prefix}/bin/python3.6
104 - configure.args-append -DPYTHON_INCLUDE_PATH=${frameworks_dir}/Python.framework/Versions/3.6/Headers
105 - configure.args-append -DPYTHON_LIBRARY=${frameworks_dir}/Python.framework/Versions/3.6/Python
106 101 depends_lib-append port:python36
107 102 }
108 103
109 -post-configure {
110 - if {[variant_isset python27] || [variant_isset python36]} {
111 - set patchfile ${configure.dir}/src/plugins/python/CMakeFiles/python.dir/link.txt
104 +post-patch {
105 + set patchfile ${worksrcpath}/cmake/FindPython.cmake
112 106
113 - reinplace -E "s| \(Python.framework\)| ${frameworks_dir}/\\1|g" ${patchfile}
114 -
115 - if {[variant_isset python36]} {
116 - reinplace -E "s|-Wl,-stack_size,1000000||" ${patchfile}
117 - }
107 + if {[variant_isset python27]} {
108 + reinplace -E "s|PYTHON python2|PYTHON python-2.7|g" ${patchfile}
109 + }
110 + if {[variant_isset python36]} {
111 + reinplace -E "s|PYTHON python3|PYTHON python-3.6|g" ${patchfile}
118 112 }
119 113 }
120 114
121 115 variant tcl description {Support for tcl} {
122 116 configure.args-delete -DENABLE_TCL=OFF
123 117 configure.args-append -DENABLE_TCL=ON
124 118 depends_lib-append port:tcl
125 119 }
126 120
127 121 variant aspell description {Support for aspell} {

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut