[87954] trunk/dports/devel/unittest-cpp

ryandesign at macports.org ryandesign at macports.org
Tue Dec 13 20:29:58 PST 2011


Revision: 87954
          http://trac.macports.org/changeset/87954
Author:   ryandesign at macports.org
Date:     2011-12-13 20:29:57 -0800 (Tue, 13 Dec 2011)
Log Message:
-----------
unittest-cpp: use muniversal portgroup instead of doing it manually; allow builds for non-default build_arch; ensure we're UsingTheRightCompiler; change case of header directory to match patch in upstream issue tracker

Modified Paths:
--------------
    trunk/dports/devel/unittest-cpp/Portfile

Added Paths:
-----------
    trunk/dports/devel/unittest-cpp/files/
    trunk/dports/devel/unittest-cpp/files/patch-Makefile.diff

Modified: trunk/dports/devel/unittest-cpp/Portfile
===================================================================
--- trunk/dports/devel/unittest-cpp/Portfile	2011-12-14 04:27:29 UTC (rev 87953)
+++ trunk/dports/devel/unittest-cpp/Portfile	2011-12-14 04:29:57 UTC (rev 87954)
@@ -1,9 +1,11 @@
 # $Id$
 
 PortSystem 1.0
+PortGroup               muniversal 1.0
 
 name                    unittest-cpp
 version                 1.4
+revision                1
 categories              devel
 platforms               darwin
 maintainers             uni-koblenz.de:guidolorenz \
@@ -24,35 +26,20 @@
 use_zip                 yes
 worksrcdir              UnitTest++
 
+post-extract {
+    # DOS to UNIX line endings so we can patch properly.
+    reinplace "s|\r||g" ${worksrcpath}/Makefile
+}
+
+patchfiles              patch-Makefile.diff
+
 use_configure           no
 
-destroot {
-    xinstall -m 755 -d ${destroot}${prefix}/include/unittest++/Posix
-    eval xinstall -m 640 [glob ${worksrcpath}/src/*.h] \
-        ${destroot}${prefix}/include/unittest++
-    eval xinstall -m 640 [glob ${worksrcpath}/src/Posix/*.h] \
-        ${destroot}${prefix}/include/unittest++/Posix
-    xinstall -m 640 ${worksrcpath}/libUnitTest++.a \
-        ${destroot}${prefix}/lib
+foreach arch ${configure.universal_archs} {
+    lappend merger_build_args(${arch})  CXX='${configure.cxx} -arch ${arch}'
 }
-
-variant universal {
-    build {
-        # Build and test the library for the native architecture,
-        # just to check if everything is fine.
-        system "cd ${worksrcpath} && ${build.cmd} TestUnitTest++"
-        system "cd ${worksrcpath} && ${build.cmd} clean"
-        
-        # Now build the library for all universal architectures.
-        set lipo_args {}
-        foreach arch ${universal_archs} {
-            system "cd ${worksrcpath} && ${build.cmd} libUnitTest++.a CXXFLAGS='-arch ${arch}' LDFLAGS='-arch ${arch}'"
-            move ${worksrcpath}/libUnitTest++.a ${worksrcpath}/libUnitTest++.a.${arch}
-            system "cd ${worksrcpath} && ${build.cmd} clean"
-            lappend lipo_args -arch ${arch} ${worksrcpath}/libUnitTest++.a.${arch}
-        }
-        
-        # Roll a universal binary.
-        system "lipo ${lipo_args} -create -output ${worksrcpath}/libUnitTest++.a"
-    }
+if {![variant_isset universal]} {
+    build.args-append   CXX='${configure.cxx} [get_canonical_archflags cxx]'
 }
+
+destroot.args           prefix=${prefix}

Added: trunk/dports/devel/unittest-cpp/files/patch-Makefile.diff
===================================================================
--- trunk/dports/devel/unittest-cpp/files/patch-Makefile.diff	                        (rev 0)
+++ trunk/dports/devel/unittest-cpp/files/patch-Makefile.diff	2011-12-14 04:29:57 UTC (rev 87954)
@@ -0,0 +1,49 @@
+Based on http://sourceforge.net/tracker/?func=detail&aid=1593036&group_id=158151&atid=806686
+--- Makefile.orig	2008-10-29 15:38:08.000000000 -0500
++++ Makefile	2011-12-13 21:26:52.000000000 -0600
+@@ -4,12 +4,23 @@
+ SED = sed
+ MV = mv
+ RM = rm
++INSTALL = install
++MKDIR = mkdir
++MKDIRP = $(MKDIR) -p
+ 
+ .SUFFIXES: .o .cpp
+ 
+ lib = libUnitTest++.a
+ test = TestUnitTest++
+ 
++prefix = /usr/local
++libdir = $(prefix)/lib
++includedir = $(prefix)/include/UnitTest++
++DESTDIR =
++
++includes = $(wildcard src/*.h)
++posix_includes = $(wildcard src/Posix/*.h)
++
+ src = src/AssertException.cpp \
+ 	src/Test.cpp \
+ 	src/Checks.cpp \
+@@ -67,6 +78,7 @@
+   $(MV) $3.tmp $3
+ endef
+ 
++.PHONY: all clean install
+ 
+ all: $(test)
+ 
+@@ -81,6 +93,13 @@
+ 	@echo Running unit tests...
+ 	@./$(test)
+ 
++install: all
++	@echo Installing UnitTest++ to $(DESTDIR)$(prefix)
++	@$(MKDIRP) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir)/Posix
++	@$(INSTALL) -m644 -p $(includes) $(DESTDIR)$(includedir)
++	@$(INSTALL) -m644 -p $(posix_includes) $(DESTDIR)$(includedir)/Posix
++	@$(INSTALL) -m644 -p $(lib) $(DESTDIR)$(libdir)
++
+ clean:
+ 	-@$(RM) $(objects) $(test_objects) $(dependencies) $(test_dependencies) $(test) $(lib) 2> /dev/null
+ 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20111213/ea8d62a3/attachment.html>


More information about the macports-changes mailing list