Ticket #50290: Portfile_84.diff

File Portfile_84.diff, 3.0 KB (added by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez), 9 years ago)
  • Portfile

    old new  
    33
    44PortSystem 1.0
    55PortGroup select 1.0
     6PortGroup muniversal 1.0
    67
    78name                    postgresql84
    89version                 8.4.22
     
    5657                                --with-ossp-uuid
    5758configure.cppflags-append       -I${prefix}/include/ossp
    5859
    59 if {[variant_isset universal]} {
    60     post-configure {
    61         system "cd ${worksrcpath}/src/include \
    62                 && ed - pg_config.h < ${filespath}/pg_config.h.ed \
    63                 && touch stamp-h"
    64         system "cd ${worksrcpath}/src/interfaces/ecpg/include \
    65                 && ed - ecpg_config.h < ${filespath}/ecpg_config.h.ed \
    66                 && touch stamp-h"
    67     }
    68 }
    69 
    7060build.type              gnu
    7161build.target
    7262
     
    8777# prepare the contrib modules
    8878set contribs {}
    8979
    90 post-build {
     80if { ![variant_isset universal] } {
     81    post-build {
    9182    set contribdirs [glob -nocomplain -type d ${worksrcpath}/contrib/*]
    9283    foreach d [lsort $contribdirs] {
    9384        if { [file exists $d/Makefile] } {
     
    9788        foreach contrib ${contribs} {
    9889                system "cd ${worksrcpath}/contrib/${contrib}/ && ${build.cmd}"
    9990        }
     91    }
     92} else {
     93    post-build {
     94        foreach arch ${universal_archs_to_use} {
     95            set contribdirs [glob -nocomplain -type d ${worksrcpath}-${arch}/contrib/*]
     96            foreach d [lsort $contribdirs] {
     97                if { [file exists $d/Makefile] } {
     98                    lappend contribs [file tail $d]
     99                }
     100            }
     101            foreach contrib ${contribs} {
     102                system "cd ${worksrcpath}-${arch}/contrib/${contrib}/ && ${build.cmd}"
     103            }
     104        }
     105    }
    100106}
    101107
    102 post-destroot {
     108if { ![variant_isset universal] } {
     109    post-destroot {
    103110        foreach contrib ${contribs} {
    104111                system "echo contrib: \"${contrib}\""
    105112                system "cd ${worksrcpath}/contrib/${contrib}/ && \
    106113                        ${destroot.cmd} install ${destroot.destdir} && touch DONE"
    107114        }
     115
     116        reinplace -E "s#-arch\[\[:space:\]\]+\[\[:alnum:\]_\]+##g" \
     117            ${destroot}${prefix}/lib/postgresql84/pgxs/src/Makefile.global
     118    }
     119} else {
     120    merger-post-destroot {
     121        foreach arch ${universal_archs_to_use} {
     122            foreach contrib ${contribs} {
     123                system "echo contrib: \"${contrib}\""
     124                system "cd ${worksrcpath}-${arch}/contrib/${contrib}/ && \
     125                        ${destroot.cmd} install ${destroot.destdir}-${arch} && touch DONE"
     126            }
     127
     128            reinplace -E "s#-arch\[\[:space:\]\]+\[\[:alnum:\]_\]+##g" \
     129                ${destroot}-${arch}${prefix}/lib/postgresql84/pgxs/src/Makefile.global
     130
     131            reinplace "s#${worksrcpath}-${arch}#${worksrcpath}#g" \
     132                ${destroot}-${arch}${prefix}/lib/${name}/pgxs/src/Makefile.global
     133        }
     134    }
     135}
     136
     137post-destroot {
    108138        system "cd ${destroot}${prefix}/bin && ln -sf ${libdir}/bin/psql psql84"
    109139        file delete -force ${destroot}${prefix}/share/doc/postgresql \
    110140                ${destroot}${prefix}/share/man
     
    144174post-install {
    145175        ui_msg "\nTo use the postgresql server, install the postgresql84-server port"
    146176}
    147