Ticket #50290: Portfile_94.diff

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

    old new  
    44PortSystem 1.0
    55PortGroup select 1.0
    66PortGroup compiler_blacklist_versions 1.0
     7PortGroup muniversal 1.0
    78
    89#remember to update the -doc and -server as well
    910name                    postgresql94
     
    6263compiler.blacklist-append {clang < 421}
    6364notes "To use the postgresql server, install the ${name}-server port"
    6465
    65 if {[variant_isset universal]} {
    66     configure.cflags-append     -DAC_APPLE_UNIVERSAL_BUILD
    67     post-configure {
    68         system "cd ${worksrcpath}/src/include \
    69                 && ed - pg_config.h < ${filespath}/pg_config.h.ed \
    70                 && touch stamp-h"
    71         system "cd ${worksrcpath}/src/interfaces/ecpg/include \
    72                 && ed - ecpg_config.h < ${filespath}/ecpg_config.h.ed \
    73                 && touch stamp-h"
    74     }
    75 }
    76 
    7766build.type              gnu
    7867build.target
    7968
     
    8978# prepare the contrib modules
    9079set contribs {}
    9180
    92 post-build {
    93 # remove a Linux-specific contrib before continuing
     81if { ![variant_isset universal] } {
     82    post-build {
     83        # remove a Linux-specific contrib before continuing
    9484    file delete -force ${worksrcpath}/contrib/sepgsql
    9585    set contribdirs [glob -nocomplain -type d ${worksrcpath}/contrib/*]
    9686    foreach d [lsort $contribdirs] {
     
    10191        foreach contrib ${contribs} {
    10292                system "cd ${worksrcpath}/contrib/${contrib}/ && ${build.cmd}"
    10393        }
     94    }
     95} else {
     96    post-build {
     97        foreach arch ${universal_archs_to_use} {
     98            # remove a Linux-specific contrib before continuing
     99            file delete -force ${worksrcpath}-${arch}/contrib/sepgsql
     100            set contribdirs [glob -nocomplain -type d ${worksrcpath}-${arch}/contrib/*]
     101            foreach d [lsort $contribdirs] {
     102                if { [file exists $d/Makefile] } {
     103                    lappend contribs [file tail $d]
     104                }
     105            }
     106            foreach contrib ${contribs} {
     107                system "cd ${worksrcpath}-${arch}/contrib/${contrib}/ && ${build.cmd}"
     108            }
     109        }
     110    }
    104111}
    105112
    106 post-destroot {
     113if { ![variant_isset universal] } {
     114    post-destroot {
    107115        foreach contrib ${contribs} {
    108116                system "echo contrib: \"${contrib}\""
    109117                system "cd ${worksrcpath}/contrib/${contrib}/ && \
    110118                        ${destroot.cmd} install ${destroot.destdir} && touch DONE"
    111119        }
    112         system "cd ${destroot}${prefix}/bin && ln -sf ${libdir}/bin/psql psql94"
    113         file delete -force ${destroot}${prefix}/share/doc/postgresql \
    114                 ${destroot}${prefix}/share/man
    115120               
    116121        reinplace -E "s#-arch\[\[:space:\]\]+\[\[:alnum:\]_\]+##g" \
    117122            ${destroot}${prefix}/lib/postgresql94/pgxs/src/Makefile.global
     123    }
     124} else {
     125    merger-post-destroot {
     126        foreach arch ${universal_archs_to_use} {
     127            foreach contrib ${contribs} {
     128                system "echo contrib: \"${contrib}\""
     129                system "cd ${worksrcpath}-${arch}/contrib/${contrib}/ && \
     130                        ${destroot.cmd} install ${destroot.destdir}-${arch} && touch DONE"
     131            }
     132
     133            reinplace -E "s#-arch\[\[:space:\]\]+\[\[:alnum:\]_\]+##g" \
     134                ${destroot}-${arch}${prefix}/lib/postgresql94/pgxs/src/Makefile.global
     135
     136            reinplace "s#${worksrcpath}-${arch}#${worksrcpath}#g" \
     137                ${destroot}-${arch}${prefix}/lib/${name}/pgxs/src/Makefile.global
     138        }
     139    }
     140}
     141
     142post-destroot {
     143        system "cd ${destroot}${prefix}/bin && ln -sf ${libdir}/bin/psql psql94"
     144        file delete -force ${destroot}${prefix}/share/doc/postgresql \
     145                ${destroot}${prefix}/share/man
    118146       
    119147        reinplace -E "s#^CFLAGS =#CFLAGS +=#g" \
    120148            ${destroot}${prefix}/lib/postgresql94/pgxs/src/Makefile.global