[117307] trunk/dports/science/ce/Portfile

Ryan Schmidt ryandesign at macports.org
Sun Mar 9 17:58:57 PDT 2014


On Feb 21, 2014, at 15:02, mmoll at macports.org wrote:

> Revision
> 117307
> Author
> mmoll at macports.org
> Date
> 2014-02-21 13:02:58 -0800 (Fri, 21 Feb 2014)
> Log Message
> 
> science/ce: simple build fixes
> Modified Paths
> 
> 	• trunk/dports/science/ce/Portfile

> +post-patch {
> +    reinplace "s|g++|${configure.cxx}|g" ${worksrcpath}/ce/Makefile ${worksrcpath}/pom/Makefile
> +    reinplace "s|main(int argc|int main(int argc|g" ${worksrcpath}/ce/ce.C ${worksrcpath}/pom/ipdb.C
> +    reinplace "s|iostream.h|iostream|g" ${worksrcpath}/pom/calc.C
> +}

It would be better to do this as patchfiles, not just reinplaces. Just using reinplaces like this makes it difficult, years down the road after newer versions of the software have been released, to figure out if the reinplaces are still correct or still needed.

In the case of “g++”, you should patch the file to put “@CXX@” there, then reinplace that to ${configure.cxx}. Because look at the diff: your reinplace is already having at least one unintended consequence:


--- work/ce_distr_2004-07-06-orig/pom/Makefile	2000-05-24 20:11:30.000000000 -0500
+++ work/ce_distr_2004-07-06/pom/Makefile	2014-03-09 19:52:36.000000000 -0500
@@ -23,7 +23,7 @@
 	  calc.h \
 	  linkedid.h
 
-CC = g++
+CC = /usr/bin/clang++
 
 MKOBJS	= $(MKSRCS:.C=.o)
 
@@ -51,4 +51,4 @@
 	$(CO) $<
 
 depend: 
-	makedepend -f Deps_ipdb  -I  /usr/local/apps/gcc/lib/g++-include $(MKSRCS) > Deps_ipdb
+	makedepend -f Deps_ipdb  -I  /usr/local/apps/gcc/lib//usr/bin/clang++-include $(MKSRCS) > Deps_ipdb


By using a patchfile you can ensure that the changes you make are the ones you intend to make, and if in future versions the source changes in such a way that you need to adjust your patch, you’ll be notified by the patch failing to apply, unlike in the case of reinplace, which will just silently not change anything.




More information about the macports-dev mailing list