Ticket #53096: fpc.diff

File fpc.diff, 8.8 KB (added by RJVB (René Bertin), 7 years ago)
  • lang/fpc/Portfile

    old new  
    11# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
    2 # $Id$
    32
    43PortSystem          1.0
    54
    65name                fpc
    7 version             2.6.4
    8 revision            1
     6version             3.0.0
    97categories          lang
    108platforms           darwin
    119license             GPL-2 LGPL-2
    1210maintainers         takeshi openmaintainer
    13 description         free pascal
    14 long_description    Open source compiler for Pascal and Object Pascal
     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.
    1517homepage            http://www.freepascal.org
    1618master_sites        sourceforge:freepascal
    1719
     
    1921set pp              universal-macosx-10.5-ppcuniversal.tar.bz2
    2022distfiles           ${src} ${pp}
    2123checksums           ${src} \
    22                     rmd160  339b71d3c9983a720eed7c6bda1cfd330d89966f \
    23                     sha256  8d9c3bcfa469d9b37c05663e2775d179809e4b3443604fac7d21aa64c9a56daa \
     24                    rmd160  e921a79d1898b959ee71909d6cd2f036b00477bd \
     25                    sha256  d5913b1d5d3d13190ae7ee72c305d5da49ac2ddc1b375b814751ef09ae5c80ec \
    2426                    ${pp} \
    2527                    rmd160  0124c2f4447ba7f96e3db0a27e6bff459c5749f4 \
    2628                    sha256  e7243e83e6a04de147ebab7530754ec92cd1fbabbc9b6b00a3f90a796312f3e9
    2729
    2830extract.only        ${src}
    29                    
     31
    3032use_configure       no
    3133universal_variant   no
    3234
    33 post-extract {
    34     system -W ${workpath} "bzip2 -dc ${distpath}/${pp} | tar xf -"
    35 }
     35set fpcbasepath     ${prefix}/libexec/${name}
    3636
    37 worksrcdir          ${name}build-${version}/fpcsrc
    38 set fpcbasepath     ${prefix}/lib/${name}
    39 build.env           PP=${workpath}/ppcuniversal \
    40                     PREFIX=${destroot}${fpcbasepath}
    41 build.target        all
    42 
    43 destroot.env        ${build.env}
    44 
    45 # Yosemite fix: fpc's build system checkes MACOSX_DEPLOYMENT_TARGET and halts if > 10.9
    46 platform darwin {
    47     if {${os.major} > 13} {
    48         macosx_deployment_target    10.9
     37subport "chmcmd-${name}" {
     38    description     The FPC Pascal htmlhelp (CHM) compiler
     39    long_description \
     40                    chmcmd is an cross-platform utility to generate compressed HTML (.chm)\
     41                    documentation, written in Free Pascal
     42    installs_libs   no
     43
     44    depends_build-append \
     45                    port:${name}
     46    extract.post_args-append \
     47                    ${name}build-${version}/fpcsrc/packages/chm \
     48                    ${name}build-${version}/fpcsrc/packages/fcl-xml \
     49                    ${name}build-${version}/fpcsrc/packages/fcl-base \
     50                    ${name}build-${version}/fpcsrc/packages/fcl-process \
     51                    ${name}build-${version}/fpcsrc/packages/fpmkunit \
     52                    ${name}build-${version}/fpcsrc/packages/hash \
     53                    ${name}build-${version}/fpcsrc/packages/iconvenc \
     54                    ${name}build-${version}/fpcsrc/packages/libtar \
     55                    ${name}build-${version}/fpcsrc/packages/paszlib \
     56                    ${name}build-${version}/fpcsrc/packages/univint \
     57                    ${name}build-${version}/fpcsrc/rtl
     58    worksrcdir      ${name}build-${version}/fpcsrc/packages/chm
     59    use_configure   yes
     60    configure.cmd   ${fpcbasepath}/bin/fpcmake
     61    configure.pre_args
     62    configure.args  -r -v Makefile.fpc.fpcmake
     63    configure.post_args
     64    build.env       PREFIX=${prefix}
     65    build.target
     66    build.post_args-append \
     67                    V=1 VERBOSE=1
     68    destroot {
     69        xinstall -m 755 ${build.dir}/chmcmd ${destroot}${prefix}/bin
    4970    }
    5071}
    5172
    52 post-destroot {
    53 # create a symlink to the architecture dependent executable
    54     switch ${build_arch} {
    55         "x86_64" {
    56             set b "ppcx64"
    57         }
    58         "i386" {
    59             set b "ppc386"
    60         }
    61         default {
    62             set b "ppcppc"
     73if {${subport} eq "${name}"} {
     74    installs_libs       yes
     75
     76    post-extract {
     77        system -W ${workpath} "bzip2 -dc ${distpath}/${pp} | tar xf -"
     78    }
     79
     80    worksrcdir          ${name}build-${version}/fpcsrc
     81    build.env           PP=${workpath}/ppcuniversal \
     82                        PREFIX=${destroot}${fpcbasepath}
     83    build.target        all
     84
     85    destroot.env        ${build.env}
     86
     87    # Yosemite fix: fpc's build system checkes MACOSX_DEPLOYMENT_TARGET and halts if > 10.9
     88    platform darwin {
     89        if {${os.major} > 13} {
     90            macosx_deployment_target    10.9
    6391        }
    6492    }
    65     ln -s ${fpcbasepath}/lib/${name}/${version}/${b} ${destroot}${fpcbasepath}/bin
    66 # generate a configuration file
    67     xinstall -d ${destroot}${fpcbasepath}/etc
    68     system "
    69         ${destroot}${fpcbasepath}/bin/fpcmkcfg \
    70             -d basepath=${fpcbasepath}/lib/${name}/${version} \
    71             -o ${destroot}${fpcbasepath}/etc/fpc.cfg
    72     "
    73 # install man
    74     xinstall -d ${destroot}${fpcbasepath}/man
    75     foreach d {1 5} {
    76         file copy ${workpath}/${name}build-${version}/install/man/man${d} ${destroot}${fpcbasepath}/man
    77         foreach f [glob ${destroot}${fpcbasepath}/man/man${d}/*.${d}] {
    78             system "/usr/bin/gzip ${f}"
     93
     94    post-destroot {
     95    # create a symlink to the architecture dependent executable
     96        switch ${build_arch} {
     97            "x86_64" {
     98                set b "ppcx64"
     99            }
     100            "i386" {
     101                set b "ppc386"
     102            }
     103            default {
     104                set b "ppcppc"
     105            }
     106        }
     107        ln -s ${fpcbasepath}/lib/${name}/${version}/${b} ${destroot}${fpcbasepath}/bin
     108        # generate a configuration file
     109        xinstall -d ${destroot}${fpcbasepath}/etc
     110        system "
     111            ${destroot}${fpcbasepath}/bin/fpcmkcfg \
     112                -d basepath=${fpcbasepath}/lib/${name}/${version} \
     113                -o ${destroot}${fpcbasepath}/etc/fpc.cfg
     114        "
     115        ln -s ${fpcbasepath}/etc/fpc.cfg ${destroot}${prefix}/etc
     116
     117        # install man
     118        xinstall -d ${destroot}${fpcbasepath}/man
     119        foreach d {1 5} {
     120            file copy ${workpath}/${name}build-${version}/install/man/man${d} ${destroot}${fpcbasepath}/man
     121            foreach f [glob ${destroot}${fpcbasepath}/man/man${d}/*.${d}] {
     122                system "/usr/bin/gzip ${f}"
     123            }
     124        }
     125        ln -s ${fpcbasepath}/man/man1/fpc.1.gz ${destroot}${prefix}/share/man/man1
     126        ln -s ${fpcbasepath}/man/man5/fpc.cfg.5.gz ${destroot}${prefix}/share/man/man5
     127
     128        # chmcmd will be installed by the chmcmd-fpc subport
     129        file delete -force ${destroot}${fpcbasepath}/bin/chmcmd
     130        foreach b [glob -nocomplain ${destroot}${fpcbasepath}/bin/*] {
     131            set n [file tail ${b}]
     132            ln -s ${fpcbasepath}/bin/${n} ${destroot}${prefix}/bin
    79133        }
    80134    }
    81     ln -s ${fpcbasepath}/man/man1/fpc.1.gz ${destroot}${prefix}/share/man/man1
    82     ln -s ${fpcbasepath}/man/man5/fpc.cfg.5.gz ${destroot}${prefix}/share/man/man5
    83 }
    84135
    85 notes "
    86     The compiler fpc looks for the fpc.cfg file in the following places: \n\
    87     - The current directory. \n\
    88     - Home directory, looks for .fpc.cfg \n\
    89     - The directory specified in the environment variable PPC_CONFIG_PATH, \n\
    90       and if it's not set under compilerdir/../etc. \n\
    91     - If it is not yet found: in /etc. \n\
    92     \n\
    93     All the files of fpc are installed in ${fpcbasepath} and \n\
    94     the executables are installed in ${fpcbasepath}/bin. \n\
    95     The fpc.cfg is installed in ${fpcbasepath}/etc to make fpc find fpc.cfg. \n\
    96     To customize, use ~/.fpc.cfg or /etc/fpc.cfg and call ${fpcbasepath}/bin/fpc directly.
    97 "
     136    notes "
     137        The compiler fpc looks for the fpc.cfg file in the following places: \n\
     138        - The current directory. \n\
     139        - Home directory, looks for .fpc.cfg \n\
     140        - The directory specified in the environment variable PPC_CONFIG_PATH, \n\
     141          and if it's not set under compilerdir/../etc. \n\
     142        - If it is not yet found: in /etc. \n\
     143        \n\
     144        All the files of fpc are installed in ${fpcbasepath} and \n\
     145        the executables are installed in ${fpcbasepath}/bin. \n\
     146        The fpc.cfg is installed in ${fpcbasepath}/etc to make fpc find fpc.cfg. \n\
     147        To customize, use ~/.fpc.cfg or /etc/fpc.cfg and call ${fpcbasepath}/bin/fpc directly.
     148    "
     149}