[86907] trunk/dports/devel

hum at macports.org hum at macports.org
Sun Nov 6 16:28:40 PST 2011


Revision: 86907
          http://trac.macports.org/changeset/86907
Author:   hum at macports.org
Date:     2011-11-06 16:28:40 -0800 (Sun, 06 Nov 2011)
Log Message:
-----------
New port: re2 - an efficient, principled regular expression library.

Added Paths:
-----------
    trunk/dports/devel/re2/
    trunk/dports/devel/re2/Portfile
    trunk/dports/devel/re2/files/
    trunk/dports/devel/re2/files/patch-Makefile.diff

Added: trunk/dports/devel/re2/Portfile
===================================================================
--- trunk/dports/devel/re2/Portfile	                        (rev 0)
+++ trunk/dports/devel/re2/Portfile	2011-11-07 00:28:40 UTC (rev 86907)
@@ -0,0 +1,40 @@
+# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
+# $Id$
+
+PortSystem          1.0
+
+name                re2
+fetch.type          hg
+hg.url              https://code.google.com/p/re2/
+hg.tag              9aa1d4f2954d
+version             20111030-${hg.tag}
+categories          devel textproc
+platforms           darwin
+maintainers         hum openmaintainer
+license             BSD
+
+homepage            http://code.google.com/p/re2/
+description         an efficient, principled regular expression library
+long_description    RE2 is a fast, safe, thread-friendly alternative to \
+                    backtracking regular expression engines like those \
+                    used in PCRE, Perl, and Python. It is a C++ library.
+
+patchfiles          patch-Makefile.diff
+
+post-patch {
+    reinplace "s|/usr/local|${prefix}|g" ${worksrcpath}/Makefile
+}
+
+use_configure       no
+
+variant universal   {}
+
+build.args          CXX="${configure.cxx}" \
+                    CXXFLAGS="${configure.cxxflags} [get_canonical_archflags cxx]"
+
+post-destroot {
+    set libpath ${prefix}/lib/libre2.0.dylib
+    system "install_name_tool -id ${libpath} ${destroot}${libpath}"
+}
+
+livecheck.type      none


Property changes on: trunk/dports/devel/re2/Portfile
___________________________________________________________________
Added: svn:keywords
   + Id
Added: svn:eol-style
   + native

Added: trunk/dports/devel/re2/files/patch-Makefile.diff
===================================================================
--- trunk/dports/devel/re2/files/patch-Makefile.diff	                        (rev 0)
+++ trunk/dports/devel/re2/files/patch-Makefile.diff	2011-11-07 00:28:40 UTC (rev 86907)
@@ -0,0 +1,117 @@
+--- Makefile.orig	2011-11-06 02:30:49.000000000 +0900
++++ Makefile	2011-11-06 02:35:27.000000000 +0900
+@@ -2,7 +2,7 @@
+ # Use of this source code is governed by a BSD-style
+ # license that can be found in the LICENSE file.
+ 
+-all: obj/libre2.a obj/so/libre2.so
++all: obj/libre2.a obj/dylib/libre2.dylib
+ 
+ # to build against PCRE for testing or benchmarking,
+ # uncomment the next two lines
+@@ -31,7 +31,7 @@
+ 
+ # ABI version
+ # http://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html
+-SONAME=0
++DYLIBNAME=0
+ 
+ # To rebuild the Tables generated by Perl and Python scripts (requires Internet
+ # access for Unicode data), uncomment the following line:
+@@ -146,10 +146,10 @@
+ 	obj/test/exhaustive_test\
+ 	obj/test/random_test\
+ 
+-SOFILES=$(patsubst obj/%,obj/so/%,$(OFILES))
+-STESTOFILES=$(patsubst obj/%,obj/so/%,$(TESTOFILES))
+-STESTS=$(patsubst obj/%,obj/so/%,$(TESTS))
+-SBIGTESTS=$(patsubst obj/%,obj/so/%,$(BIGTESTS))
++DYLIBFILES=$(patsubst obj/%,obj/dylib/%,$(OFILES))
++STESTOFILES=$(patsubst obj/%,obj/dylib/%,$(TESTOFILES))
++STESTS=$(patsubst obj/%,obj/dylib/%,$(TESTS))
++SBIGTESTS=$(patsubst obj/%,obj/dylib/%,$(BIGTESTS))
+ 
+ DOFILES=$(patsubst obj/%,obj/dbg/%,$(OFILES))
+ DTESTOFILES=$(patsubst obj/%,obj/dbg/%,$(TESTOFILES))
+@@ -164,7 +164,7 @@
+ 	@mkdir -p $$(dirname $@)
+ 	$(CXX) -o $@ -fPIC $(CPPFLAGS) $(CXXFLAGS) $(RE2_CXXFLAGS) $*.cc
+ 
+-obj/so/%.o: %.cc $(HFILES)
++obj/dylib/%.o: %.cc $(HFILES)
+ 	@mkdir -p $$(dirname $@)
+ 	$(CXX) -o $@ -fPIC $(CPPFLAGS) $(CXXFLAGS) $(RE2_CXXFLAGS) -DNDEBUG $*.cc
+ 
+@@ -176,10 +176,10 @@
+ 	@mkdir -p obj/dbg
+ 	$(AR) $(ARFLAGS) obj/dbg/libre2.a $(DOFILES)
+ 
+-obj/so/libre2.so: $(SOFILES)
+-	@mkdir -p obj/so
+-	$(MAKE_SHARED_LIBRARY) -o $@.$(SONAME) $(SOFILES)
+-	ln -sf libre2.so.$(SONAME) $@
++obj/dylib/libre2.dylib: $(DYLIBFILES)
++	@mkdir -p obj/dylib
++	$(MAKE_SHARED_LIBRARY) -o $@.$(DYLIBNAME) $(DYLIBFILES)
++	ln -sf libre2.dylib.$(DYLIBNAME) $@
+ 
+ obj/test/%: obj/libre2.a obj/re2/testing/%.o $(TESTOFILES) obj/util/test.o
+ 	@mkdir -p obj/test
+@@ -189,9 +189,9 @@
+ 	@mkdir -p obj/dbg/test
+ 	$(CXX) -o $@ obj/dbg/re2/testing/$*.o $(DTESTOFILES) obj/dbg/util/test.o obj/dbg/libre2.a $(LDFLAGS) $(LDPCRE)
+ 
+-obj/so/test/%: obj/so/libre2.so obj/libre2.a obj/so/re2/testing/%.o $(STESTOFILES) obj/so/util/test.o
+-	@mkdir -p obj/so/test
+-	$(CXX) -o $@ obj/so/re2/testing/$*.o $(STESTOFILES) obj/so/util/test.o -Lobj/so -lre2 obj/libre2.a $(LDFLAGS) $(LDPCRE)
++obj/dylib/test/%: obj/dylib/libre2.dylib obj/libre2.a obj/dylib/re2/testing/%.o $(STESTOFILES) obj/dylib/util/test.o
++	@mkdir -p obj/dylib/test
++	$(CXX) -o $@ obj/dylib/re2/testing/$*.o $(STESTOFILES) obj/dylib/util/test.o -Lobj/dylib -lre2 obj/libre2.a $(LDFLAGS) $(LDPCRE)
+ 
+ obj/test/regexp_benchmark: obj/libre2.a obj/re2/testing/regexp_benchmark.o $(TESTOFILES) obj/util/benchmark.o
+ 	@mkdir -p obj/test
+@@ -232,7 +232,7 @@
+ 	@echo
+ 	@echo Running dynamic binary tests.
+ 	@echo
+-	@LD_LIBRARY_PATH=obj/so:$(LD_LIBRARY_PATH) ./runtests $(STESTS)
++	@LD_LIBRARY_PATH=obj/dylib:$(LD_LIBRARY_PATH) ./runtests $(STESTS)
+ 
+ debug-bigtest: $(DTESTS) $(DBIGTESTS)
+ 	@./runtests $(DTESTS) $(DBIGTESTS)
+@@ -241,17 +241,17 @@
+ 	@./runtests $(TESTS) $(BIGTESTS)
+ 
+ shared-bigtest: $(STESTS) $(SBIGTESTS)
+-	@LD_LIBRARY_PATH=obj/so:$(LD_LIBRARY_PATH) ./runtests $(STESTS) $(SBIGTESTS)
++	@LD_LIBRARY_PATH=obj/dylib:$(LD_LIBRARY_PATH) ./runtests $(STESTS) $(SBIGTESTS)
+ 
+ benchmark: obj/test/regexp_benchmark
+ 
+-install: obj/libre2.a obj/so/libre2.so
++install: obj/libre2.a obj/dylib/libre2.dylib
+ 	mkdir -p $(DESTDIR)$(includedir)/re2 $(DESTDIR)$(libdir)
+ 	$(INSTALL_DATA) $(INSTALL_HFILES) $(DESTDIR)$(includedir)/re2
+ 	$(INSTALL) obj/libre2.a $(DESTDIR)$(libdir)/libre2.a
+-	$(INSTALL) obj/so/libre2.so $(DESTDIR)$(libdir)/libre2.so.$(SONAME).0.0
+-	ln -sf libre2.so.$(SONAME).0.0 $(DESTDIR)$(libdir)/libre2.so.$(SONAME)
+-	ln -sf libre2.so.$(SONAME).0.0 $(DESTDIR)$(libdir)/libre2.so
++	$(INSTALL) obj/dylib/libre2.dylib $(DESTDIR)$(libdir)/libre2.$(DYLIBNAME).0.0.dylib
++	ln -sf libre2.$(DYLIBNAME).0.0.dylib $(DESTDIR)$(libdir)/libre2.$(DYLIBNAME).dylib
++	ln -sf libre2.$(DYLIBNAME).0.0.dylib $(DESTDIR)$(libdir)/libre2.dylib
+ 
+ testinstall:
+ 	@mkdir -p obj
+@@ -268,9 +268,9 @@
+ # Keep gmake from deleting intermediate files it creates.
+ # This makes repeated builds faster and preserves debug info on OS X.
+ 
+-.PRECIOUS: obj/%.o obj/dbg/%.o obj/so/%.o obj/libre2.a \
+-	obj/dbg/libre2.a obj/so/libre2.a \
+-	obj/test/% obj/so/test/% obj/dbg/test/%
++.PRECIOUS: obj/%.o obj/dbg/%.o obj/dylib/%.o obj/libre2.a \
++	obj/dbg/libre2.a obj/dylib/libre2.a \
++	obj/test/% obj/dylib/test/% obj/dbg/test/%
+ 
+ log:
+ 	make clean
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20111106/d8076568/attachment.html>


More information about the macports-changes mailing list