[82168] trunk/dports/graphics
Ryan Schmidt
ryandesign at macports.org
Tue Aug 9 14:59:31 PDT 2011
On Aug 9, 2011, at 12:16, blair at macports.org wrote:
> Revision: 82168
> http://trac.macports.org/changeset/82168
> Author: blair at macports.org
> Date: 2011-08-09 10:16:30 -0700 (Tue, 09 Aug 2011)
> Log Message:
> -----------
> field3d: new port.
> +homepage https://sites.google.com/site/field3d/home
> +master_sites https://github.com/imageworks/Field3D/tarball/v${version}
> +extract.mkdir yes
> +extract.post_args "| tar --strip-components=1 -xf -"
This works... The idea is to fix github's unpredictably-named directories. But I've been doing it this way:
post-extract {
move [glob ${workpath}/*] ${worksrcpath}
}
I think this is better because it doesn't introduce knowledge into the portfile about the specifics of how the extract phase works. There are some problems with the way the extract phase is currently implemented (e.g. no notification if the decompression program failed), and we may want to change how it works later, so it would probably be better if ports did not assume the extract phase will always be a compression program piped to tar.
> +post-patch {
> + reinplace "s#@PREFIX@#$prefix#g" ${worksrcpath}/BuildSupport.py
> + reinplace "s#@CC@#${configure.cc}#" ${worksrcpath}/SConstruct
> + reinplace "s#@CXX@#${configure.cxx}#" ${worksrcpath}/SConstruct
> +}
These reinplaces are good for ensuring we're UsingTheRightCompiler... but what about the right build_arch? May need to do something with ${configure.cc_archflags} too (or [get_canonical_archflags], if universal works).
> +destroot {
> + set sharedir ${destroot}${prefix}/share
> + set docdir ${sharedir}/doc/${name}
> +
> + set releasedir ${worksrcpath}/install/darwin/m32/release
> +
> + foreach f {include/Field3D lib/libField3D.a lib/libField3D.dylib} {
> + file copy ${releasedir}/${f} ${destroot}${prefix}/${f}
> + }
> +
> + xinstall -m 755 -d ${docdir}
> + foreach f {CHANGES COPYING README} {
> + file copy ${worksrcpath}/$f ${docdir}
> + }
> +}
You don't need foreach loops to copy these files:
copy ${releasedir}/include/Field3D ${destroot}${prefix}/include
xinstall -m 644 -W ${releasedir}/lib libField3D.a libField3D.dylib ${destroot}${prefix}/lib
xinstall -m 644 -W ${worksrcpath} CHANGES COPYING README ${docdir}
More information about the macports-dev
mailing list