Opened 12 years ago

Closed 12 years ago

#34706 closed defect (fixed)

ncarg: problem with build dependency to triangle

Reported by: petrrr Owned by: tenomoto (Takeshi Enomoto)
Priority: Low Milestone:
Component: ports Version: 2.1.1
Keywords: haspatch Cc: jyrkiwahlstedt
Port: ncarg

Description

The ncarg port has a quite weird dependency to triangle:

The port claims build time dependency to port:triangle whoever it depends on the source/distfile, not sure if it really requires triangle to be installed, but assume not.

pre-configure {
    system "cd ${workpath}/${g2clib_worksrcdir}; make all"
    file copy ${workpath}/${g2clib_worksrcdir}/libgrib2c.a ${worksrcpath}
    system "cd ${worksrcpath}/config; \
        make -f Makefile.ini; \
        ./ymake -config `pwd`"
    system "unzip -o ${prefix}/var/macports/distfiles/triangle/triangle.zip -d /tmp; \
        mv /tmp/triangle.* ${worksrcpath}/ni/src/lib/hlu"
}

The last two rows seem to unzip the distfile and copy it to the work directory. This assumes that the distfile is present. However, this might NOT be the case, if triangle is already present on the system and the distfile was purged, it won't fetch any more and the build fails.

Work-around: A port fetch triangle before the installation of ncarg solves the problem, but I guess there should be a better solution.

Attachments (2)

triangle_Portfile.diff (795 bytes) - added by tenomoto (Takeshi Enomoto) 12 years ago.
ncarg_Portfile.diff (916 bytes) - added by tenomoto (Takeshi Enomoto) 12 years ago.

Download all attachments as: .zip

Change History (5)

comment:1 Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)

Owner: changed from macports-tickets@… to takeshi@…

Agreed, that is weird. Weirder that it unzips to a temporary directory in /tmp. Ports should not write temporary files outside of ${workpath}.

Better solution to the fetch issue is for ncarg to simply list triangle's distfile, just like the triangle port does. Usually in those cases it's best for the two ports to share a dist_subdir, so that users and the mirror servers don't need to download the same file twice. However, just changing, say, ncarg's dist_subdir without changing the version will cause that exact problem too, and there doesn't seem to be a newer stable version of ncarg to which the port could be updated at the same time. Triangle's distfile is pretty small, only 150K, and hasn't changed since 2005, so it's probably fine to have a second copy of it in ncarg's dist_subdir.

Changed 12 years ago by tenomoto (Takeshi Enomoto)

Attachment: triangle_Portfile.diff added

Changed 12 years ago by tenomoto (Takeshi Enomoto)

Attachment: ncarg_Portfile.diff added

comment:2 Changed 12 years ago by tenomoto (Takeshi Enomoto)

Cc: jwa@… added
Keywords: haspatch added

I attached a patch for triangle that installs triangle.c and triangle.h in $[prefix}/share/triangle. If this is allowed, ncarg port may copy these files.

comment:3 Changed 12 years ago by tenomoto (Takeshi Enomoto)

Resolution: fixed
Status: newclosed

Committed in r94346.

Note: See TracTickets for help on using tickets.