Ticket #50424: Portfile.diff

File Portfile.diff, 4.0 KB (added by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez), 9 years ago)
  • Portfile

    old new  
    181181        select.file         ${filespath}/${subport}
    182182
    183183        configure.args-append -DGEANT4_USE_SYSTEM_EXPAT=ON \
     184                              -DGEANT4_USE_SYSTEM_ZLIB=ON \
    184185                              -DGEANT4_USE_SYSTEM_CLHEP=OFF
    185186
     187        if {[vercmp ${geant.version} 10.2] >= 0} {
     188            depends_lib-append    port:freetype
     189            configure.args-append -DGEANT4_USE_FREETYPE=ON
     190        }
     191
     192        if {[vercmp ${geant.version} 10.0] < 0} {
     193            # according to cmake/Modules/Geant4OptionalComponents.cmake, internal zlib must be used
     194            configure.args-delete -DGEANT4_USE_SYSTEM_ZLIB=ON
     195            depends_lib-delete    port:zlib
     196        }
     197
    186198        # - patch-upstream-source-interfaces-common-src-G4Qt.cc:
    187199        #       http://bugzilla-geant4.kek.jp/show_bug.cgi?id=1487
    188200        # - patch-upstream-examples-advanced-xray_fluorescence:
     
    225237                              -DCMAKE_INSTALL_BINDIR=${prefix}/libexec/Geant4/Geant${geant.version_simple} \
    226238                              -DCMAKE_INSTALL_DATAROOTDIR=${prefix}/share/Geant4 \
    227239                              -DCMAKE_INSTALL_INCLUDEDIR=${prefix}/include/Geant4/Geant${geant.version_simple} \
    228                               -DCMAKE_INSTALL_LIBDIR=${prefix}/lib/Geant4/Geant${geant.version_simple}
    229 
    230         if {${geant.version} != "9.5"} {
    231             configure.args-append -DGEANT4_INSTALL_DATADIR=${geant.datadir} \
    232         }
     240                              -DCMAKE_INSTALL_LIBDIR=${prefix}/lib/Geant4/Geant${geant.version_simple} \
     241                              -DGEANT4_INSTALL_DATADIR=${geant.datadir}
    233242
    234243        # this is only needed when +examples is used
    235244        post-destroot {
     
    250259      Otherwise source ${prefix}/libexec/Geant4/Geant${geant.version_simple}/geant4.(c)sh
    251260"
    252261
    253         variant qt conflicts qt5 description {Build with Qt 4 support} {
     262        variant qt4 conflicts qt5 description {Build with Qt 4 support} {
    254263            PortGroup qt4         1.0
    255             configure.args-append -DGEANT4_USE_QT=ON
     264            configure.args-append  \
     265                -DGEANT4_USE_QT=ON \
     266                -DGEANT4_FORCE_QT4=ON
    256267        }
    257         # TODO: figure out which versions of Geant4 are compatible with Qt 5
    258         variant qt5 conflicts qt description {Build with Qt 5 support} {
     268
     269        variant qt5 conflicts qt4 description {Build with Qt 5 support} {
    259270            PortGroup qt5         1.0
    260271            configure.args-append -DGEANT4_USE_QT=ON
    261272        }
    262273
     274        if {[vercmp ${geant.version} 10.1] <= 0} {
     275            patchfiles-append \
     276                patch-choose_qt.diff
     277
     278            variant qt requires qt4 description {Obsolete variant; use qt4 or qt5 instead} {}
     279        }
     280
    263281        # From installation notes:
    264282        #
    265283        # It is recommended that Windows and Mac users prefer the Geant4 Qt4 GUI. Note
     
    329347                                  -DCLHEP_LIBRARY=${prefix}/lib/libCLHEP.dylib
    330348        }
    331349
    332         if {${geant.version} >= "10.0"} {
     350        if {[vercmp ${geant.version} 10.0] >= 0} {
    333351            variant threads description {Build with multi-threading support} {
    334352                configure.args-append -DGEANT4_BUILD_MULTITHREADED=ON
    335353            }
    336354        }
    337355
    338356        default_variants-append +gdml
    339         if {![variant_isset qt5]} {
    340             default_variants-append +qt
     357        if {![variant_isset qt4] && ![variant_isset qt5]} {
     358            # not Qt variant set, so try to find a good default one
     359
     360            set   just_want_qt5_version_info yes
     361            PortGroup qt5 1.0
     362            unset just_want_qt5_version_info
     363
     364            if { ${os.major} < ${qt5_min_tested_version} } {
     365                default_variants-append +qt4
     366            } else {
     367                default_variants-append +qt5
     368            }
    341369        }
    342370
    343371        set geant.version_full_no_patch [join [lrange [split ${geant.version_full} .] 0 2] \\.]