Ticket #44501: Portfile.diff

File Portfile.diff, 5.2 KB (added by cooljeanius (Eric Gallager), 10 years ago)

diff between my newly-attached Portfile and the Portfile for open-cobol in trunk

  • Portfile

    old new  
    44PortSystem          1.0
    55
    66name                open-cobol
    7 version             1.1
     7version             2.0
     8revision            1
    89categories          lang
    910maintainers         gwmail.gwu.edu:egall openmaintainer
    1011license             GPL-2+
    11 description         OpenCOBOL
    12 long_description    OpenCOBOL is an open-source COBOL compiler.
     12description         OpenCOBOL, aka GNU Cobol
     13long_description    ${description}, is a free and open-source COBOL \
     14                    compiler.
    1315
    1416homepage            http://www.opencobol.org/
    1517platforms           darwin
    1618
    17 master_sites        sourceforge:project/open-cobol/open-cobol/${version}/
     19master_sites        sourceforge:project/${name}/${name}/${version}/ \
     20                    sourceforge
    1821
    19 checksums           md5    e38c898e01d50a7ca6bb3e41cfcb0c64 \
    20                     sha1   a833f011cd0f56d0aa3d97a56258ddd5141b594c \
    21                     rmd160 931cd83d5ebbfae66b6e2601bb100e07a10d61a6
     22distname            ${name}-${version}-feb2012
     23worksrcdir          ${name}-${version}
    2224
     25checksums           md5     58287e902f3b64dbac110d570c4aba4a \
     26                    sha1    5088e2ebc2549b4ca9f7daba4e309682d8067cde \
     27                    rmd160  39a1341a48b7e4addfaa545064849fe3dd29c881
     28
     29# Mostly taken from the Fink package for open-cobol:
    2330depends_lib-append  port:gmp \
    2431                    port:libtool \
    2532                    port:db44 \
     
    2936                    port:gettext \
    3037                    port:mpfr
    3138
    32 configure.args-append     --infodir=${prefix}/share/info
    33 configure.cppflags-append -I${prefix}/include/gnugetopt -Wno-pointer-sign \
    34                           -I${prefix}/include/db44
    35 configure.ldflags-append  -lgnugetopt -L${prefix}/lib/db44
     39# Patch to fix https://sourceforge.net/p/open-cobol/bugs/73/ until
     40# upstream gets around to fixing it themselves:
     41patchfiles-append   patch-libcob_Makefile.am.diff
     42patch.args-append   --backup
     43
     44# since we are patching an automake Makefile, need to regenerate it:
     45post-patch {
     46    # use_automake does not automatically call aclocal for us like
     47    # use_autoreconf does, so need to call it manually:
     48    ui_debug "running '${prefix}/bin/aclocal --force --warnings=all -I m4 --install' in ${worksrcpath}"
     49    system -W ${worksrcpath} "${prefix}/bin/aclocal --force --warnings=all -I m4 --install"
     50}
     51
     52use_automake        yes
     53automake.args       --add-missing --copy --force-missing --warnings=all
     54
     55# also mostly originally taken from Fink, but with some additions:
     56configure.args-append     --infodir=${prefix}/share/info \
     57                          --with-libiconv-prefix=${prefix} \
     58                          --with-libintl-prefix=${prefix}
     59configure.cppflags-append -I${prefix}/include/gnugetopt \
     60                          -I${prefix}/include/db44 \
     61                          -Wno-pointer-sign
     62configure.ldflags-append  -L${prefix}/lib/db44
     63
     64# try to override various environment variables that might contain an '-R',
     65# and try to force libiconv to be used properly:
     66configure.env-append      COBC_LIBS='${configure.ldflags}' \
     67                          INTLLIBS='-lintl -liconv' \
     68                          LIBCOB_LIBS='-lm -lgmp -lmpfr -lncursesw -ldb' \
     69                          LIBINTL='-lintl -liconv' \
     70                          LIBS='-lgnugetopt' \
     71                          LTLIBICONV='-L/opt/local/lib -liconv' \
     72                          LTLIBINTL='-L/opt/local/lib -lintl -liconv'
     73
     74# temporarily disable ccache as I test as non-root:
     75configure.ccache    no
     76
     77# the configure script adds the '-pipe' flag anyway, so get rid of the
     78# duplicate unconditionally:
     79configure.pipe      no
     80
     81# see:
     82#https://sourceforge.net/p/open-cobol/discussion/help/thread/e1b4af35/#427c
     83test.run            yes
     84test.target         check
     85# (tests 111, 112, 217 and 269 fail for me if I set
     86# "configure.compiler=clang" from the command line, otherwise all tests
     87# pass with gcc)
     88
     89post-test {
     90    if {[file exists ${prefix}/share/${name}/config/default.conf]} {
     91        ui_debug "${worksrcpath}/cobc/cobc -x ${filespath}/hello.cob"
     92        system -W ${worksrcpath} "./cobc/cobc -x ${filespath}/hello.cob 2>&1 || echo \"cobc failed\""
     93    } else {
     94        ui_warn "cannot run cobc without an installed default.conf"
     95    }
     96    if {[file exists ${worksrcpath}/cobc/hello]} {
     97        ui_debug "${worksrcpath}/cobc/hello"
     98        system -W ${worksrcpath} "./hello"
     99    } else {
     100        ui_warn "cobc failed to produce any output"
     101    }
     102    ui_debug "${worksrcpath}/bin/cob-config --libs"
     103    system -W ${worksrcpath} "./bin/cob-config --libs"
     104}
     105
     106# https://lists.macosforge.org/pipermail/macports-users/2014-May/035518.html
     107if {[string match *clang* ${configure.compiler}]} {
     108    configure.args-append --disable-rpath
     109    configure.cppflags-append -std=gnu89
     110    pre-configure {
     111        ui_warn "${name} has issues with clang"
     112    }
     113}
     114
     115variant debug description {enable debugging} {
     116    configure.args-append --enable-debug \
     117                          --enable-param-check
     118    # '--enable-debug' will add a '-g' of its own, but we need to override
     119    # the '-Os' that MacPorts would otherwise want to add as well:
     120    configure.optflags    -g
     121}