Ticket #38062: Portfile.diff

File Portfile.diff, 6.3 KB (added by BSeppke (Benjamin Seppke), 11 years ago)

without black or whitelists, just does what it should do...

  • Portfile

    old new  
    33
    44PortSystem          1.0
    55
     6PortGroup           active_variants 1.1
     7PortGroup                       cmake 1.0
     8
    69name                vigra
    7 version             1.8.0
    8 revision            4
     10version             1.9.0
    911categories          graphics
    1012platforms           darwin
    1113maintainers         gmail.com:benjamin.seppke
     
    2426#universal_variant   no
    2527worksrcdir          ${name}-${version}
    2628
    27 checksums           rmd160  99d781da6e0ca94ce3404e1bcb3adeb9e43a2017 \
    28                     sha256  fc3a87d220ce23e79d163c58dd280fd534b81a870d2b140f1d072bbc82c78214
     29checksums           rmd160  84e3f1bc985df1ea928e9aa5adc6e0c153cbdd40 \
     30                    sha256  8fbdccb553a4925323098ab27b710fbc87d48f37bf81d404994936a31a31cf01
    2931
    30 depends_build       port:cmake
     32depends_build       port:cmake 
    3133depends_lib         port:jpeg \
    3234                    port:tiff \
    3335                    port:libpng \
    3436                    port:zlib \
    3537                    port:openexr \
    36                     port:fftw-3 \
    37                     port:hdf5-18
    38 
    39 # correct the INSTALL_NAME_DIR for Python .so modules
    40 patchfiles          patch-config-VIGRA_ADD_NUMPY_MODULE.cmake.diff
    41 
    42 configure.cmd       cmake
     38                    port:fftw-3-single \
     39                    port:hdf5-18
    4340
    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.
     43patchfiles          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
     48configure.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:
     56if {    [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}
    5861
    5962destroot.env-append DESTDIR=${destroot}
    6063
    6164post-destroot {
    62     # fix location of documentation to include version.
    63     # remove documentation if no variant is set.
    64     # for now since NumPy variant does not work, just
    65     # move what can be moved and delete the rest.
    6665    if {[variant_isset docs]} {
    67         # move documentation to a versioned directory
     66        # move documentation to a unversioned directory
    6867        xinstall -m 755 -d ${destroot}${prefix}/share/doc
    6968        move ${destroot}${prefix}/doc/${name} \
    70             ${destroot}${prefix}/share/doc/${name}-${version}
     69             ${destroot}${prefix}/share/doc/${name}
    7170    }
    7271    # delete whatever is left in the doc directory
    7372    delete ${destroot}${prefix}/doc
     
    7776if {[variant_isset docs]} {
    7877    depends_lib-append port:doxygen
    7978} else {
    80     configure.args-append \
    81         -DBUILD_doc=OFF \
    82         -DDOXYGEN_DOT_EXECUTABLE= \
    83         -DDOXYGEN_DOT_PATH= \
    84         -DDOXYGEN_EXECUTABLE=
     79    configure.args-append       -DDOXYGEN_DOT_EXECUTABLE= \
     80                                                -DDOXYGEN_EXECUTABLE=
    8581}
    8682
     83
    8784variant valgrind description "Include support for VALGRIND" {}
    8885if {[variant_isset valgrind]} {
    8986    depends_lib-append port:valgrind
     
    9188    configure.args-append -DWITH_VALGRIND=NO
    9289}
    9390
    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
     91variant 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
     101variant 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
     111default_variants +python27
     112
     113if {   ![variant_isset python26] && ![variant_isset python27] } {
     114        configure.args-append -DWITH_VIGRANUMPY=NO     
    129115}
    130116
    131117livecheck.type      regex