Ticket #33649: Portfile.diff

File Portfile.diff, 3.9 KB (added by raphael-st (Raphael Straub), 12 years ago)
  • Portfile

    old new  
    55PortGroup                       cmake 1.0
    66
    77name                            cgal
    8 version                         3.9
    9 license                         LGPL-2.1 QPL Commercial
     8version                         4.0
     9license                         LGPL-3+ GPL-3+
    1010categories                      gis science
    1111maintainers                     vince
    1212description                     Computational Geometry Algorithm Library
     
    2424homepage                        http://www.cgal.org/
    2525
    2626fetch.ignore_sslcert    yes
    27 master_sites            https://gforge.inria.fr/frs/download.php/29125/
     27master_sites            https://gforge.inria.fr/frs/download.php/30387/
    2828
    2929distname                        CGAL-${version}
    30 checksums           rmd160  0a5a929ecedeeac3833ec90f802b7f5ac069ad47 \
    31                     sha256  241194ad9487d62d1287f863eab3adbbfd0836e2bebcd50c9fc21d473f947ba4
     30checksums           rmd160  57b3112a511a5c811e1382dfe7cac3b8600c9b56 \
     31                    sha256  dde1431f56537890666dc6a396bcd591f04397998dfbe20c2897c4ed74da5099
    3232
    3333depends_lib-append      port:boost \
    3434                                        port:mpfr \
    3535                                        port:zlib \
    3636                                        port:gmp
    3737
    38 patchfiles              patch-src-config.h.diff
    39 
    40 configure.args-append   -DCGAL_INSTALL_CMAKE_DIR="${prefix}/lib/cmake"
     38configure.args-append   -DCGAL_INSTALL_CMAKE_DIR="lib/cmake" \
     39                        -DWITH_CGAL_Qt3:BOOL=OFF \
     40                        -DWITH_CGAL_Qt4:BOOL=OFF
    4141
    4242# gcc 4.0 is too old to compile CGAL properly; see <http://www.cgal.org/FAQ.html#mac_optimization_bug>
    43 # And the demos don't compile with llvm-gcc-4.2 or clang
    44 if {${configure.compiler} == "gcc-4.0" || [variant_isset demos]} {
     43if {${configure.compiler} == "gcc-4.0"} {
    4544    configure.compiler gcc-4.2
    4645    if {![file executable ${configure.cc}]} {
    4746        depends_build-append port:apple-gcc42
    4847        configure.compiler apple-gcc-4.2
    49         # base (as of 2.0.3) doesn't set cxx for apple-gcc-4.2
    50         configure.cxx ${prefix}/bin/g++-apple-4.2
    51     }
    52 }
    53 
    54 pre-build {
    55     # When building 3.9 with 3.8 active:
    56     # error: 'CGAL_CORE_finite' was not declared in this scope
    57     if {[file exists ${prefix}/include/CGAL/version.h]} {
    58         set installed_version [exec awk {/^#define +CGAL_VERSION +/ {print $3}} ${prefix}/include/CGAL/version.h]
    59         if {${version} != ${installed_version}} {
    60             ui_error "${name} ${version} cannot be built while ${name} ${installed_version} is installed and active."
    61             ui_error "Please deactivate ${name} ${installed_version} first."
    62             return -code error "incompatible ${name} version active"
    63         }
    6448    }
    6549}
    6650
    67 variant demos description {Create demos} {
    68         PortGroup                               qt4 1.0
    69 
     51variant demos description {Create demos} requires qt4 {
    7052        depends_lib-append              port:libQGLViewer \
    7153                                                        port:ipe
    7254
    73         patchfiles-append       patch-CMakeLists.txt.diff
     55        patchfiles                              patch-CMakeLists.txt.diff
     56
     57        # The demos don't compile with clang.
     58        if {${configure.compiler} == "clang"} {
     59            configure.compiler llvm-gcc-4.2
     60        }
    7461
    7562        configure.args-append   -DWITH_examples=TRUE
    7663        configure.args-append   -DWITH_demos=TRUE
     
    8774        post-destroot {                 xinstall -d ${destroot}${prefix}/share/${name}
    8875                                                        copy ${worksrcpath}/demo ${destroot}${prefix}/share/${name}
    8976                                                        copy ${worksrcpath}/examples ${destroot}${prefix}/share/${name}
     77            eval move [glob ${destroot}${prefix}/share/${name}/demo/*/*.dylib] ${destroot}${prefix}/lib/
    9078        }
    9179}
     80
     81variant debug description {Build with debug symbols} {
     82    configure.args-delete   -DCMAKE_BUILD_TYPE=Release
     83    configure.args-append   -DCMAKE_BUILD_TYPE=Debug
     84
     85    post-destroot {
     86        eval exec dsymutil [glob ${destroot}${prefix}/lib/*.dylib]
     87    }
     88}
     89
     90variant qt4 description {Build with Qt4 bindings} {
     91    PortGroup               qt4 1.0
     92
     93    configure.args-delete   -DWITH_CGAL_Qt3:BOOL=OFF \
     94                            -DWITH_CGAL_Qt4:BOOL=OFF
     95}
     96
     97livecheck.type      regex
     98livecheck.url       ${homepage}
     99livecheck.regex     CGAL-(\[0-9.\]+)\ is\ released