Ticket #50687: netgen.Portfile.diff

File netgen.Portfile.diff, 3.6 KB (added by ian.rees@…, 9 years ago)

Add nglib installation by default, add occ variant, reference patch-nglib-ng_vol.cpp.diff

  • Portfile

    diff -u netgen-orig/Portfile netgen-wip/Portfile
    old new  
    77name                netgen
    88version             5.3.1
    99set branch          [join [lrange [split ${version} .] 0 1] .]
    10 revision            1
     10revision            2
    1111platforms           darwin
    1212categories          math
    1313license             LGPL-2
     
    3131
    3232depends_lib         port:tcl port:tk port:tix port:Togl port:mesa port:libGLU
    3333
    34 patchfiles          patch-ng-ng.tcl.diff
     34patchfiles          patch-ng-ng.tcl.diff\
     35                    patch-nglib-ng_vol.cpp.diff
    3536
    3637configure.args      --mandir=${prefix}/share/man \
    3738                    --with-tcl=${prefix}/lib \
    3839                    --with-tk=${prefix}/lib \
    39                     --disable-shared
     40                    --enable-nglib
     41
     42variant occ description {EnableOpenCascade support} {
     43                    depends_lib-append port:oce
     44                    patchfiles-append patch-libsrc-occ-Partition_Loop2d.cxx.diff
     45
     46                    configure.args-append --enable-occ --with-occ=${prefix}/include/oce
     47
     48                    # Netgen 5.3.1 appends problematic hard-coded directories
     49                    # on to the include and lib paths.
     50                    configure.args-append CPPFLAGS=-I${prefix}/include/oce LDFLAGS=-L${prefix}/lib/
     51}
     52
     53post-destroot {
     54                    # Usage of nglib requires some headers that aren't installed by default.
     55                    # Unfortunately, the best solution seems to be copying headers from the
     56                    # entire libsrc directory in to ${prefix}/share...
     57                    proc ng_libsrc_copy {src dest subdir} {
     58                        xinstall -m 755 -d $dest/$subdir
     59                        xinstall -m 644 {*}[glob -directory $src/libsrc/$subdir/ *\.h *.hpp] $dest/$subdir
     60                    }
     61
     62                    set netgen_libsrc_dir ${destroot}${prefix}/include/netgen
     63
     64                    xinstall -m 755 -d ${netgen_libsrc_dir}
     65                    ng_libsrc_copy ${worksrcpath} ${netgen_libsrc_dir} csg
     66                    ng_libsrc_copy ${worksrcpath} ${netgen_libsrc_dir} general
     67                    ng_libsrc_copy ${worksrcpath} ${netgen_libsrc_dir} geom2d
     68                    ng_libsrc_copy ${worksrcpath} ${netgen_libsrc_dir} gprim
     69                    ng_libsrc_copy ${worksrcpath} ${netgen_libsrc_dir} include
     70                    ng_libsrc_copy ${worksrcpath} ${netgen_libsrc_dir} interface
     71                    ng_libsrc_copy ${worksrcpath} ${netgen_libsrc_dir} linalg
     72                    ng_libsrc_copy ${worksrcpath} ${netgen_libsrc_dir} meshing
     73                    ng_libsrc_copy ${worksrcpath} ${netgen_libsrc_dir} occ
     74                    ng_libsrc_copy ${worksrcpath} ${netgen_libsrc_dir} stlgeom
     75                    ng_libsrc_copy ${worksrcpath} ${netgen_libsrc_dir} visualization
     76}
    4077
    4178# there do not seem to be any tests include with this port. 'make check' does nothing.
    4279
    4380# Other options that could be considered here:
    44 #--enable-occ            compile with OpenCascade geometry kernel
    45 #--enable-nglib          generate shared library nglib
    4681#--enable-parallel       enable mpi parallelization
    4782#--enable-jpeglib        enable snapshots using library libjpeg
    4883#--enable-ffmpeg         enable video recording with FFmpeg, uses libavcodec
    4984#--enable-mkl            link Intel's mkl library, necessary for ngsolve and mkl 11.x
    5085#
    5186#Optional Packages:
    52 #--with-occ=dir          use OpenCascade installed in directory dir
    5387#--with-togl=dir         directory containing libTogl1.7
    5488#--with-metis=dir        path to metis 5.x