Ticket #37440: Portfile.patch

File Portfile.patch, 10.5 KB (added by tenomoto (Takeshi Enomoto), 11 years ago)
  • Portfile

     
    22# $Id$
    33
    44PortSystem                  1.0
     5PortGroup                   cmake 1.0
    56
    67name                        gnudatalanguage
    7 version                     0.9.2
    8 revision                    2
     8version                     0.9.3
    99epoch                       1
    1010categories                  math science
    1111maintainers                 takeshi igf.fuw.edu.pl:slayoo
     
    2424set gshhssrc        gshhs_${srcversion}_src.zip
    2525set gshhsdata       gshhs_${dataversion}.zip
    2626distfiles           ${gdlsrc}:gdl
    27 worksrcdir                  gdl-${version}
    28 patchfiles          configure.in.patch
     27worksrcdir          gdl-${version}
    2928
    3029checksums           ${gdlsrc} \
    31                     md5      7178304e6737a8dca910d2c1061ff63c \
    32                     sha1     0d6fe86e2971637310c6298379616b02f773e956 \
    33                     rmd160   6913b358de01550256ad38c920cc461e8ef94512
     30                    md5     f71f869e6c9aa99bbfdb22ecd5c88914 \
     31                    sha1    a4558643645cc414041d588e375669810780a69a \
     32                    rmd160  a6eed21d1a328156b794ba7a6a90e1942fa38fd7
    3433
    3534depends_lib                 port:zlib \
    3635                            port:gsl \
     
    5150                            port:pslib
    5251
    5352post-patch {
    54    # add the CMSVLIB installation path
    55    reinplace "s|dicom\"|dicom:${prefix}/share/cmsvlib\"|" ${worksrcpath}/src/gdl.cpp
    5653   # Avoid using heimdal's broken fnmatch.h
    5754   reinplace "s|<\\(fnmatch\.h\\)>|\"/usr/include/\\1\"|" ${worksrcpath}/src/file.cpp
    58    reinplace "s|/usr/X11R6/lib64|${prefix}/lib|" ${worksrcpath}/src/Makefile.am
    59    reinplace "s| -L/usr/X11R6/lib||" ${worksrcpath}/src/Makefile.am
    6055   reinplace "s|\.\./gshhs|gshhs|" ${worksrcpath}/src/gshhs.cpp
    6156}
    6257
    63 use_autoreconf              yes
    64 if {${configure.compiler}=="clang"} {
    65     configure.compiler llvm-gcc-4.2
    66 }
    67 if {${os.major}>=9 && ${configure.compiler}=="gcc-4.0"} {
    68     configure.compiler gcc-4.2
    69 }
    70 configure.env-append        LIBS=\"-lpng -lopenjpeg\"
    71 configure.args              --with-plplotdir=${prefix} \
    72                             --with-ncursesdir=${prefix} \
    73                             --with-readlinedir=${prefix} \
    74                             --with-gsldir=${prefix} \
    75                             --with-netcdf=${prefix} \
    76                             --with-hdf=${prefix} \
    77                             --with-hdf5=${prefix} \
    78                             --with-grib=${prefix} \
    79                             --with-Magick=${prefix} \
    80                             --without-wxWidgets \
    81                             --disable-dependency-tracking \
    82                             --x-includes=${prefix}/include \
    83                             --x-libraries=${prefix}/lib \
    84                             --with-udunits=${prefix} \
    85                             --with-fftw=${prefix} \
    86                             --with-libproj4=${prefix} \
    87                             --with-pslib=${prefix} \
    88                             --with-python=no \
    89                             --with-openmp=no
    90 configure.cppflags-delete   -I${prefix}/include
    91 configure.cppflags-append   -I${prefix}/include/udunits2 -I${prefix}/include
     58compiler.blacklist          clang \
     59                            gcc-4.0
    9260
     61configure.args-append       -DFFTW=ON \
     62                            -DFFTWDIR=${prefix} \
     63                            -DGRIB=ON \
     64                            -DGRIBDIR=${prefix} \
     65                            -DGSHHS=OFF \
     66                            -DGSLDIR=${prefix} \
     67                            -DHDF5=ON \
     68                            -DHDF5DIR=${prefix} \
     69                            -DHDF=ON \
     70                            -DHDFDIR=${prefix} \
     71                            -DJASPERDIR=${prefix} \
     72                            -DJPEGDIR=${prefix} \
     73                            -DLIBPROJ4=ON \
     74                            -DLIBPROJ4DIR=${prefix} \
     75                            -DMAGICK=OFF \
     76                            -DMAGICK=ON \
     77                            -DMAGICKDIR=${prefix} \
     78                            -DMPICH=OFF \
     79                            -DNCURSESDIR=${prefix} \
     80                            -DNETCDF=ON \
     81                            -DNETCDFDIR=${prefix} \
     82                            -DOPENMP=OFF \
     83                            -DPLPLOTDIR=${prefix} \
     84                            -DPSLIB=ON \
     85                            -DPSLIBDIR=${prefix} \
     86                            -DPYTHON=OFF \
     87                            -DPYTHON_MODULE=OFF \
     88                            -DREADLINE=ON \
     89                            -DREADLINEDIR=${prefix} \
     90                            -DUDUNITS=ON \
     91                            -DUDUNITSDIR=${prefix} \
     92                            -DUDUNITS_INCLUDE_DIR=${prefix}/include/udunits2 \
     93                            -DWXWIDGETS=OFF \
     94                            -DX11DIR=${prefix} \
     95                            -DZLIBDIR=${prefix} \
     96                            -DCMAKE_OSX_DEPLOYMENT_TARGET=""
     97
    9398test.run                    yes
    9499test.target                 check
    95100
    96 destroot.target             install-strip
    97 
    98101use_parallel_build          yes
    99102
    100103post-destroot {
    101    xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}
    102    xinstall -m 644 -W ${worksrcpath} AUTHORS COPYING Doxyfile ChangeLog HACKING NEWS MAP_INSTALL PYTHON.txt README TODO ${destroot}${prefix}/share/doc/${name}
    103    xinstall -m 755 -d ${destroot}${prefix}/share/${name}
    104    xinstall -m 755 -d ${destroot}${prefix}/share/${name}/py
    105    eval xinstall -m 644 [glob ${worksrcpath}/src/py/*.py] ${destroot}${prefix}/share/${name}/py
    106104   xinstall -m 755 -d ${destroot}${prefix}/share/${name}/testsuite
    107105   eval xinstall -m 644 [glob ${worksrcpath}/testsuite/*.pro] \
    108106      ${destroot}${prefix}/share/${name}/testsuite
     
    110108
    111109variant mpich description {build with support for MPICH (experimental)} {
    112110    depends_lib-append      port:mpich
    113     configure.args-append   --with-mpich=${prefix}
     111    configure.args-delete   -DMPICH=OFF
     112    configure.args-append   -DMPICH=ON \
     113                            -DMPICHDIR=${prefix}/lib/mpich
    114114}
    115115
    116116variant wxWidgets description {build with support for widgets (experimental, not functional yet)} {
    117117    supported_archs         ppc i386
    118118    depends_lib-append      port:wxWidgets
    119     configure.args-delete   --without-wxWidgets
    120     configure.args-append   --with-wxWidgets=${prefix}
     119    configure.args-delete   -DWXWIDGETS=OFF \
     120    configure.args-append   -DWXWIDGETS=ON \
     121                            -DWXWIDGETSDIR=${prefix}
    121122    # http://wiki.finkproject.org/index.php/Fink:Packaging:Preparing_for_10.5#OpenGL_Bug
    122123    #configure.env-append    LDFLAGS=\"-Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib\"
    123124}
    124125
    125 variant python description {build with support for calling Python (2.6) from GDL (using numpy)} {
    126     depends_lib-append      port:python26 \
    127                             port:py26-numpy
    128     configure.args-append   --with-python=${prefix}/Library/Frameworks/Python.framework/Versions/2.6 \
    129                             --enable-python_version=2.6
     126if {[variant_isset python]} {
     127    return -code error "python variant is deprecated. Choose one of python2x variants"
    130128}
    131129
    132 variant openmp description {enabling of the support for multi-threaded matrix operations using OpenMP} {
    133     configure.args-delete   --with-openmp=no
    134     configure.args-append   --with-openmp=yes
     130if {[variant_isset python25] || [variant_isset python26] || [variant_isset python27]} {
     131    configure.args-delete   -DPYTHON=OFF
     132    configure.args-append   -DPYTHON=ON
     133}
     134
     135variant python description {deprecated variant choose one of python2x variants} {
     136}
     137
     138variant python25 conflicts python26 python27 description {build with support for calling Python (2.5) from GDL (using numpy)} {
     139    depends_lib-append      port:py25-numpy
     140    configure.args-append   -DPYTHONDIR=${frameworks_dir}/Python.framework/Versions/2.5 \
     141                            -DPYTHONVERSION=2.5
     142}
     143
     144variant python26 conflicts python25 python27 description {build with support for calling Python (2.6) from GDL (using numpy)} {
     145    depends_lib-append      port:py26-numpy
     146    configure.args-append   -DPYTHONDIR=${frameworks_dir}/Python.framework/Versions/2.6 \
     147                            -DPYTHONVERSION=2.6
     148}
     149
     150variant python27 conflicts python25 python26 description {build with support for calling Python (2.7) from GDL (using numpy)} {
     151    depends_lib-append      port:py27-numpy
     152    configure.args-append   -DPYTHONDIR=${frameworks_dir}/Python.framework/Versions/2.7 \
     153                            -DPYTHONVERSION=2.7
     154}
     155
     156if {[variant_isset gcc44] || [variant_isset gcc45] || [variant_isset gcc46] || [variant_isset gcc47]} {
     157    configure.args-delete   -DOPENMP=OFF
     158    configure.args-append   -DOPENMP=ON
     159}
     160
     161variant openmp description {deprecated variant. Choose one of gcc4x variants.} {
     162}
     163
     164variant gcc44 conflicts gcc45 gcc46 gcc47 description {enabling of the support for OpenMP with gcc44} {
    135165    configure.compiler      macports-gcc-4.4
    136166    depends_build-append    port:gcc44
    137167}
    138168
     169variant gcc45 conflicts gcc44 gcc46 gcc47 description {enabling of the support for OpenMP with gcc45} {
     170    configure.compiler      macports-gcc-4.5
     171    depends_build-append    port:gcc45
     172    configure.args-append   -D
     173}
     174
     175variant gcc46 conflicts gcc44 gcc45 gcc47 description {enabling of the support for OpenMP with gcc46} {
     176    configure.compiler      macports-gcc-4.6
     177    depends_build-append    port:gcc46
     178}
     179
     180variant gcc47 conflicts gcc44 gcc45 gcc46 description {enabling of the support for OpenMP with gcc47} {
     181    configure.compiler      macports-gcc-4.7
     182    depends_build-append    port:gcc47
     183}
     184
    139185variant gshhs description {build with support for GSHHS} {
    140186    distfiles-append        ${gshhssrc}:gshhs \
    141187                            ${gshhsdata}:gshhs
     
    154200                unzip ${distpath}/${gshhssrc} gshhs/gshhs.h; \
    155201                unzip ${distpath}/${gshhsdata}"
    156202    }
    157     configure.args-append   --with-gshhs=${workpath}/gshhs
    158     configure.cppflags-append   -I${workpath}/gshhs
     203    configure.args-delete   -DGSHHS=OFF
     204    configure.args-append   -DGSHHS=ON \
     205                            -DGSHHSDIR=${workpath}/gshhs
    159206    post-destroot {
    160207        xinstall -d ${destroot}${prefix}/share/gnudatalanguage/gshhs
    161208        foreach f [glob ${workpath}/gshhs/*.b] {