Ticket #53096: fpc-304.diff

File fpc-304.diff, 9.0 KB (added by RJVB (René Bertin), 6 years ago)

upgrade to 3.0.4

  • lang/fpc/Portfile

    diff --git a/lang/fpc/Portfile b/lang/fpc/Portfile
    index 4e4b44a454..2e0393f56f 100644
    a b  
    33PortSystem          1.0
    44
    55name                fpc
    6 version             2.6.4
    7 revision            1
     6version             3.0.4
    87categories          lang
    98platforms           darwin
    109license             GPL-2 LGPL-2
    11 maintainers         {takeshi @tenomoto} openmaintainer
    12 description         free pascal
    13 long_description    Open source compiler for Pascal and Object Pascal
     10maintainers         takeshi openmaintainer
     11description         Free Pascal, an open source Pascal and Object Pascal compiler.
     12long_description    Free Pascal is a 32, 64 and 16 bit professional Pascal compiler. \
     13                    It can target many processor architectures: Intel x86 (including 8086), \
     14                    AMD64/x86-64, PowerPC, PowerPC64, SPARC, ARM, AArch64, MIPS and the JVM. \
     15                    Supported operating systems include Linux, FreeBSD, Mac OS X/iOS/iPhoneSimulator/Darwin, \
     16                    Win32, Win64, WinCE and Android.
    1417homepage            http://www.freepascal.org
    1518master_sites        sourceforge:freepascal
    1619
    1720set src             ${name}build-${version}.tar.gz
    18 set pp              universal-macosx-10.5-ppcuniversal.tar.bz2
     21# set pp              universal-macosx-10.5-ppcuniversal.tar.bz2
     22# this is the 3.0.0 bootstrap compiler
     23set pp              x86_64-macosx-10.7-ppcx64.tar.bz2
    1924distfiles           ${src} ${pp}
    2025checksums           ${src} \
    21                     rmd160  339b71d3c9983a720eed7c6bda1cfd330d89966f \
    22                     sha256  8d9c3bcfa469d9b37c05663e2775d179809e4b3443604fac7d21aa64c9a56daa \
     26                    rmd160  f9414fe72342cff4317029f3a83a90e8dc710389 \
     27                    sha256  f66514e6f2c2e4e1bccccb4d554c24b77682ed61c87811ae5dd210f421855e76 \
    2328                    ${pp} \
    24                     rmd160  0124c2f4447ba7f96e3db0a27e6bff459c5749f4 \
    25                     sha256  e7243e83e6a04de147ebab7530754ec92cd1fbabbc9b6b00a3f90a796312f3e9
     29                    rmd160  25fb3c2eb9fa364ee56a5f3c2667151143f39777 \
     30                    sha256  a67ef5def356d122a4692e21b209c328f6d46deef4539f4d4506c3dc1eecb4b0
     31supported_archs     x86_64
     32# doesn't install shared libraries
     33installs_libs       no
    2634
    2735extract.only        ${src}
    28                    
     36
    2937use_configure       no
    3038universal_variant   no
    3139
    32 post-extract {
    33     system -W ${workpath} "bzip2 -dc ${distpath}/${pp} | tar xf -"
    34 }
    35 
    36 worksrcdir          ${name}build-${version}/fpcsrc
    37 set fpcbasepath     ${prefix}/lib/${name}
    38 build.env           PP=${workpath}/ppcuniversal \
    39                     PREFIX=${destroot}${fpcbasepath}
    40 build.target        all
     40set fpcbasepath     ${prefix}/libexec/${name}
    4141
    42 destroot.env        ${build.env}
     42subport "chmcmd-${name}" {
     43    description     The FPC Pascal htmlhelp (CHM) compiler
     44    long_description \
     45                    chmcmd is an cross-platform utility to generate compressed HTML (.chm)\
     46                    documentation, written in Free Pascal
    4347
    44 # Yosemite fix: fpc's build system checkes MACOSX_DEPLOYMENT_TARGET and halts if > 10.9
    45 platform darwin {
    46     if {${os.major} > 13} {
    47         macosx_deployment_target    10.9
     48    depends_build-append \
     49                    port:${name}
     50    extract.post_args-append \
     51                    ${name}build-${version}/fpcsrc/packages/chm \
     52                    ${name}build-${version}/fpcsrc/packages/fcl-xml \
     53                    ${name}build-${version}/fpcsrc/packages/fcl-base \
     54                    ${name}build-${version}/fpcsrc/packages/fcl-process \
     55                    ${name}build-${version}/fpcsrc/packages/fpmkunit \
     56                    ${name}build-${version}/fpcsrc/packages/hash \
     57                    ${name}build-${version}/fpcsrc/packages/iconvenc \
     58                    ${name}build-${version}/fpcsrc/packages/libtar \
     59                    ${name}build-${version}/fpcsrc/packages/paszlib \
     60                    ${name}build-${version}/fpcsrc/packages/univint \
     61                    ${name}build-${version}/fpcsrc/rtl
     62    worksrcdir      ${name}build-${version}/fpcsrc/packages/chm
     63    use_configure   yes
     64    configure.cmd   ${fpcbasepath}/bin/fpcmake
     65    configure.pre_args
     66    configure.args  -r -v Makefile.fpc.fpcmake
     67    configure.post_args
     68    build.env       PREFIX=${prefix}
     69    build.target
     70    build.post_args-append \
     71                    V=1 VERBOSE=1
     72    destroot {
     73        xinstall -m 755 ${build.dir}/chmcmd ${destroot}${prefix}/bin
    4874    }
    4975}
    5076
    51 post-destroot {
    52 # create a symlink to the architecture dependent executable
     77if {${subport} eq "${name}"} {
     78    installs_libs       yes
     79
     80    post-extract {
     81        system -W ${workpath} "bzip2 -dc ${distpath}/${pp} | tar xf -"
     82    }
     83
    5384    switch ${build_arch} {
    5485        "x86_64" {
    5586            set b "ppcx64"
    5687        }
    57         "i386" {
    58             set b "ppc386"
    59         }
    60         default {
    61             set b "ppcppc"
     88#         "i386" {
     89#             set b "ppc386"
     90#         }
     91#         default {
     92#             set b "ppcppc"
     93#         }
     94    }
     95
     96    worksrcdir          ${name}build-${version}/fpcsrc
     97    build.env           PP=${workpath}/${b} \
     98                        PREFIX=${destroot}${fpcbasepath}
     99    build.target        all
     100
     101    destroot.env        ${build.env}
     102
     103    # Yosemite fix: fpc's build system checkes MACOSX_DEPLOYMENT_TARGET and halts if > 10.9
     104    platform darwin {
     105        if {${os.major} > 13} {
     106            macosx_deployment_target    10.9
    62107        }
    63108    }
    64     ln -s ${fpcbasepath}/lib/${name}/${version}/${b} ${destroot}${fpcbasepath}/bin
    65 # generate a configuration file
    66     xinstall -d ${destroot}${fpcbasepath}/etc
    67     system "
    68         ${destroot}${fpcbasepath}/bin/fpcmkcfg \
    69             -d basepath=${fpcbasepath}/lib/${name}/${version} \
    70             -o ${destroot}${fpcbasepath}/etc/fpc.cfg
    71     "
    72 # install man
    73     xinstall -d ${destroot}${fpcbasepath}/man
    74     foreach d {1 5} {
    75         file copy ${workpath}/${name}build-${version}/install/man/man${d} ${destroot}${fpcbasepath}/man
    76         foreach f [glob ${destroot}${fpcbasepath}/man/man${d}/*.${d}] {
    77             system "/usr/bin/gzip ${f}"
     109
     110    post-destroot {
     111        # create a symlink to the architecture dependent executable
     112        ln -s ${fpcbasepath}/lib/${name}/${version}/${b} ${destroot}${fpcbasepath}/bin
     113        # generate a configuration file
     114        xinstall -d ${destroot}${fpcbasepath}/etc
     115        system "
     116            ${destroot}${fpcbasepath}/bin/fpcmkcfg \
     117                -d basepath=${fpcbasepath}/lib/${name}/${version} \
     118                -o ${destroot}${fpcbasepath}/etc/fpc.cfg
     119        "
     120        ln -s ${fpcbasepath}/etc/fpc.cfg ${destroot}${prefix}/etc
     121
     122        # install man
     123        xinstall -d ${destroot}${fpcbasepath}/man
     124        foreach d {1 5} {
     125            file copy ${workpath}/${name}build-${version}/install/man/man${d} ${destroot}${fpcbasepath}/man
     126            foreach f [glob ${destroot}${fpcbasepath}/man/man${d}/*.${d}] {
     127                system "/usr/bin/gzip ${f}"
     128            }
     129        }
     130        ln -s ${fpcbasepath}/man/man1/fpc.1.gz ${destroot}${prefix}/share/man/man1
     131        ln -s ${fpcbasepath}/man/man5/fpc.cfg.5.gz ${destroot}${prefix}/share/man/man5
     132
     133        # chmcmd will be installed by the chmcmd-fpc subport
     134        file delete -force ${destroot}${fpcbasepath}/bin/chmcmd
     135        foreach b [glob -nocomplain ${destroot}${fpcbasepath}/bin/*] {
     136            set n [file tail ${b}]
     137            ln -s ${fpcbasepath}/bin/${n} ${destroot}${prefix}/bin
    78138        }
    79139    }
    80     ln -s ${fpcbasepath}/man/man1/fpc.1.gz ${destroot}${prefix}/share/man/man1
    81     ln -s ${fpcbasepath}/man/man5/fpc.cfg.5.gz ${destroot}${prefix}/share/man/man5
    82 }
    83140
    84 notes "
    85     The compiler fpc looks for the fpc.cfg file in the following places: \n\
    86     - The current directory. \n\
    87     - Home directory, looks for .fpc.cfg \n\
    88     - The directory specified in the environment variable PPC_CONFIG_PATH, \n\
    89       and if it's not set under compilerdir/../etc. \n\
    90     - If it is not yet found: in /etc. \n\
    91     \n\
    92     All the files of fpc are installed in ${fpcbasepath} and \n\
    93     the executables are installed in ${fpcbasepath}/bin. \n\
    94     The fpc.cfg is installed in ${fpcbasepath}/etc to make fpc find fpc.cfg. \n\
    95     To customize, use ~/.fpc.cfg or /etc/fpc.cfg and call ${fpcbasepath}/bin/fpc directly.
    96 "
     141    notes "
     142        The compiler fpc looks for the fpc.cfg file in the following places: \n\
     143        - The current directory. \n\
     144        - Home directory, looks for .fpc.cfg \n\
     145        - The directory specified in the environment variable PPC_CONFIG_PATH, \n\
     146          and if it's not set under compilerdir/../etc. \n\
     147        - If it is not yet found: in /etc. \n\
     148        \n\
     149        All the files of fpc are installed in ${fpcbasepath} and \n\
     150        the executables are installed in ${fpcbasepath}/bin. \n\
     151        The fpc.cfg is installed in ${fpcbasepath}/etc to make fpc find fpc.cfg. \n\
     152        To customize, use ~/.fpc.cfg or /etc/fpc.cfg and call ${fpcbasepath}/bin/fpc directly.
     153    "
     154}