44 | | configure.args -DSKIP_BUILD_RPATH=TRUE \ |
45 | | -DCMAKE_VERBOSE_MAKEFILE=ON \ |
46 | | -DCMAKE_BUILD_TYPE=Release \ |
47 | | -DCMAKE_SYSTEM_PREFIX_PATH=\"${prefix}\;/usr\" \ |
48 | | -DCMAKE_INSTALL_PREFIX=${prefix} \ |
49 | | -DCMAKE_INSTALL_NAME_DIR=${prefix}/lib \ |
50 | | -DCMAKE_INCLUDE_PATH=${prefix}/include \ |
51 | | -DCMAKE_LIBRARY_PATH=${prefix}/lib \ |
52 | | -DJPEG_INCLUDE_DIR=${prefix}/include \ |
53 | | -DPNG_PNG_INCLUDE_DIR=${prefix}/include \ |
54 | | -DTIFF_INCLUDE_DIR=${prefix}/include \ |
55 | | -Wno-dev \ |
56 | | -DBUILD_SHARED_LIBS=ON |
57 | | configure.post_args . |
| 41 | # Correct the INSTALL_NAME_DIR for Python .so modules |
| 42 | # and patch template names in the accumulator-grammar. |
| 43 | patchfiles patch-config-VIGRA_ADD_NUMPY_MODULE.cmake.diff \ |
| 44 | patch-include-vigra-accumulator-grammar.hxx.diff |
| 45 | |
| 46 | # Some additional parameters for cmake. All other params have already been set |
| 47 | # by the cmake PortGroup |
| 48 | configure.args-append -DCMAKE_INSTALL_PREFIX=${prefix} \ |
| 49 | -DWITH_OPENEXR=ON \ |
| 50 | -DBUILD_SHARED_LIBS=ON |
| 51 | |
| 52 | # Restrict the usable compilers to clang and llvm |
| 53 | # (either XCode >4.0 or MacPorts) and select the |
| 54 | # macports-clang-3.2 if no appropriate compiler |
| 55 | # is present: |
| 56 | if { [string match *llvm* "${configure.compiler}"] == 0 \ |
| 57 | && [string match *clang* "${configure.compiler}"] == 0} { |
| 58 | depends_build-append port:clang-3.1 |
| 59 | configure.compiler macports-clang-3.1 |
| 60 | } |
94 | | # just like it's done in games/PlasmaClient and other ports that |
95 | | # require Boost::Python. |
96 | | if {![file exists ${prefix}/lib/libboost_python-mt.dylib]} { |
97 | | # just disable NUMPY bindings via a CMake flag |
98 | | configure.args-append -DWITH_VIGRANUMPY=NO |
99 | | |
100 | | pre-fetch { |
101 | | ui_msg " |
102 | | **** |
103 | | **** To get NUMPY bindings, ${name} requires the port 'boost' to |
104 | | **** be installed with the variant +python26. If you want NUMPY |
105 | | **** bindings, then please do the following first: |
106 | | **** |
107 | | **** sudo port install boost +python26 |
108 | | **** |
109 | | **** and then try installing ${name} again. |
110 | | **** |
111 | | " |
112 | | } |
113 | | } else { |
114 | | # assume Python version 2.6, no matter what the user has actually |
115 | | # installed via "port install boost +pythonXY". |
116 | | set python_version "2.6" |
117 | | |
118 | | # append cmake flags |
119 | | configure.args-append \ |
120 | | -DPYTHON_EXECUTABLE=${prefix}/bin/python${python_version} \ |
121 | | -DPYTHON_SPHINX=${prefix}/bin/sphinx-build-${python_version} |
122 | | |
123 | | # make sure dependencies are installed |
124 | | set python_version_join [join [split ${python_version} "."] ""] |
125 | | depends_lib-append port:boost \ |
126 | | port:python${python_version_join} \ |
127 | | port:py${python_version_join}-numpy \ |
128 | | port:py${python_version_join}-sphinx |
| 91 | variant python26 conflicts python27 description "Also build vigranumpy ptyhon26 bindings" { |
| 92 | configure.args-append -DPYTHON_EXECUTABLE=${prefix}/bin/python2.6 \ |
| 93 | -DPYTHON_SPHINX=${prefix}/bin/sphinx-build-2.6 |
| 94 | depends_lib-append port:boost \ |
| 95 | port:python26 \ |
| 96 | port:py26-numpy \ |
| 97 | port:py26-sphinx |
| 98 | require_active_variants boost python26 |
| 99 | } |
| 100 | |
| 101 | variant python27 conflicts python26 description "Also build vigranumpy ptyhon27 bindings" { |
| 102 | configure.args-append -DPYTHON_EXECUTABLE=${prefix}/bin/python2.7 \ |
| 103 | -DPYTHON_SPHINX=${prefix}/bin/sphinx-build-2.7 |
| 104 | depends_lib-append port:boost \ |
| 105 | port:python27 \ |
| 106 | port:py27-numpy \ |
| 107 | port:py27-sphinx |
| 108 | require_active_variants boost python27 |
| 109 | } |
| 110 | |
| 111 | default_variants +python27 |
| 112 | |
| 113 | if { ![variant_isset python26] && ![variant_isset python27] } { |
| 114 | configure.args-append -DWITH_VIGRANUMPY=NO |