Ticket #38596: Portfile.diff
File Portfile.diff, 15.9 KB (added by stromnov (Andrey Stromnov), 12 years ago) |
---|
-
Portfile
3 3 4 4 PortSystem 1.0 5 5 6 categories math science7 6 name shogun 8 version 0.9.3 9 revision 1 7 version 2.1.0 10 8 set branch [join [lrange [split ${version} .] 0 1] .] 9 revision 0 10 categories-append science 11 platforms darwin 11 12 license GPL-3 12 maintainers jameskyle13 13 14 platforms darwin 14 maintainers jameskyle openmaintainer 15 15 16 16 description The machine learning toolbox's focus is on large scale \ 17 17 kernel methods … … 23 23 24 24 homepage http://shogun-toolbox.org 25 25 master_sites ${homepage}/archives/shogun/releases/${branch}/sources/ 26 26 27 use_bzip2 yes 27 28 28 checksums md5 99afbb304d524335fc181c553047cb51 \ 29 sha1 d559dff3e11f777a23f00278d78d259ad896b829 \ 30 rmd160 9638a6b747a1177b048720b8999c60f33c7df5ef 29 checksums rmd160 5fece569be7d95bbe9ad406f1b5e10f06f4ac20e \ 30 sha256 6c47941a98d506d7b1e21d5bfd511f8684a2e1f371accd4756cdc8821916a63b 31 31 32 32 worksrcdir ${name}-${version}/src 33 33 34 patchfiles swig_version.patch34 patchfiles patch-src_configure.diff 35 35 36 depends_build port:bzip2 \ 37 port:gsed 36 post-patch { 37 reinplace "s|@@MAKEDEPEND@@|${configure.cc} -MM|g" ${worksrcpath}/configure 38 } 38 39 39 depends_lib port:swig-python \ 40 depends_lib port:hdf5-18 \ 41 port:json-c \ 42 port:libxml2 \ 43 port:readline \ 40 44 port:atlas \ 41 port:readline \ 45 port:arpack \ 46 port:eigen3 \ 47 port:lp_solve \ 42 48 port:glpk \ 43 port:python26 \ 44 port:py26-numpy \ 45 port:hdf5-18 49 port:lzo2 \ 50 port:snappy \ 51 port:gzip \ 52 port:bzip2 \ 53 port:xz 46 54 47 55 universal_variant no 48 56 49 set python_prefix ${prefix}/Library/Frameworks/Python.framework/Versions/2.650 configure.args --disable-svm-light \51 --libs=${prefix}/lib \52 --install-path=${prefix} \53 --includes=${prefix}/include \54 --destdir=${destroot} \55 --includes=${python_prefix}/include/python2.6 \56 --python=${python_prefix}/bin/python2.6 \57 --pydir=${python_prefix}/lib/python2.6/site-packages \58 --disable-doxygen \59 --disable-hdf560 61 57 pre-fetch { 62 if {[ regexp {^[2-8]} ${os.major}]} {63 return -code error "Shogun is only supported on leopard or above"64 }58 if {${os.major} <= 8} { 59 return -code error "Shogun is only supported on Leopard or above" 60 } 65 61 } 66 62 67 proc lremove {list elem} { 68 set index [lsearch -exact $list $elem] 69 return [lreplace $list $index $index] 63 # Define compilers variants 64 variant gcc45 conflicts gcc46 gcc47 gcc48 clang33 description {Compile with gcc 4.5} { 65 configure.compiler macports-gcc-4.5 66 depends_lib-append port:gcc45 67 configure.args-append --ldflags=-lgfortran 70 68 } 71 69 72 # Interfaces are added by a comma delimited argument list to --interfaces. 73 # We check for variants and then build this list accordingly 74 set interfaces "libshogun libshogunui cmdline python python_modular" 70 variant gcc46 conflicts gcc45 gcc47 gcc48 clang33 description {Compile with gcc 4.6} { 71 configure.compiler macports-gcc-4.6 72 depends_lib-append port:gcc46 73 configure.args-append --ldflags=-lgfortran 74 } 75 75 76 if {[variant_isset r]} {lappend interfaces "r"} 77 if {[variant_isset octave]} {lappend interfaces "octave,octave_modular"} 78 if {[variant_isset elwms] && !([variant_isset python] && 79 [variant_isset octave] && [variant_isset r])} { 80 return -code error "Must set python and both r and octave variants to build elwms interface" 81 } elseif {[variant_isset elwms]} { 82 lappend interfaces "elwms" 76 variant gcc47 conflicts gcc45 gcc46 gcc48 clang33 description {Compile with gcc 4.7} { 77 configure.compiler macports-gcc-4.7 78 depends_lib-append port:gcc47 79 configure.args-append --ldflags=-lgfortran 83 80 } 84 81 85 # remove python interface if necessary before appending to args 86 if {[variant_isset no_python26] && ![variant_isset python25]} { 87 set interfaces [lremove ${interfaces} "python"] 88 set interfaces [lremove ${interfaces} "python_modular"] 89 depends_lib-delete port:swig-python 82 variant gcc48 conflicts gcc45 gcc46 gcc47 clang33 description {Compile with gcc 4.8} { 83 configure.compiler macports-gcc-4.8 84 depends_lib-append port:gcc48 85 configure.args-append --ldflags=-lgfortran 90 86 } 91 87 92 #if {[variant_isset matlab]} {lappend interfaces "matlab"} 93 set interfaces [join $interfaces ","] 88 variant clang33 conflicts gcc45 gcc46 gcc47 gcc48 description {Compile with clang 3.3} { 89 configure.compiler macports-clang-3.3 90 depends_lib-append port:clang-3.3 \ 91 port:gcc47 92 configure.args-delete --disable-cpudetection 93 configure.args-append --enable-cpudetection \ 94 --ldflags=-lgfortran 95 configure.env-append POSTLINKFLAGS="-L${prefix}/lib/gcc47" 96 } 94 97 95 configure.args-append --interfaces=$interfaces 98 if {![variant_isset gcc45] && ![variant_isset gcc46] && 99 ![variant_isset gcc48] && ![variant_isset clang33] 100 } then { 101 default_variants +gcc47 102 } 96 103 97 variant elwms description {Build elwms interface. requires python plus one other interface} {} 104 # Define python variants 105 set pythons_suffixes {26 27} 98 106 99 variant python25 requires no_python26 description {Build Python 2.5 API} { 100 configure.args-append \ 101 --includes=${prefix}/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 \ 102 --python=${prefix}/Library/Frameworks/Python.framework/Versions/2.5/bin/python \ 103 --pydir=${prefix}/Library/Frameworks/Python.framework/Versions/2.5/site-packages 104 depends_lib-append port:python25 \ 105 port:py25-numpy 107 set pythons_ports {} 108 foreach s ${pythons_suffixes} { 109 lappend pythons_ports python${s} 106 110 } 107 111 108 variant hmm_parallel description {Enable parallel structures in hmm training} { 109 configure.args-append --enable-hmm-parallel 112 proc python_prefix {} { 113 global prefix pythons_suffixes 114 foreach s ${pythons_suffixes} { 115 if {[variant_isset python${s}]} { 116 set p ${prefix}/bin/python[string index ${s} 0].[string index ${s} 1] 117 return [file normalize [exec ${p} -c "import sys; print(sys.prefix)"]] 118 } 119 } 120 error "Python support not enabled." 110 121 } 111 122 112 variant no_python26 description {Do not build Python 2.6 API} { 113 configure.args-delete \ 114 --includes=${python_prefix}/include/python2.6 \ 115 --python=${python_prefix}/bin/python2.6 \ 116 --pydir=${python_prefix}/lib/python2.6/site-packages 123 foreach s ${pythons_suffixes} { 124 set p python${s} 125 set v [string index ${s} 0].[string index ${s} 1] 126 set i [lsearch -exact ${pythons_ports} ${p}] 127 set c [lreplace ${pythons_ports} ${i} ${i}] 128 eval [subst { 129 variant ${p} description "Use Python ${v} for python bindings" conflicts ${c} { 130 depends_lib-append port:${p} \ 131 port:py${s}-numpy \ 132 port:swig-python 133 set py_prefix \[python_prefix\] 134 configure.args-append --python=${prefix}/bin/python${v} \ 135 --pydir=\${py_prefix}/lib/python${v}/site-packages \ 136 --includes=\${py_prefix}/include/python${v} 137 post-patch { 138 reinplace "s|^PYTHON=python$|PYTHON=${prefix}/bin/python${v}|g" ${worksrcpath}/configure 139 } 140 } 141 }] 142 } 117 143 118 119 depends_lib-delete port:python26 \ 120 port:py26-numpy 121 144 variant perl description {Build the Perl API} { 145 depends_lib-append port:swig-perl 122 146 } 123 147 124 148 variant r description {Build the R API} { 125 depends_lib-append port:swig-r149 depends_lib-append port:swig-r 126 150 } 127 151 128 152 variant octave description {Build the Octave API} { 129 depends_lib-append port:swig-octave153 depends_lib-append port:swig-octave 130 154 } 131 155 132 variant no_glpk description {Disable glpk support} { 133 configure.args-append --disable-glpk 134 depends_lib-delete port:glpk 156 variant java description {Build the Java API} { 157 depends_lib-append port:swig-java 135 158 } 136 159 137 #variant matlab description {Build the Matlab API} {} 138 # variant doc description {Install the documentation for shogun} { 139 # depends_build-append port:texlive \ 140 # path:bin/dot:graphviz \ 141 # port:doxygen 142 # 143 # configure.args-delete --disable-doxygen 144 # } 160 variant csharp description {Build the C# API} { 161 depends_lib-append port:swig-csharp 162 } 145 163 146 variant gcc43 conflicts gcc44 gcc45 gcc46 gcc47 description {build with gcc 4.3} {} 147 variant gcc44 conflicts gcc43 gcc45 gcc46 gcc47 description {build with gcc 4.4} {} 148 variant gcc45 conflicts gcc43 gcc44 gcc46 gcc47 description {build with gcc 4.5} {} 149 variant gcc46 conflicts gcc43 gcc44 gcc45 gcc47 description {build with gcc 4.6} {} 150 variant gcc47 conflicts gcc43 gcc44 gcc45 gcc46 description {build with gcc 4.7} {} 164 variant lua description {Build the Lua API} { 165 depends_lib-append port:swig-lua 166 } 151 167 152 if {[variant_isset gcc43]} { 153 set gccversion 4.3 154 } elseif {[variant_isset gcc44]} { 155 set gccversion 4.4 156 } elseif {[variant_isset gcc45]} { 157 set gccversion 4.5 158 } elseif {[variant_isset gcc46]} { 159 set gccversion 4.6 160 } else { 161 default_variants +gcc47 162 set gccversion 4.7 168 variant ruby description {Build the Ruby API} { 169 depends_lib-append port:swig-ruby 163 170 } 164 171 165 set gccnumber [join [split ${gccversion} .] ""] 172 variant elwms description {Build the elwms (eierlegende wollmilchsau) interface. Requires python plus one other interface} { 173 } 166 174 167 depends_lib-append port:gcc${gccnumber} 168 configure.cc ${prefix}/bin/gcc-mp-${gccversion} 169 configure.compiler macports-gcc-${gccversion} 170 configure.args-append --cc=${prefix}/bin/gcc-mp-${gccversion} \ 171 --cxx=${prefix}/bin/g++-mp-${gccversion} 175 variant hmm_parallel description {Enable parallel structures in hmm training} { 176 configure.args-delete --disable-hmm-parallel 177 configure.args-append --enable-hmm-parallel 178 } 172 179 173 pr e-configure{174 reinplace "s|@@PREFIX@@|${prefix}|g" ${worksrcpath}/configure175 reinplace "s|= $\{_libdir\}/$\{_pydir\}|= $\{_pydir\}|g" ${worksrcpath}/configure180 proc lremove {list elem} { 181 set index [lsearch -exact $list $elem] 182 return [lreplace $list $index $index] 176 183 } 177 post-destroot {178 if {[variant_isset doc]} {179 system "cd ${worksrcpath}/../doc && make"180 file mkdir ${destroot}${prefix}/share/doc/${name}181 file copy ${worksrcpath}/../doc ${destroot}${prefix}/share/doc/${name}/doc182 184 183 } 185 # Interfaces are added by a comma delimited argument list to --interfaces. 186 # We check for variants and then build this list accordingly 187 set interfaces "cmdline_static" 188 189 if {[variant_isset python26] || [variant_isset python27]} { 190 lappend interfaces "python_modular" 184 191 } 185 192 186 livecheck.url http://www.shogun-toolbox.org 187 livecheck.regex {SHOGUN Version ([0-9.]+).*} 193 if {[variant_isset perl]} { 194 lappend interfaces "perl_modular" 195 } 196 197 if {[variant_isset r]} { 198 lappend interfaces "r_modular" 199 } 200 201 if {[variant_isset octave]} { 202 lappend interfaces "octave_modular" 203 } 204 205 if {[variant_isset java]} { 206 lappend interfaces "java_modular" 207 } 208 209 if {[variant_isset csharp]} { 210 lappend interfaces "csharp_modular" 211 } 212 213 if {[variant_isset lua]} { 214 lappend interfaces "lua_modular" 215 } 216 217 if {[variant_isset ruby]} { 218 lappend interfaces "ruby_modular" 219 } 220 221 if {[variant_isset elwms] && !(([variant_isset python26] || [variant_isset python27]) && [variant_isset octave] && [variant_isset r])} { 222 return -code error "Must set python2x and both r and octave variants to build elwms interface" 223 } elseif {[variant_isset elwms]} { 224 lappend interfaces "elwms_static" 225 } 226 227 configure.args-append \ 228 --enable-hdf5 \ 229 --enable-json \ 230 --enable-xml \ 231 --enable-readline \ 232 --enable-largefile \ 233 --disable-spinlocks \ 234 --enable-lapack \ 235 --enable-arpack \ 236 --disable-mosek \ 237 --disable-superlu \ 238 --disable-nlopt \ 239 --enable-eigen3 \ 240 --disable-cplex \ 241 --enable-lpsolve \ 242 --enable-glpk \ 243 --enable-lzo \ 244 --enable-snappy \ 245 --enable-gzip \ 246 --enable-bzip2 \ 247 --enable-lzma \ 248 --enable-bigstates \ 249 --enable-hmmcache \ 250 --enable-svm-light \ 251 --disable-logcache \ 252 --enable-shortrealkernelcache \ 253 --enable-logsum-array \ 254 --disable-hmm-parallel \ 255 --disable-doxygen \ 256 --enable-optimization \ 257 --disable-cpudetection \ 258 --includes=${prefix}/include \ 259 --libs=${prefix}/lib \ 260 --destdir=${destroot} \ 261 --prefix=${prefix} 262 263 set interfaces [join $interfaces ","] 264 265 configure.args-append --interfaces=$interfaces 266 267 livecheck.type regex 268 livecheck.url http://www.shogun-toolbox.org 269 livecheck.regex {SHOGUN ([0-9.]+)} -
files/patch-src_configure.diff
1 --- configure.orig 2013-03-28 23:54:09.000000000 +0400 2 +++ configure 2013-03-30 23:32:20.000000000 +0400 3 @@ -16,7 +16,7 @@ 4 # some hopefully reasonable defaults 5 LDD=ldd 6 POSTLINKCMD="true" 7 -MAKEDEPEND="gcc -MM" 8 +MAKEDEPEND="@@MAKEDEPEND@@" 9 MAKEDEPENDOPTS="" 10 SRCDIR="`dirname $0`" 11 LIBRARY_PATH=LD_LIBRARY_PATH 12 @@ -184,7 +184,7 @@ 13 DEFINES_SWIG= 14 PRELINKFLAGS= 15 LINKFLAGS= 16 -POSTLINKFLAGS= 17 +test "$POSTLINKFLAGS" && POSTLINKFLAGS="$POSTLINKFLAGS" 18 19 INCLUDES_STATIC_INTERFACES= 20 LINKFLAGS_STATIC_INTEFACES= 21 @@ -4003,7 +4003,7 @@ 22 } 23 EOF 24 echocheck "lpsolve Developer Files" 25 - LPSOLVELINKFLAGS="-L /usr/lib/lp_solve -llpsolve55" 26 + LPSOLVELINKFLAGS="-llpsolve55" 27 if cc_check $LPSOLVELINKFLAGS 28 then 29 echores "yes" 30 @@ -5011,6 +5011,7 @@ 31 if test "$_readline" = yes || test "$_readline" = auto; 32 then 33 cat > $TMPC << EOF 34 +#include <stdio.h> 35 #include <readline/readline.h> 36 int main(void) { return 0; } 37 EOF 38 @@ -5274,7 +5275,7 @@ 39 CONFDIR = ${_confdir} 40 INCDIR = ${_incdir} 41 LIBDIR = ${_libdir} 42 -PYDIR = ${_libdir}/${_pydir} 43 +PYDIR = ${_pydir} 44 OCTDIR = ${_octdir} 45 RDIR = ${_rdir} 46 EOF -
files/swig_version.patch
1 --- configure.old 2010-06-29 10:41:05.000000000 -07002 +++ configure 2010-06-29 10:42:07.000000000 -07003 @@ -2864,7 +2864,8 @@4 die "swig did not return version information"5 fi6 if [ `echo $_swig_version | cut -f 2 -d '.'` -ge 4 ] || \7 - [ `echo $_swig_version | cut -f 3 -d '.'` -ge 29 ]8 + [ `echo $_swig_version | cut -f 3 -d '.'` -ge 29 ] || \9 + [ `echo $_swig_version | cut -f 1 -d '.'` -ge 2 ]10 then11 echores "`${SWIG} -version 2>&1 | grep Version | cut -f 3 -d ' '`"12