[61964] trunk/dports/science

Ryan Schmidt ryandesign at macports.org
Sat Dec 26 13:10:05 PST 2009


On Dec 26, 2009, at 02:57, takeshi at macports.org wrote:

> Revision: 61964
>          http://trac.macports.org/changeset/61964
> Author:   takeshi at macports.org
> Date:     2009-12-26 00:57:30 -0800 (Sat, 26 Dec 2009)
> Log Message:
> -----------
> magicspp: adding magicspp

> Added: trunk/dports/science/magicspp/Portfile

> +set submatch ""
> +set flib ""
> +regexp {\+([[:alnum:]]+) \(active\)} [exec port installed emos] match submatch
> +if {${submatch}=="gcc43"} {
> +    set flib "-L${prefix}/lib/gcc43 -lgfortran"
> +    configure.compiler      macports-gcc-4.3
> +} elseif {${submatch}=="g95"} {
> +    set flib -lf95
> +    configure.f77           ${prefix}/bin/g95
> +}
> +configure.env-append        LIBS=\"-lgrib_api -lopenjpeg -lpng\"
> +configure.ldflags-append    "-lgrib_api -lopenjpeg -lpng -lemosR64 $flib -lnetcdf_c++ -lnetcdf"
> +configure.cppflags-append   -I${prefix}/include/freetype2/

You can't do this; calling "port installed emos" is causing the portindex to fail, because on the portindex machine, emos is not installed. Therefore:

> Revision: 61966
>          http://trac.macports.org/changeset/61966
> Author:   portindex at macports.org
> Date:     2009-12-26 01:54:57 -0800 (Sat, 26 Dec 2009)
> Log Message:
> -----------
> 
> Total number of ports parsed:	6457 
> Ports successfully parsed:	6456	 
> Ports failed:			1
> 
> 
> Failed to parse file science/magicspp/Portfile: None of the specified ports are installed.


You could do your checks in a pre-configure phase. But it would be better to ditch this whole method and instead provide normal gcc43 and g95 variants, like other ports including emos do. (You should probably also abstract it so you can easily add a gcc44 variant, and later a gcc45 variant when that version is final.) Then within each variant, put code to ensure dependencies like emos have been installed with the same variant. Using "port installed emos" to determine that is not recommended. Instead, use the existence of or contents of a file emos installs to guide this decision. For many programs, the -config script or .pc file might tell you, but emos doesn't seem to provide either of those. If it's not possible to determine from the existence of or contents of an existing emos file what variant it was installed with, modify the emos port to install a file which will tell you, then use that file in magicspp.




More information about the macports-dev mailing list