Changeset 51322


Ignore:
Timestamp:
May 23, 2009, 12:40:21 AM (11 years ago)
Author:
dweber@…
Message:

Revision 1; adding tweaks for the examples and testing variants; the wrapping seems to work now - at least for python

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dports/graphics/InsightToolkit/Portfile

    r50785 r51322  
    66name            InsightToolkit
    77version         3.12.0
    8 revision        0
    9 set branch          [join [lrange [split ${version} .] 0 1] .]
     8revision        1
     9set branch      [join [lrange [split ${version} .] 0 1] .]
    1010
    1111categories      graphics math science devel
     
    1616
    1717long_description \
    18 ITK  is an open-source software toolkit for performing registration and segmentation. Segmentation is the process of identifying and classifying data found in a digitally sampled representation. Typically the sampled representation is an image acquired from such medical instrumentation as CT or MRI scanners. Registration is the task of aligning or developing correspondences between data. For example, in the medical environment, a CT scan may be aligned with an MRI scan in order to combine the information contained in both.
     18ITK is an open-source software toolkit for performing registration and segmentation. Segmentation is the process of identifying and classifying data found in a digitally sampled representation. Typically the sampled representation is an image acquired from such medical instrumentation as CT or MRI scanners. Registration is the task of aligning or developing correspondences between data. For example, in the medical environment, a CT scan may be aligned with a MRI scan in order to combine the information contained in both.
    1919
    2020homepage        http://www.itk.org/
     
    3434                    rmd160 5758c7ee205a53a205a8a72a721aafeff7c8b194
    3535
     36extract.only    InsightToolkit-${version}.tar.gz \
     37                CableSwig-ITK-${version}.tar.gz
     38
    3639platforms       darwin
    3740
    38 depends_build   port:cmake
     41depends_build   port:cmake \
     42                port:gmake
    3943
    4044depends_lib     port:xorg-libs \
     
    4549build.dir       ${workpath}/${distname}-build
    4650
    47 # Using this dummy stage to inspect MacPorts variables (using 'port -d fetch InsightToolkit')
    48 #fetch { system "echo ${distfiles} && echo ${checksums}" }
     51
     52# Global variables, used in variants, where a destroot prefix is appended, when necessary.
     53set itkLibPath      ${prefix}/lib/${distname}
     54set itkIncPath      ${prefix}/include/${distname}
     55set itkSharePath    ${prefix}/share/${distname}
     56set itkDocFile      DoxygenInsightToolkit-${version}.tar.gz
     57set itkDocPath      ${itkSharePath}/doc
     58set itkDataPath     ${itkSharePath}/data
     59set itkExamplePath  ${itkSharePath}/examples
     60set itkTestingPath  ${itkSharePath}/testing
     61set itkBuildBin     ${build.dir}/bin
     62set itkExampleBin   ${itkExamplePath}/bin
     63set itkTestingBin   ${itkTestingPath}/bin
     64set itkExampleSrc   ${worksrcpath}/Examples
     65set itkTestingSrc   ${worksrcpath}/Testing
     66
     67# Using this dummy stage to inspect MacPorts variables
     68# (using 'port -d fetch InsightToolkit')
     69#fetch { system "echo ${itkLibPath}" }
    4970
    5071post-extract {
    51     move ${workpath}/InsightToolkit-${version} ${workpath}/${distname}
    52     move ${workpath}/CableSwig-ITK-${version}  ${workpath}/${distname}/Utilities/CableSwig
     72    move ${workpath}/InsightToolkit-${version} ${worksrcpath}
     73    move ${workpath}/CableSwig-ITK-${version}  ${worksrcpath}/Utilities/CableSwig
    5374}
    5475
    5576configure {
    56     xinstall -d -o root -g admin -m 0755 ${build.dir}
     77    xinstall -d -m 0755 ${build.dir}
    5778    system "cd ${build.dir} && cmake ${configure.args} ${worksrcpath}"
    5879}
     
    79100    -DCMAKE_INSTALL_PREFIX:PATH=${prefix} \
    80101    -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
    81     -DITK_COMPUTER_MEMORY_SIZE:STRING=${gigabits}
    82 
     102    -DITK_COMPUTER_MEMORY_SIZE:STRING=${gigabits} \
     103    -DUUID_INCLUDE_DIR:PATH=${prefix}/include/uuid \
     104    -DUUID_LIBRARY:FILEPATH=${prefix}/lib/libuuid.dylib
     105
     106#ITK_EXPLICIT_INSTANTIATION
    83107
    84108post-destroot {
    85     move ${destroot}${prefix}/lib/InsightToolkit ${destroot}${prefix}/lib/${distname}
    86     move ${destroot}${prefix}/include/InsightToolkit ${destroot}${prefix}/include/${distname}
     109    move ${destroot}${prefix}/lib/InsightToolkit     ${destroot}/${itkLibPath}
     110    move ${destroot}${prefix}/include/InsightToolkit ${destroot}/${itkIncPath}
    87111}
    88112
     
    94118default_variants \
    95119    +doc \
    96     +shared
    97 
    98 # Global variables
    99 #
    100 # See doc variant for details
    101 set itkDocFile  DoxygenInsightToolkit-${version}.tar.gz
    102 set itkDocPath  ${prefix}/share/${distname}/doc
    103 # See data variants for details
    104 set itkDataPath ${prefix}/share/${distname}/data
    105 
    106 
    107 variant doc description {provide doxygen documentation [default: ${prefix}/share/${distname}/doc]} {
    108     global itkDocFile
     120    +examples \
     121    +shared \
     122    +testing \
     123    +wrap +py26
     124
     125variant doc description "provide doxygen documentation in ${itkDocPath}" {
    109126    distfiles-append    ${itkDocFile}
    110127    checksums-append    ${itkDocFile} \
     
    113130                        rmd160 a20167892a6e91e6f530313c3c057e4d08999d62
    114131    post-destroot {
    115         global itkDocFile
    116         set itkDocPathMain ${prefix}/share/${distname}/doc
    117132        set itkDocPathLink ${prefix}/share/doc/${distname}
    118         xinstall -d -o root -g admin -m 0755 ${destroot}/${itkDocPathMain}
    119         xinstall -d -o root -g admin -m 0755 ${destroot}/${itkDocPathLink}
     133        xinstall -d -o root -g admin -m 755 ${destroot}/${itkDocPath}
     134        xinstall -d -o root -g admin -m 755 ${destroot}/${itkDocPathLink}
    120135        # Add the doxygen documentation
    121         system "tar --strip-components 1 -C ${destroot}/${itkDocPathMain} -zxf ${distpath}/${itkDocFile}"
     136        system "tar --strip-components 1 -C ${destroot}/${itkDocPath} -zxf ${distpath}/${itkDocFile}"
    122137        # Add basic documentation
    123         file copy ${worksrcpath}/Copyright     ${destroot}/${itkDocPathMain}/
    124         file copy ${worksrcpath}/Copyright.txt ${destroot}/${itkDocPathMain}/
    125         file copy ${worksrcpath}/README.html   ${destroot}/${itkDocPathMain}/
     138        file copy ${worksrcpath}/Copyright     ${destroot}/${itkDocPath}/
     139        file copy ${worksrcpath}/Copyright.txt ${destroot}/${itkDocPath}/
     140        file copy ${worksrcpath}/README.html   ${destroot}/${itkDocPath}/
    126141        # Create a symlink to the $prefix path (not the destroot path); use the
    127142        # system to do this because the $prefix path doesn't exist yet and the
    128143        # tcl ln command fails, whereas this system command will allow it.
    129         system "ln -Fhs ${itkDocPathMain} ${destroot}/${itkDocPathLink}"
     144        system "ln -Fns ${itkDocPath} ${destroot}/${itkDocPathLink}"
    130145    }
    131146}
     
    138153##// Directory with data taken from http://public.kitware.com/pub/itk/Data/BrainWeb/
    139154##ITK_BRAINWEB_DATA_ROOT:PATH=ITK_BRAINWEB_DATA_ROOT-NOTFOUND
    140 variant brainweb description {provide ITK BrainWeb data: ${prefix}/share/${distname}/data]} {
     155variant brainweb description "provide ITK BrainWeb data in ${itkDataPath}" {
    141156    master_sites-append \
    142157        http://public.kitware.com/pub/itk/Data/BrainWeb:brainweb
    143     eval extract.only ${distfiles}
    144158    distfiles-append \
    145159        BrainPart1.tgz:brainweb \
     
    189203            sha1 2e14b66beef00acc8cd17942d9bf0c155841a934 \
    190204            rmd160 42d403505116e8b9885d00964376cee909711bd0
    191     global itkDataPath
    192205    configure.args-append \
    193206        -DITK_BRAINWEB_DATA_ROOT:PATH=${itkDataPath}
    194207    post-destroot {
    195         global itkDataPath
    196         xinstall -d -o root -g admin -m 0755 ${destroot}/${itkDataPath}
     208        xinstall -d -o root -g admin -m 755 ${destroot}/${itkDataPath}
    197209        foreach tgz [exec find ${distpath} -name "BrainPart*.tgz"] {
    198210            system "tar -C ${destroot}/${itkDataPath} -zxf ${tgz}"
     
    216228# More datasets available from:
    217229#http://pubimage.hcuge.ch:8080/
    218 
    219 
    220 variant examples description {provide ITK examples [default: ${prefix}/share/${distname}/examples]} {
    221     configure.args-delete \
    222         -DBUILD_EXAMPLES:BOOL=OFF
    223     configure.args-append \
    224         -DBUILD_EXAMPLES:BOOL=ON
    225     #post-destroot {
    226     #    set itkExamplePath ${prefix}/share/${distname}/examples
    227     #    xinstall -d -o root -g admin -m 0755 ${destroot}/${itkExamplePath}/bin
    228     #    foreach f [glob ${worksrcpath}/Examples/*] {
    229     #        file copy ${f} ${destroot}/${itkExamplePath}/
    230     #    }
    231     #    # Installations for the example binaries are in ${build.dir}/bin/.
    232     #    set buildBinPath ${build.dir}/bin
    233     #    foreach f [glob ${buildBinPath}/*] {
    234     #        if {![string match {*.dylib} ${f}]} {
    235     #          file copy ${f} ${destroot}/${itkExamplePath}/bin/
    236     #        }
    237     #    }
    238     #    # All the rpath settings for these binaries point to the build.dir, so
    239     #    # they are reset using install_name_tool.
    240     #    set itkLibPath ${prefix}/lib/${distname}
    241     #    foreach f [glob ${destroot}/${itkExamplePath}/bin/*] {
    242     #        if [string equal [file extension ${f}] ".app"] {
    243     #            set exeName [file rootname [lindex [file split ${f}] end]]
    244     #            set f [format "%s/Contents/MacOS/%s" ${f} ${exeName}]
    245     #        }
    246     #        if [expr [file isfile ${f}] && [file executable ${f}]] {
    247     #            foreach dep [exec otool -L ${f}] {
    248     #                if [string match "*/libitk*.dylib" ${dep}] {
    249     #                    set newdep [strsed ${dep} #${buildBinPath}#${itkLibPath}#]
    250     #                    system "install_name_tool -change ${dep} ${newdep} ${f}"
    251     #                }
    252     #            }
    253     #        }
    254     #    }
    255     #}
    256 }
    257230
    258231
     
    278251# phase, all the installation candidates (which excludes the examples and
    279252# testing binaries) have their rpath settings reset to the INSTALL_RPATH (which
    280 # should point to $prefix..., not the $destroot location).  VTK_USE_RPATH
    281 # is required to ensure that rpath is set for all the installed executables and
    282 # dylibs.
    283 
    284 variant shared description {build shared libraries [default]} {
     253# should point to $prefix..., not the $destroot location).
     254
     255variant shared description "build shared libraries (default)" {
    285256    configure.args-delete \
    286257        -DBUILD_SHARED_LIBS:BOOL=OFF
     
    289260        -DCMAKE_SKIP_RPATH:BOOL=OFF \
    290261        -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF \
    291         -DCMAKE_INSTALL_RPATH:STRING=${prefix}/lib/${distname}
    292 }
    293 
    294 
    295 variant testing description {provide ITK testing [default: ${prefix}/share/${distname}/testing]} {
     262        -DCMAKE_INSTALL_RPATH:STRING=${itkLibPath}
     263}
     264
     265
     266proc resetLibLinks { inputPath } {
     267    # The example and testing binaries are built, but they are not "installed".
     268    # All their rpath settings point to the build.dir, so they must be
     269    # reset using install_name_tool for the destroot install.
     270    global itkBuildBin itkLibPath
     271    foreach f [glob ${inputPath}/*] {
     272        if [string equal [file extension ${f}] ".app"] {
     273            set exeName [file rootname [lindex [file split ${f}] end]]
     274            set f [format "%s/Contents/MacOS/%s" ${f} ${exeName}]
     275        }
     276        if [expr [file isfile ${f}] && [file executable ${f}]] {
     277            foreach dep [exec otool -L ${f}] {
     278                if [string match -nocase "*/libitk*.dylib" ${dep}] {
     279                    set newdep [strsed ${dep} #${itkBuildBin}#${itkLibPath}#]
     280                    system "install_name_tool -change ${dep} ${newdep} ${f}"
     281                }
     282            }
     283        }
     284    }
     285}
     286
     287
     288variant examples description "provide ITK examples in ${itkExamplePath}" {
     289    configure.args-delete \
     290        -DBUILD_EXAMPLES:BOOL=OFF
     291    configure.args-append \
     292        -DBUILD_EXAMPLES:BOOL=ON
     293    post-destroot {
     294        xinstall -d -o root -g admin -m 755 ${destroot}/${itkExampleBin}
     295        foreach f [glob ${itkExampleSrc}/*] {
     296            file copy ${f} ${destroot}/${itkExamplePath}/
     297        }
     298        # Find all the example executables by parsing all the
     299        # CMakeLists.txt files within the src Examples path
     300        set exe {}
     301        foreach f [exec find ${itkExampleSrc} -name "CMakeLists.txt"] {
     302            catch {exec grep -e "ADD_EXECUTABLE" ${f}} results
     303            if [expr ![string match "*child process*" ${results}]] {
     304                # Remove the string "ADD_EXECUTABLE(", with or without whitespace
     305                regsub -all "\[ \t\]*ADD_EXECUTABLE\[(\]\[ \t\]*" ${results} "" results
     306                # Remove the string ".cxx)", with or without whitespace
     307                regsub -all ".cxx\[ \t\]*\[)\]" ${results} "" results
     308                set exe [concat ${exe} ${results}]
     309            }
     310        }
     311        set exe [lsort -unique ${exe}]
     312        # Installations for the example binaries are in ${itkBuildBin}.
     313        # Copy them into the destroot example bin.
     314        foreach f $exe {
     315            set f ${itkBuildBin}/${f}
     316            if [expr [file isfile ${f}] && [file executable ${f}]] {
     317                file copy ${f} ${destroot}/${itkExampleBin}
     318            }
     319        }
     320        resetLibLinks ${destroot}/${itkExampleBin}
     321    }
     322}
     323
     324
     325variant testing description "provide ITK testing in ${itkTestingPath}" {
    296326    configure.args-delete \
    297327        -DBUILD_TESTING:BOOL=OFF
    298328    configure.args-append \
    299329        -DBUILD_TESTING:BOOL=ON
    300     #post-destroot {
    301     #    set itkExamplePath ${prefix}/share/${distname}/examples
    302     #    xinstall -d -o root -g admin -m 0755 ${destroot}/${itkExamplePath}/bin
    303     #    foreach f [glob ${worksrcpath}/Examples/*] {
    304     #        file copy ${f} ${destroot}/${itkExamplePath}/
    305     #    }
    306     #    # Installations for the example binaries are in ${build.dir}/bin/.
    307     #    set buildBinPath ${build.dir}/bin
    308     #    foreach f [glob ${buildBinPath}/*] {
    309     #        if {![string match {*.dylib} ${f}]} {
    310     #          file copy ${f} ${destroot}/${itkExamplePath}/bin/
    311     #        }
    312     #    }
    313     #    # All the rpath settings for these binaries point to the build.dir, so
    314     #    # they are reset using install_name_tool.
    315     #    set itkLibPath ${prefix}/lib/${distname}
    316     #    foreach f [glob ${destroot}/${itkExamplePath}/bin/*] {
    317     #        if [string equal [file extension ${f}] ".app"] {
    318     #            set exeName [file rootname [lindex [file split ${f}] end]]
    319     #            set f [format "%s/Contents/MacOS/%s" ${f} ${exeName}]
    320     #        }
    321     #        if [expr [file isfile ${f}] && [file executable ${f}]] {
    322     #            foreach dep [exec otool -L ${f}] {
    323     #                if [string match "*/libitk*.dylib" ${dep}] {
    324     #                    set newdep [strsed ${dep} #${buildBinPath}#${itkLibPath}#]
    325     #                    system "install_name_tool -change ${dep} ${newdep} ${f}"
    326     #                }
    327     #            }
    328     #        }
    329     #    }
    330     #}
    331 }
     330    post-destroot {
     331        xinstall -d -o root -g admin -m 755 ${destroot}/${itkTestingBin}
     332        foreach f [glob ${itkTestingSrc}/*] {
     333            file copy ${f} ${destroot}/${itkTestingPath}/
     334        }
     335        # Find all the testing executables by parsing all the
     336        # CMakeLists.txt files within the itkTestingSrc path
     337        set exe {}
     338        foreach f [exec find ${itkTestingSrc} -name "CMakeLists.txt"] {
     339            catch {exec grep -e "ADD_EXECUTABLE" ${f}} results
     340            if [expr ![string match "*child process*" ${results}]] {
     341                # Remove the string "ADD_EXECUTABLE(", with or without whitespace
     342                regsub -all "\[ \t\]*ADD_EXECUTABLE\[(\]\[ \t\]*" ${results} "" results
     343                # Remove the string ".cxx)", with or without whitespace
     344                regsub -all ".cxx\[ \t\]*\[)\]" ${results} "" results
     345                set exe [concat ${exe} ${results}]
     346            }
     347        }
     348        set exe [lsort -unique ${exe}]
     349        # Installations for the testing binaries are in ${itkBuildBin}.
     350        # Copy them into the destroot testing bin.
     351        foreach f $exe {
     352            set f ${itkBuildBin}/${f}
     353            if [expr [file isfile ${f}] && [file executable ${f}]] {
     354                file copy ${f} ${destroot}/${itkTestingBin}
     355            }
     356        }
     357        resetLibLinks ${destroot}/${itkTestingBin}
     358    }
     359}
     360
    332361
    333362# --- external languages support
    334 #
    335 #variant wrap requires shared {
    336 #    depends_lib-append \
    337 #        port:guile
     363
     364
     365# Some of the wrapper libs are built, but they are not "installed".
     366# All their rpath settings point to the build.dir, so they must be
     367# reset using install_name_tool after the destroot phase.
     368proc resetWrapLibs { filepattern } {
     369    global itkBuildBin itkLibPath
     370    set itkSwigLibPath ${itkLibPath}/WrapITK/lib
     371    foreach f [glob ${filepattern}] {
     372        foreach dep [exec otool -L ${f}] {
     373            if [string match -nocase "*libSwigRuntime*" ${dep}] {
     374                set newdep [strsed ${dep} #${itkBuildBin}#${itkSwigLibPath}#]
     375                system "install_name_tool -change ${dep} ${newdep} ${f}"
     376            } elseif [string match -nocase "${itkBuildBin}*" ${dep}] {
     377                set newdep [strsed ${dep} #${itkBuildBin}#${itkLibPath}#]
     378                system "install_name_tool -change ${dep} ${newdep} ${f}"
     379            }
     380        }
     381    }
     382}
     383
     384
     385variant wrap requires shared description "USE_WRAP_ITK for external language support" {
     386    depends_lib-append \
     387        port:guile \
     388        port:tcl
     389    configure.args-append \
     390        -DUSE_WRAP_ITK:BOOL=ON \
     391        -DITK_USE_REVIEW:BOOL=ON \
     392        -DWRAP_ITK_INSTALL_PREFIX:PATH=${itkLibPath}/WrapITK \
     393        -DCMAKE_CXX_FLAGS:STRING=-fpermissive \
     394        -DGUILE_EXECUTABLE:FILEPATH=${prefix}/bin/guile \
     395        -DGUILE_LIBRARY:FILEPATH=${prefix}/lib/libguile.dylib \
     396        -DGUILE_INCLUDE_PATH:PATH=${prefix}/include/guile \
     397        -DTCL_TCLSH:FILEPATH=${prefix}/bin/tclsh \
     398        -DTCL_INCLUDE_PATH:PATH=${prefix}/include \
     399        -DTCL_LIBRARY:FILEPATH=${prefix}/lib/libtcl.dylib \
     400        -DTK_INCLUDE_PATH:PATH=${prefix}/include \
     401        -DTK_LIBRARY:FILEPATH=${prefix}/lib/libtk.dylib
     402        #-DSWIG_BUILD_EXAMPLES:BOOL=ON
     403    post-destroot {
     404        # Fix the executable permissions on tclwish and move it to a
     405        # distribution specific file name
     406        file attributes ${destroot}/${prefix}/bin/itkwish -permissions 00755
     407        move ${destroot}/${prefix}/bin/itkwish ${destroot}/${prefix}/bin/itkwish-${branch}
     408        ln -s itkwish-${branch} ${destroot}/${prefix}/bin/itkwish
     409        # Reset dynamic library dependency paths (see proc above)
     410        #resetWrapLibs ${destroot}/${itkLibPath}/WrapITK/lib/*.dylib
     411        #resetWrapLibs ${destroot}/${itkLibPath}/WrapITK/lib/*.jnilib
     412        #resetWrapLibs ${destroot}/${itkLibPath}/WrapITK/lib/*.so
     413    }
     414}
     415
     416# The following were possiblilities identified by ccmake
     417
     418#-DPERL_EXECUTABLE                 /opt/local/bin/perl
     419#-DPERL_INCLUDE_PATH               PERL_INCLUDE_PATH-NOTFOUND
     420#-DPERL_LIBRARY                    PERL_LIBRARY-NOTFOUND
     421
     422#-DPHP4_EXECUTABLE                 /opt/local/bin/php
     423#-DPHP4_FOUND_INCLUDE_PATH         PHP4_FOUND_INCLUDE_PATH-NOTFOUND
     424
     425#-DPIKE_EXECUTABLE                 PIKE_EXECUTABLE-NOTFOUND
     426#-DPIKE_INCLUDE_PATH               PIKE_INCLUDE_PATH-NOTFOUND
     427
     428#-DRUBY_EXECUTABLE                 RUBY_EXECUTABLE-NOTFOUND
     429#-DRUBY_INCLUDE_PATH               /System/Library/Frameworks/Ruby.framework/Headers
     430#-DRUBY_LIBRARY                    RUBY_LIBRARY-NOTFOUND
     431
     432# Note for Ruby include path:
     433# exec ruby -r rbconfig -e {puts Config::CONFIG["archdir"]}
     434
     435# Some default WrapITK settings:
     436
     437 #WRAP_BinaryMorphology            ON
     438 #WRAP_Calculators                 ON
     439 #WRAP_Compose                     ON
     440 #WRAP_DeformableTransforms        ON
     441 #WRAP_Denoising                   ON
     442 #WRAP_DistanceMap                 ON
     443 #WRAP_EdgesAndContours            ON
     444 #WRAP_FFT                         ON
     445 #WRAP_FFTW                        OFF
     446 #WRAP_Filtering                   ON
     447 #WRAP_IO                          ON
     448 #WRAP_ITK_DIMS                    2;3
     449 #WRAP_ITK_INSTALL_PREFIX          /lib/InsightToolkit/WrapITK
     450 #WRAP_ITK_JAVA                    ON
     451 #WRAP_ITK_PYTHON                  ON
     452 #WRAP_ITK_TCL                     ON
     453 #WRAP_IntensityFilters            ON
     454 #WRAP_Interpolators               ON
     455 #WRAP_Iterators                   OFF
     456 #WRAP_LevelSet                    ON
     457 #WRAP_Morphology                  ON
     458 #WRAP_PixelMath                   ON
     459 #WRAP_Registration                ON
     460 #WRAP_Resize                      ON
     461 #WRAP_Review                      ON
     462 #WRAP_SegmentationAndThreshold    ON
     463 #WRAP_SegmentationValidation      ON
     464 #WRAP_SimpleFilters               ON
     465 #WRAP_UnaryPixelMath              ON
     466 #WRAP_complex_double              OFF
     467 #WRAP_complex_float               ON
     468 #WRAP_covariant_vector_double     OFF
     469 #WRAP_covariant_vector_float      ON
     470 #WRAP_double                      OFF
     471 #WRAP_float                       ON
     472 #WRAP_rgb_unsigned_char           OFF
     473 #WRAP_rgb_unsigned_short          ON
     474 #WRAP_rgba_unsigned_char          OFF
     475 #WRAP_rgba_unsigned_short         ON
     476 #WRAP_signed_char                 OFF
     477 #WRAP_signed_long                 OFF
     478 #WRAP_signed_short                OFF
     479 #WRAP_unsigned_char               OFF
     480 #WRAP_unsigned_long               OFF
     481 #WRAP_unsigned_short              ON
     482 #WRAP_vector_double               OFF
     483 #WRAP_vector_float                ON
     484
     485
     486
     487
     488
     489
     490# -----------------------------------------------------------------------------
     491# The following wrapper variants modify the wrap variant, to specify
     492# specific versions of external languages, such as python25 or python26
     493
     494# The USE_WRAP_ITK will configure a default tcl and java wrapping.  Only enable
     495# and modify the variants below to provide version specific language
     496# wrappers.  Each of these variants should require the wrap variant.
     497
     498
     499proc setPython { {major 2} {minor 6} } {
     500    global pyVer python pyPort pyBin pyLib pyInc pyFrame pySite
     501    set pyVer       ${major}.${minor}
     502    set python      python${pyVer}
     503    set pyPort      python${major}${minor}
     504    set pyFrame     Library/Frameworks/Python.framework/Versions/${pyVer}
     505    set pyLib       ${pyFrame}/Python
     506    set pyBin       bin/${python}
     507    set pyInc       include/${python}
     508    set pySite      lib/${python}/site-packages
     509    if [string match "2.6" ${pyVer}] {
     510        # python2.6 is a true framework installation; whereas installs for 2.4
     511        # and 2.5 contain symlinks in the framework path to the prefix path; and
     512        # those symlinks can break the file_map stage of port activation.
     513        set pyBin   ${pyFrame}/bin/${python}
     514        set pyInc   ${pyFrame}/include/${python}
     515        set pySite  ${pyFrame}/lib/${python}/site-packages
     516    }
     517}
     518setPython
     519
     520
     521variant py24 requires wrap conflicts py25 py26 description "python 2.4 wrapper" {
     522    setPython 2 4
     523    depends_lib-append \
     524        port:${pyPort}
     525    configure.args-append \
     526        -DPYTHON_EXECUTABLE:FILEPATH=${prefix}/${pyBin} \
     527        -DPYTHON_INCLUDE_PATH:FILEPATH=${prefix}/${pyInc} \
     528        -DPYTHON_LIBRARY:FILEPATH=${prefix}/${pyLib} \
     529        -DPYTHON_DEBUG_LIBRARY:FILEPATH=${prefix}/${pyLib} \
     530        -DPY_SITE_PACKAGES_PATH:PATH=${prefix}/${pySite}
     531    post-destroot {
     532        #if [expr [string match "2.4" ${pyVer}] | [string match "2.5" ${pyVer}]] {
     533        #    # Change the location of WrapITK.pth; This is only for
     534        #    # python24 or python25 because they "pretend" to be a framework
     535        #    # installation with a lot of symlinks that are not handled by the
     536        #    # port file_map process.
     537        #    xinstall -d -m 0755 ${destroot}/${prefix}/${pySite}
     538        #    move ${destroot}/${prefix}/${pyFrame}/lib/${python}/site-packages/WrapITK.pth ${destroot}/${prefix}/${pySite}/
     539        #}
     540        # Change the content of WrapITK.pth (for any python version)
     541        reinplace "s|${name}|${distname}|g" ${destroot}/${prefix}/${pySite}/WrapITK.pth
     542    }
     543}
     544
     545variant py25 requires wrap conflicts py24 py26 description "python 2.5 wrapper" {
     546    setPython 2 5
     547    depends_lib-append \
     548        port:${pyPort}
     549    configure.args-append \
     550        -DPYTHON_EXECUTABLE:FILEPATH=${prefix}/${pyBin} \
     551        -DPYTHON_INCLUDE_PATH:FILEPATH=${prefix}/${pyInc} \
     552        -DPYTHON_LIBRARY:FILEPATH=${prefix}/${pyLib} \
     553        -DPYTHON_DEBUG_LIBRARY:FILEPATH=${prefix}/${pyLib} \
     554        -DPY_SITE_PACKAGES_PATH:PATH=${prefix}/${pySite}
     555    post-destroot {
     556        #if [expr [string match "2.4" ${pyVer}] | [string match "2.5" ${pyVer}]] {
     557        #    # Change the location of WrapITK.pth; This is only for
     558        #    # python24 or python25 because they "pretend" to be a framework
     559        #    # installation with a lot of symlinks that are not handled by the
     560        #    # port file_map process.
     561        #    xinstall -d -m 0755 ${destroot}/${prefix}/${pySite}
     562        #    move ${destroot}/${prefix}/${pyFrame}/lib/${python}/site-packages/WrapITK.pth ${destroot}/${prefix}/${pySite}/
     563        #}
     564        # Change the content of WrapITK.pth (for any python version)
     565        reinplace "s|${name}|${distname}|g" ${destroot}/${prefix}/${pySite}/WrapITK.pth
     566    }
     567}
     568
     569variant py26 requires wrap conflicts py24 py25 description "python 2.6 wrapper" {
     570    setPython 2 6
     571    depends_lib-append \
     572        port:${pyPort}
     573    configure.args-append \
     574        -DPYTHON_EXECUTABLE:FILEPATH=${prefix}/${pyBin} \
     575        -DPYTHON_INCLUDE_PATH:FILEPATH=${prefix}/${pyInc} \
     576        -DPYTHON_LIBRARY:FILEPATH=${prefix}/${pyLib} \
     577        -DPYTHON_DEBUG_LIBRARY:FILEPATH=${prefix}/${pyLib} \
     578        -DPY_SITE_PACKAGES_PATH:PATH=${prefix}/${pySite}
     579    post-destroot {
     580        # Change the content of WrapITK.pth (for any python version)
     581        reinplace "s|${name}|${distname}|g" ${destroot}/${prefix}/${pySite}/WrapITK.pth
     582    }
     583}
     584
     585
     586#variant java requires wrap description "provide java wrapper" {
    338587#    configure.args-append \
    339 #        -DUSE_WRAP_ITK:BOOL=ON \
    340 #        -DITK_USE_REVIEW:BOOL=ON \
    341 #        -DGUILE_EXECUTABLE:FILEPATH=${prefix}/bin/guile \
    342 #        -DGUILE_LIBRARY:FILEPATH=${prefix}/lib/libguile.dylib \
    343 #        -DGUILE_INCLUDE_PATH:PATH=${prefix}/include/guile \
    344 #        -DSWIG_BUILD_EXAMPLES:BOOL=ON
    345 #}
    346 #
    347 #
    348 #variant java requires wrap {
    349 #    configure.args-append \
    350 #        -DITK_CSWIG_JAVA:BOOL=ON
    351588#        # The following variables are defined automatically by cmake:
     589#        #-DJAVACOMMAND                     /usr/bin/java
    352590#        #-DJAVA_ARCHIVE                    /usr/bin/jar
    353591#        #-DJAVA_AWT_INCLUDE_PATH           /System/Library/Frameworks/JavaVM.framework/Headers
     
    359597#        #-DJAVA_RUNTIME                    /usr/bin/java
    360598#}
    361 #
    362 #variant py26 requires wrap description {python 2.6 wrapper} {
    363 #    set pyver        2.6
    364 #    set python       python${pyver}
    365 #    set pyport       [join [lrange [split ${python} .] 0 1] ""]
    366 #    set pyframe      ${prefix}/Library/Frameworks/Python.framework/Versions/${pyver}
    367 #    depends_lib-append \
    368 #        port:${pyport}
    369 #    configure.args-append \
    370 #        -DITK_CSWIG_PYTHON:BOOL=ON \
    371 #        -DPYTHON_DEBUG_LIBRARY:FILEPATH=-framework \
    372 #        -DPYTHON_EXECUTABLE:FILEPATH=${prefix}/bin/${python} \
    373 #        -DPYTHON_INCLUDE_PATH:FILEPATH=${prefix}/Library/Frameworks/Python.framework/Headers \
    374 #        -DPYTHON_LIBRARY:FILEPATH=-framework
    375 #        #-DPYTHON_LIBRARY:FILEPATH=${prefix}/lib/lib${python}.dylib \
    376 #        #-DPYTHON_DEBUG_LIBRARY:FILEPATH=${prefix}/lib/lib${python}.dylib \
    377 #        #-DVTK_PYTHON_SETUP_ARGS:STRING='--prefix=${pyframe} --root=${destroot}'
    378 #}
    379 #
    380 #variant tcl requires wrap description {tcl wrapper (MacPorts tcl/tk)} {
     599
     600
     601#variant tcl requires wrap description "tcl wrapper (MacPorts tcl/tk)" {
    381602#    depends_lib-append \
    382603#        port:tcl \
     
    389610#        -DTK_LIBRARY:FILEPATH=${prefix}/lib/libtk.dylib
    390611#}
    391         #-DITK_CSWIG_TCL:BOOL=ON \
    392 
    393 
    394 # The following were possibilities identified by ccmake
    395 
    396 #-DPERL_EXECUTABLE                 /opt/local/bin/perl
    397 #-DPERL_INCLUDE_PATH               PERL_INCLUDE_PATH-NOTFOUND
    398 #-DPERL_LIBRARY                    PERL_LIBRARY-NOTFOUND
    399 
    400 #-DPHP4_EXECUTABLE                 /opt/local/bin/php
    401 #-DPHP4_FOUND_INCLUDE_PATH         PHP4_FOUND_INCLUDE_PATH-NOTFOUND
    402 
    403 #-DPIKE_EXECUTABLE                 PIKE_EXECUTABLE-NOTFOUND
    404 #-DPIKE_INCLUDE_PATH               PIKE_INCLUDE_PATH-NOTFOUND
    405 
    406 #-DRUBY_EXECUTABLE                 RUBY_EXECUTABLE-NOTFOUND
    407 #-DRUBY_INCLUDE_PATH               /System/Library/Frameworks/Ruby.framework/Headers
    408 #-DRUBY_LIBRARY                    RUBY_LIBRARY-NOTFOUND
    409 
    410 
    411 
    412 
    413 
    414 
     612
     613
     614
     615
     616# -----------------------------------------------------------------------------
     617# Additional possibilities for variants, not yet evaluated.
    415618
    416619#ITK_USE_LIBXML2
    417620#ITK_USE_MINC2
    418 #
    419621
    420622#VNL_CONFIG_*
     
    431633#// Use an outside build of GDCM.
    432634#ITK_USE_SYSTEM_GDCM:BOOL=OFF
    433 #
    434635#// Use the system's libxml2 library.
    435636#ITK_USE_SYSTEM_LIBXML2:BOOL=OFF
    436 #
    437637#// Use the system's png library.
    438638#ITK_USE_SYSTEM_PNG:BOOL=OFF
    439 #
    440639#// Use the system's tiff library.
    441640#ITK_USE_SYSTEM_TIFF:BOOL=OFF
    442 #
    443641#// Use an outside build of VXL.
    444642#ITK_USE_SYSTEM_VXL:BOOL=OFF
    445 #
    446643#// Use the system's zlib library.
    447644#ITK_USE_SYSTEM_ZLIB:BOOL=OFF
     
    449646
    450647
     648# -----------------------------------------------------------------------------
    451649#livecheck.check     sourceforge
    452650#livecheck.regex     <title>itk InsightToolkit-(.*) released.*</title>
Note: See TracChangeset for help on using the changeset viewer.