[55009] trunk/dports/devel

Ryan Schmidt ryandesign at macports.org
Wed Aug 5 20:24:00 PDT 2009


On Aug 5, 2009, at 21:46, snc at macports.org wrote:

> Revision: 55009
>           http://trac.macports.org/changeset/55009
> Author:   snc at macports.org
> Date:     2009-08-05 19:46:39 -0700 (Wed, 05 Aug 2009)
> Log Message:
> -----------
> created libftd2xx, ticket #20565


> +destroot {
> +    xinstall -o root -g wheel -d ${destroot}${prefix}/lib
> +    xinstall -o root -g wheel ${worksrcpath}/D2XX/bin/${name}.$ 
> {version}.dylib ${destroot}${prefix}/lib
> +    xinstall -o root -g wheel -d ${destroot}${prefix}/include
> +    xinstall -o root -g wheel ${worksrcpath}/D2XX/bin/ftd2xx.h $ 
> {destroot}${prefix}/include
> +    xinstall -o root -g wheel ${worksrcpath}/D2XX/Samples/ 
> WinTypes.h ${destroot}${prefix}/include
> +}

There isn't any reason to specify the user and group; just omit them  
and let MacPorts use the current user and group.

You don't need to create the directories ${destroot}${prefix}/lib or $ 
{destroot}${prefix}/include; MacPorts does this for you.

You can combine the two xinstalls that install to the include  
directory. I think you probably also want to add -m 644 to this,  
otherwise I think the default is for the files to get 755  
permissions, which is not appropriate for header files.


> +post-destroot {
> +    system "ln -sf ${name}.${version}.dylib ${destroot}${prefix}/ 
> lib/${name}.dylib"

You shouldn't use "system" just to make a symlink. MacPorts has an  
"ln" procedure you can use for this.

You don't need the -f flag because there's nothing that needs to be  
forced, no existing file in the destroot that needs to be overwritten.


> +    system "install_name_tool -id ${prefix}/lib/${name}.$ 
> {version}.dylib ${destroot}${prefix}/lib/${name}.${version}.dylib"
> +}

You can combine the post-destroot stuff into the destroot. So the  
final destroot would look like:


destroot {
     xinstall ${worksrcpath}/D2XX/bin/${name}.${version}.dylib $ 
{destroot}${prefix}/lib
     xinstall -m 644 -W ${worksrcpath}/D2XX bin/ftd2xx.h Samples/ 
WinTypes.h ${destroot}${prefix}/include
     ln -s ${name}.${version}.dylib ${destroot}${prefix}/lib/$ 
{name}.dylib
     system "install_name_tool -id ${prefix}/lib/${name}.$ 
{version}.dylib ${destroot}${prefix}/lib/${name}.${version}.dylib"
}




More information about the macports-dev mailing list