Ticket #55303: Portfile.diff

File Portfile.diff, 4.3 KB (added by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez), 6 years ago)
  • Portfile

    old new  
    33PortSystem 1.0
    44PortGroup select 1.0
    55PortGroup compiler_blacklist_versions 1.0
     6PortGroup muniversal 1.0
    67
    78#remember to update the -doc and -server as well
    89name                postgresql96
     
    2930
    3031use_bzip2           yes
    3132
     33# do not build man or html files (use postgresqlXY-doc instead)
     34patchfiles-append   patch-no_doc.diff
     35
    3236depends_lib         port:readline path:lib/libssl.dylib:openssl port:zlib port:libxml2 port:libxslt
    3337depends_build       port:bison
    3438depends_run         port:postgresql_select
     
    4145                    --libdir=${libdir} \
    4246                    --includedir=${prefix}/include/${name} \
    4347                    --datadir=${prefix}/share/${name} \
     48                    --docdir=${prefix}/share/doc/${name} \
    4449                    --mandir=${prefix}/share/man \
    4550                    --with-includes=${prefix}/include \
    4651                    --with-libraries=${prefix}/lib \
     
    6368
    6469if {[variant_isset universal]} {
    6570    configure.cflags-append    -DAC_APPLE_UNIVERSAL_BUILD
    66     post-configure {
    67         system "cd ${worksrcpath}/src/include \
    68                 && ed - pg_config.h < ${filespath}/pg95_config.h.ed \
    69                 && touch stamp-h"
    70         system "cd ${worksrcpath}/src/interfaces/ecpg/include \
    71                 && ed - ecpg_config.h < ${filespath}/ecpg_config.h.ed \
    72                 && touch stamp-h"
    73     }
    7471}
    7572
    7673build.type          gnu
    77 build.target
     74build.target        world
    7875
    7976test.run            yes
    8077test.target         check
    8178
     79destroot.target     install-world
     80
    8281# remember to change livecheck with first proper release
    8382livecheck.type      regex
    8483#livecheck.regex     (9\\.6\[.0-9\]*\[a-z\]+\[0-9\])
    8584livecheck.regex    (9\\.6\\.\[.0-9\]+)
    8685livecheck.url       ${homepage}/ftp/source/
    8786
    88 # prepare the contrib modules
    89 set contribs {}
    90 
    91 post-build {
    92 # remove a Linux-specific contrib before continuing
    93     file delete -force ${worksrcpath}/contrib/sepgsql
    94 # remove perl-specific contrib, if no perl variant
    95     if {![variant_isset perl]} {
    96         file delete -force ${worksrcpath}/contrib/hstore_plperl
    97     }
    98 # remove python-specific contrib, if no python27 variant
    99     if {![variant_isset python27]} {
    100         file delete -force ${worksrcpath}/contrib/hstore_plpython
    101         file delete -force ${worksrcpath}/contrib/ltree_plpython
    102     }
    103     set contribdirs [glob -nocomplain -type d ${worksrcpath}/contrib/*]
    104     foreach d [lsort $contribdirs] {
    105         if { [file exists $d/Makefile] } {
    106             lappend contribs [file tail $d]
    107         }
    108     }
    109     foreach contrib ${contribs} {
    110         system "cd ${worksrcpath}/contrib/${contrib}/ && ${build.cmd}"
    111     }
    112 }
    113 
    11487post-destroot {
    115     foreach contrib ${contribs} {
    116         system "echo contrib: \"${contrib}\""
    117         system "cd ${worksrcpath}/contrib/${contrib}/ && \
    118             ${destroot.cmd} install ${destroot.destdir} && touch DONE"
    119     }
    120     system "cd ${destroot}${prefix}/bin && ln -sf ${libdir}/bin/psql psql96"
    121     file delete -force ${destroot}${prefix}/share/doc/postgresql \
    122         ${destroot}${prefix}/share/man
    123        
    124     reinplace -E "s#-arch\[\[:space:\]\]+\[\[:alnum:\]_\]+##g" \
    125         ${destroot}${prefix}/lib/${name}/pgxs/src/Makefile.global
     88    ln -sf ${libdir}/bin/psql ${destroot}${prefix}/bin/psql96
    12689   
    12790    reinplace -E "s#^CFLAGS =#CFLAGS +=#g" \
    12891        ${destroot}${prefix}/lib/${name}/pgxs/src/Makefile.global
     
    13194        ${destroot}${prefix}/lib/${name}/pgxs/src/Makefile.global
    13295}
    13396
     97if {![variant_isset universal]} {
     98    post-destroot {
     99        reinplace -E "s#-arch\[\[:space:\]\]+\[\[:alnum:\]_\]+##g" \
     100            ${destroot}${prefix}/lib/${name}/pgxs/src/Makefile.global
     101    }
     102} else {
     103    merger-post-destroot {
     104        foreach arch ${configure.universal_archs} {
     105            reinplace -E "s#-arch\[\[:space:\]\]+\[\[:alnum:\]_\]+##g" \
     106                ${destroot}-${arch}${prefix}/lib/${name}/pgxs/src/Makefile.global
     107
     108            reinplace -E "s#${worksrcpath}-${arch}#${worksrcpath}#g" \
     109                ${destroot}-${arch}${prefix}/lib/${name}/pgxs/src/Makefile.global
     110        }
     111    }
     112}
     113
    134114select.group        postgresql
    135115select.file         ${filespath}/${name}
    136116