trouble building new libpano portfile

Bradley Giesbrecht brad at pixilla.com
Sat Sep 11 08:18:22 PDT 2010


On Sep 11, 2010, at 5:31 AM, Harry van der Wolf wrote:

> Hi,
>
> libpano13-2.9.17 has just been released.
> I wanted to update the Portfile and need to patch libtool for  
> universal builds as libpano's libtool doesn't work correctly.
>
> I did the following (among many other attempts)
>
> post-configure {
>     if {[variant_isset universal]} {
>         foreach arch ${universal_archs} {
>         reinplace -E {s|-dynamiclib|-dynamiclib -arch ${arch}|g}  $ 
> {worksrcpath}/libtool
>         }
>     } else {
>         reinplace -E {s|-dynamiclib|-dynamiclib -arch ${build_arch}| 
> g}  ${worksrcpath}/libtool
>     }
> }
>
> However, the ${arch} is not substituted but directly copied into the  
> libtool file like "-dynamiclib -arch ${arch} -arch ${arch}"
> I also tried things like "reinplace -E {s|-dynamiclib|-dynamiclib - 
> arch `echo ${arch}`|g}  ${worksrcpath}/libtool"
>
> and some other (futile) attempts.
> I grepped a lot of Portfiles but can't find a good solution.
>
> Please kick me in the right direction.

Replace curly braces with double quotes for reinplace regex.

post-configure {
     if {[variant_isset universal]} {
         foreach arch ${universal_archs} {
           reinplace -E "s|-dynamiclib|-dynamiclib -arch ${arch}|"  $ 
{worksrcpath}/libtool
         }
     } else {
         reinplace -E "s|-dynamiclib|-dynamiclib -arch $ 
{build_arch}|"  ${worksrcpath}/libtool
     }
}

// Brad


More information about the macports-dev mailing list