Ticket #41241: Portfile-vxl.diff

File Portfile-vxl.diff, 8.0 KB (added by ChristianFrisson (Christian Frisson), 11 years ago)
  • Portfile

    old new  
    22# $Id: Portfile 115019 2013-12-22 09:29:46Z ryandesign@macports.org $
    33
    44PortSystem      1.0
    5 PortGroup       cmake 1.0
     5PortGroup       github 1.0
    66
     7#PortGroup       cmake 1.0
     8# ffmpeg, optional dependency, currenly requires openjpeg15, but vxl uses/packs openjpeg (2.0)
     9# The cmake portgroup includes the prefix as cflags, what prevent internal openjpeg paths to be included before all others, even through include_directories(BEFORE ...)
     10# https://trac.macports.org/ticket/42872
     11# currently append ${prefix}/var/macports/sources/rsync.macports.org/release/tarballs/ports/_resources/port1.0/group/cmake-1.0.tcl it here until the issue is resolved
     12# standard place to install extra CMake modules
     13set cmake_share_module_dir ${prefix}/share/cmake/modules
     14
     15depends_build-append port:cmake
     16
     17#FIXME: ccache works with cmake on linux
     18configure.ccache    no
     19
     20configure.cmd       ${prefix}/bin/cmake
     21
     22configure.pre_args  -DCMAKE_INSTALL_PREFIX=${prefix}
     23
     24configure.args      -DCMAKE_VERBOSE_MAKEFILE=ON \
     25                    -DCMAKE_COLOR_MAKEFILE=ON \
     26                    -DCMAKE_BUILD_TYPE=Release \
     27                    -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \
     28                    -DCMAKE_INSTALL_RPATH=${prefix}/lib \
     29                    -DCMAKE_INSTALL_NAME_DIR=${prefix}/lib \
     30                    -DCMAKE_SYSTEM_PREFIX_PATH="${prefix}\;/usr" \
     31                    -DCMAKE_MODULE_PATH=${cmake_share_module_dir} \
     32                    -DCMAKE_FIND_FRAMEWORK=LAST \
     33                    -Wno-dev
     34
     35# CMake honors set environment variables CFLAGS, CXXFLAGS, and LDFLAGS when it
     36# is first run in a build directory to initialize CMAKE_C_FLAGS,
     37# CMAKE_CXX_FLAGS, CMAKE_[EXE|SHARED|MODULE]_LINKER_FLAGS. However, be aware
     38# that a CMake script can always override these flags when it runs, as they
     39# are frequently set internally in functions of other CMake build variables!
     40#
     41# Attention: If you want to be sure that no compiler flags are passed via
     42# configure.args, you have to manually clear configure.optflags, as it is set
     43# to "-Os" by default and added to all language-specific flags. If you want to
     44# turn off optimization, explicitly set configure.optflags to "-O0".
     45
     46# TODO: Handle configure.objcflags (cf. to CMake upstream ticket #4756
     47#       "CMake needs an Objective-C equivalent of CMAKE_CXX_FLAGS"
     48#       <http://public.kitware.com/Bug/view.php?id=4756>)
     49
     50# TODO: Handle the Fortran-specific configure.* variables:
     51#       configure.fflags, configure.fcflags, configure.f90flags
     52
     53# TODO: Handle the Java-specific configure.classpath variable.
     54
     55pre-configure {
     56    # The environment variable CPPFLAGS is not considered by CMake.
     57    # (CMake upstream ticket #12928 "CMake silently ignores CPPFLAGS"
     58    # <http://www.cmake.org/Bug/view.php?id=12928>).
     59    # Thus, we have to add them manually to the CFLAGS and CXXFLAGS in the
     60    # pre-configure phase.
     61#    if {${configure.cppflags} ne ""} {
     62#        configure.cflags-append ${configure.cppflags}
     63#        configure.cxxflags-append ${configure.cppflags}
     64#    }
     65
     66    # In addition, CMake provides build-type-specific flags for
     67    # Release (-O3 -DNDEBUG), Debug (-g), MinSizeRel (-Os -DNDEBUG), and
     68    # RelWithDebInfo (-O2 -g -DNDEBUG). If the configure.optflags have been
     69    # set (-Os by default), we have to remove the optimization flags from the
     70    # from the concerned Release build type so that configure.optflags
     71    # gets honored (Debug used by the +debug variant does not set
     72    # optimization flags by default).
     73    if {${configure.optflags} ne ""} {
     74        configure.args-append -DCMAKE_C_FLAGS_RELEASE="-DNDEBUG" \
     75                              -DCMAKE_CXX_FLAGS_RELEASE="-DNDEBUG"
     76    }
     77
     78    platform darwin {
     79        if {[variant_exists universal] && [variant_isset universal]} {
     80            if {[info exists universal_archs_supported]} {
     81                global merger_configure_args
     82                foreach arch ${universal_archs_to_use} {
     83                    lappend merger_configure_args(${arch}) -DCMAKE_OSX_ARCHITECTURES=${arch}
     84                }
     85            } else {
     86                configure.universal_args-append \
     87                    -DCMAKE_OSX_ARCHITECTURES="[join ${configure.universal_archs} \;]"
     88            }
     89        } else {
     90            configure.args-append \
     91                -DCMAKE_OSX_ARCHITECTURES="${configure.build_arch}"
     92        }
     93        if {${configure.sdkroot} != ""} {
     94            configure.args-append -DCMAKE_OSX_SYSROOT="${configure.sdkroot}"
     95        } else {
     96            # Witout this, cmake will choose an SDK and deployment target on its own.
     97            configure.args-append -DCMAKE_OSX_SYSROOT=/ -DCMAKE_OSX_DEPLOYMENT_TARGET=""
     98        }
     99    }
     100}
     101
     102configure.universal_args-delete --disable-dependency-tracking
     103
     104variant debug description "Enable debug binaries" {
     105    configure.args-delete   -DCMAKE_BUILD_TYPE=Release
     106    configure.args-append   -DCMAKE_BUILD_TYPE=Debug
     107}
     108
     109# cmake doesn't like --enable-debug, so in case a portfile sets
     110# --enable-debug (regardless of variant) we remove it
     111if {[string first "--enable-debug" ${configure.args}] > -1} {
     112    configure.args-delete     --enable-debug
     113}
     114# end of copy
     115
     116github.setup    vxl vxl 22e5ccd9fa
    7117name            vxl
    8118version         1.17.0
    9 revision        1
     119revision        2
    10120set branch      [join [lrange [split ${version} .] 0 1] .]
    11121categories      devel
    12 maintainers     nomaintainer
     122maintainers     nomaintainer gmail:christian.frisson
    13123description     C++ libraries for computer vision
    14124long_description \
    15125    VXL (the Vision-something-Libraries) is a collection of C++ libraries \
     
    20130homepage        http://vxl.sourceforge.net/
    21131platforms       darwin
    22132
    23 master_sites    sourceforge:project/vxl/vxl/${branch}
    24 use_zip         yes
    25 checksums       md5     95b5ecbbe164d1b540ab52fd0ca26b47 \
    26                 sha1    bfa7e9df3fb8807ef3b14921c31d568e94f3edf4 \
    27                 rmd160  a00d811aa86b2d3a2dad292ff94991c034092434
     133# Checksums for non-git release
     134#master_sites    sourceforge:project/vxl/vxl/${branch}
     135#use_zip         yes
     136#checksums       md5     95b5ecbbe164d1b540ab52fd0ca26b47 \
     137#                sha1    bfa7e9df3fb8807ef3b14921c31d568e94f3edf4 \
     138#                rmd160  a00d811aa86b2d3a2dad292ff94991c034092434
     139
     140# Checksums for git version
     141checksums           md5     7858eaa862f150fe78031e2a37fbe1d9 \
     142                    sha1    b6068e8145244f6fb12ba739e94ed668630e8474 \
     143                    rmd160  5c8ce5bfa9911149cf71906e5d36081d26ad77bd
    28144
    29145# licenses in vxl:
    30146# (see also: http://anonscm.debian.org/viewvc/debian-med/trunk/packages/vxl/trunk/debian/copyright?revision=10688&view=markup)
     
    45161# disable ffmpeg support that fails to build with current ffmpeg versions
    46162# disable broken contrib/prip code
    47163
    48 patchfiles      patch-use-embedded-openjpeg2.diff \
    49                 patch-disable-broken-ffmpeg.diff \
    50                 patch-disable-contrib-prip.diff
     164# Patches for non-git release
     165#patchfiles      patch-use-embedded-openjpeg2.diff \
     166#                patch-disable-broken-ffmpeg.diff \
     167#                patch-disable-contrib-prip.diff
     168
     169# Patches for git version
     170patchfiles      patch-fix-include-openjpeg.diff \
     171                patch-fix-ffmpeg-support.diff \
     172                patch-fix-find-X11.diff
    51173               
    52174depends_lib-append \
    53175                port:jpeg \
     
    58180                port:bzip2 \
    59181                port:libdc1394
    60182
    61 if {[string match *clang* ${configure.compiler}]} {
    62     configure.cxxflags-append -Werror=gnu -Wno-error=vla
    63 }
     183# This fails with the git version
     184#if {[string match *clang* ${configure.compiler}]} {
     185#    configure.cxxflags-append -Werror=gnu -Wno-error=vla
     186#}
    64187
    65188configure.args-append \
    66189    -DBUILD_SHARED_LIBS=YES \
    67190    -DCMAKE_INSTALL_NAME_DIR=${prefix}/lib/${name} \
    68     -DBUILD_BRL=NO
     191    -DBUILD_BRL=NO \
     192    -DVXL_FORCE_V3P_OPENJPEG2=ON
    69193
    70194# shuffle directories around to turn ${prefix}/lib into ${prefix}/lib/${name}
    71195post-destroot {