From 73141b230f3bbaec8ba120598b0d3c68b63dae5e Mon Sep 17 00:00:00 2001 From: "Jason W. Bacon" Date: Sun, 4 Nov 2018 15:52:42 +0000 Subject: [PATCH] science/voro++: Add shared library Consolidated build changes into patch files. Kept static lib as well as some dependencies may specify it explicitly (this is common in scientific software for better or worse) and the library is very small. PR: 232876 Reported by: yuri Approved by: jrm (mentor, implicit) --- science/voro++/Makefile | 16 ++-- science/voro++/files/patch-Makefile | 101 ++++++++++++++++++++++++ science/voro++/files/patch-config.mk | 27 +++++++ science/voro++/files/patch-src_Makefile | 24 ++++++ science/voro++/pkg-descr | 12 +-- science/voro++/pkg-plist | 1 + 6 files changed, 164 insertions(+), 17 deletions(-) create mode 100644 science/voro++/files/patch-Makefile create mode 100644 science/voro++/files/patch-config.mk create mode 100644 science/voro++/files/patch-src_Makefile diff --git a/science/voro++/Makefile b/science/voro++/Makefile index 1da9e97a4182..c61b5ee19294 100644 --- a/science/voro++/Makefile +++ b/science/voro++/Makefile @@ -1,7 +1,8 @@ # $FreeBSD$ PORTNAME= voro++ -PORTVERSION= 0.4.6 +DISTVERSION= 0.4.6 +PORTREVISION= 1 CATEGORIES= science MASTER_SITES= http://math.lbl.gov/voro++/download/dir/ @@ -12,18 +13,11 @@ LICENSE= BSD3CLAUSE LICENSE_FILE= ${WRKSRC}/LICENSE USES= gmake +USE_LDCONFIG= yes -post-patch: - ${REINPLACE_CMD} \ - -e 's|CXX=|CXX?=|g' \ - -e 's|CFLAGS=|CFLAGS?=|g' \ - -e 's|PREFIX=.*|PREFIX?=|g' \ - ${WRKSRC}/config.mk - ${REINPLACE_CMD} \ - -e 's|$$(PREFIX)|$$(DESTDIR)$$(PREFIX)|g' \ - ${WRKSRC}/Makefile +CFLAGS+= -fPIC post-install: - ${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/voro++ + @${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/voro++ .include diff --git a/science/voro++/files/patch-Makefile b/science/voro++/files/patch-Makefile new file mode 100644 index 000000000000..0a2ea370d078 --- /dev/null +++ b/science/voro++/files/patch-Makefile @@ -0,0 +1,101 @@ +--- Makefile.orig 2013-10-17 17:54:13 UTC ++++ Makefile +@@ -12,7 +12,7 @@ include config.mk + # Build all of the executable files + all: + $(MAKE) -C src +- $(MAKE) -C examples ++ #$(MAKE) -C examples + + # Build the help files (with Doxygen) + help: +@@ -26,47 +26,48 @@ clean: + # Install the executable, man page, and shared library + install: + $(MAKE) -C src +- $(INSTALL) -d $(IFLAGS_EXEC) $(PREFIX)/bin +- $(INSTALL) -d $(IFLAGS_EXEC) $(PREFIX)/lib +- $(INSTALL) -d $(IFLAGS_EXEC) $(PREFIX)/man +- $(INSTALL) -d $(IFLAGS_EXEC) $(PREFIX)/man/man1 +- $(INSTALL) -d $(IFLAGS_EXEC) $(PREFIX)/include +- $(INSTALL) -d $(IFLAGS_EXEC) $(PREFIX)/include/voro++ +- $(INSTALL) $(IFLAGS_EXEC) src/voro++ $(PREFIX)/bin +- $(INSTALL) $(IFLAGS) man/voro++.1 $(PREFIX)/man/man1 +- $(INSTALL) $(IFLAGS) src/libvoro++.a $(PREFIX)/lib +- $(INSTALL) $(IFLAGS) src/voro++.hh $(PREFIX)/include/voro++ +- $(INSTALL) $(IFLAGS) src/c_loops.hh $(PREFIX)/include/voro++ +- $(INSTALL) $(IFLAGS) src/cell.hh $(PREFIX)/include/voro++ +- $(INSTALL) $(IFLAGS) src/common.hh $(PREFIX)/include/voro++ +- $(INSTALL) $(IFLAGS) src/config.hh $(PREFIX)/include/voro++ +- $(INSTALL) $(IFLAGS) src/container.hh $(PREFIX)/include/voro++ +- $(INSTALL) $(IFLAGS) src/container_prd.hh $(PREFIX)/include/voro++ +- $(INSTALL) $(IFLAGS) src/rad_option.hh $(PREFIX)/include/voro++ +- $(INSTALL) $(IFLAGS) src/pre_container.hh $(PREFIX)/include/voro++ +- $(INSTALL) $(IFLAGS) src/unitcell.hh $(PREFIX)/include/voro++ +- $(INSTALL) $(IFLAGS) src/v_base.hh $(PREFIX)/include/voro++ +- $(INSTALL) $(IFLAGS) src/v_compute.hh $(PREFIX)/include/voro++ +- $(INSTALL) $(IFLAGS) src/wall.hh $(PREFIX)/include/voro++ +- $(INSTALL) $(IFLAGS) src/worklist.hh $(PREFIX)/include/voro++ ++ $(INSTALL) -d $(IFLAGS_EXEC) $(DESTDIR)$(PREFIX)/bin ++ $(INSTALL) -d $(IFLAGS_EXEC) $(DESTDIR)$(PREFIX)/lib ++ $(INSTALL) -d $(IFLAGS_EXEC) $(DESTDIR)$(PREFIX)/man ++ $(INSTALL) -d $(IFLAGS_EXEC) $(DESTDIR)$(PREFIX)/man/man1 ++ $(INSTALL) -d $(IFLAGS_EXEC) $(DESTDIR)$(PREFIX)/include ++ $(INSTALL) -d $(IFLAGS_EXEC) $(DESTDIR)$(PREFIX)/include/voro++ ++ $(INSTALL) $(IFLAGS_EXEC) src/voro++ $(DESTDIR)$(PREFIX)/bin ++ $(INSTALL) $(IFLAGS) man/voro++.1 $(DESTDIR)$(PREFIX)/man/man1 ++ $(INSTALL) $(IFLAGS) src/libvoro++.a $(DESTDIR)$(PREFIX)/lib ++ $(INSTALL) $(IFLAGS) src/libvoro++.so $(DESTDIR)$(PREFIX)/lib ++ $(INSTALL) $(IFLAGS) src/voro++.hh $(DESTDIR)$(PREFIX)/include/voro++ ++ $(INSTALL) $(IFLAGS) src/c_loops.hh $(DESTDIR)$(PREFIX)/include/voro++ ++ $(INSTALL) $(IFLAGS) src/cell.hh $(DESTDIR)$(PREFIX)/include/voro++ ++ $(INSTALL) $(IFLAGS) src/common.hh $(DESTDIR)$(PREFIX)/include/voro++ ++ $(INSTALL) $(IFLAGS) src/config.hh $(DESTDIR)$(PREFIX)/include/voro++ ++ $(INSTALL) $(IFLAGS) src/container.hh $(DESTDIR)$(PREFIX)/include/voro++ ++ $(INSTALL) $(IFLAGS) src/container_prd.hh $(DESTDIR)$(PREFIX)/include/voro++ ++ $(INSTALL) $(IFLAGS) src/rad_option.hh $(DESTDIR)$(PREFIX)/include/voro++ ++ $(INSTALL) $(IFLAGS) src/pre_container.hh $(DESTDIR)$(PREFIX)/include/voro++ ++ $(INSTALL) $(IFLAGS) src/unitcell.hh $(DESTDIR)$(PREFIX)/include/voro++ ++ $(INSTALL) $(IFLAGS) src/v_base.hh $(DESTDIR)$(PREFIX)/include/voro++ ++ $(INSTALL) $(IFLAGS) src/v_compute.hh $(DESTDIR)$(PREFIX)/include/voro++ ++ $(INSTALL) $(IFLAGS) src/wall.hh $(DESTDIR)$(PREFIX)/include/voro++ ++ $(INSTALL) $(IFLAGS) src/worklist.hh $(DESTDIR)$(PREFIX)/include/voro++ + + # Uninstall the executable, man page, and shared library + uninstall: +- rm -f $(PREFIX)/bin/voro++ +- rm -f $(PREFIX)/man/man1/voro++.1 +- rm -f $(PREFIX)/lib/libvoro++.a +- rm -f $(PREFIX)/include/voro++/voro++.hh +- rm -f $(PREFIX)/include/voro++/c_loops.hh +- rm -f $(PREFIX)/include/voro++/cell.hh +- rm -f $(PREFIX)/include/voro++/common.hh +- rm -f $(PREFIX)/include/voro++/config.hh +- rm -f $(PREFIX)/include/voro++/container.hh +- rm -f $(PREFIX)/include/voro++/container_prd.hh +- rm -f $(PREFIX)/include/voro++/pre_container.hh +- rm -f $(PREFIX)/include/voro++/rad_option.hh +- rm -f $(PREFIX)/include/voro++/unitcell.hh +- rm -f $(PREFIX)/include/voro++/v_base.hh +- rm -f $(PREFIX)/include/voro++/v_compute.hh +- rm -f $(PREFIX)/include/voro++/wall.hh +- rm -f $(PREFIX)/include/voro++/worklist.hh +- rmdir $(PREFIX)/include/voro++ ++ rm -f $(DESTDIR)$(PREFIX)/bin/voro++ ++ rm -f $(DESTDIR)$(PREFIX)/man/man1/voro++.1 ++ rm -f $(DESTDIR)$(PREFIX)/lib/libvoro++.a ++ rm -f $(DESTDIR)$(PREFIX)/include/voro++/voro++.hh ++ rm -f $(DESTDIR)$(PREFIX)/include/voro++/c_loops.hh ++ rm -f $(DESTDIR)$(PREFIX)/include/voro++/cell.hh ++ rm -f $(DESTDIR)$(PREFIX)/include/voro++/common.hh ++ rm -f $(DESTDIR)$(PREFIX)/include/voro++/config.hh ++ rm -f $(DESTDIR)$(PREFIX)/include/voro++/container.hh ++ rm -f $(DESTDIR)$(PREFIX)/include/voro++/container_prd.hh ++ rm -f $(DESTDIR)$(PREFIX)/include/voro++/pre_container.hh ++ rm -f $(DESTDIR)$(PREFIX)/include/voro++/rad_option.hh ++ rm -f $(DESTDIR)$(PREFIX)/include/voro++/unitcell.hh ++ rm -f $(DESTDIR)$(PREFIX)/include/voro++/v_base.hh ++ rm -f $(DESTDIR)$(PREFIX)/include/voro++/v_compute.hh ++ rm -f $(DESTDIR)$(PREFIX)/include/voro++/wall.hh ++ rm -f $(DESTDIR)$(PREFIX)/include/voro++/worklist.hh ++ rmdir $(DESTDIR)$(PREFIX)/include/voro++ diff --git a/science/voro++/files/patch-config.mk b/science/voro++/files/patch-config.mk new file mode 100644 index 000000000000..04e78f8ecabb --- /dev/null +++ b/science/voro++/files/patch-config.mk @@ -0,0 +1,27 @@ +--- config.mk.orig 2013-10-17 17:54:13 UTC ++++ config.mk +@@ -8,20 +8,20 @@ + # the Makefiles. + + # C++ compiler +-CXX=g++ ++CXX?=g++ + + # Flags for the C++ compiler +-CFLAGS=-Wall -ansi -pedantic -O3 ++CFLAGS?=-Wall -ansi -pedantic -O3 + + # Relative include and library paths for compilation of the examples + E_INC=-I../../src + E_LIB=-L../../src + + # Installation directory +-PREFIX=/usr/local ++PREFIX?=/usr/local + + # Install command +-INSTALL=install ++INSTALL?=install + + # Flags for install command for executable + IFLAGS_EXEC=-m 0755 diff --git a/science/voro++/files/patch-src_Makefile b/science/voro++/files/patch-src_Makefile new file mode 100644 index 000000000000..41a7da0568d5 --- /dev/null +++ b/science/voro++/files/patch-src_Makefile @@ -0,0 +1,24 @@ +--- src/Makefile.orig 2013-10-17 17:54:13 UTC ++++ src/Makefile +@@ -13,7 +13,7 @@ objs=cell.o common.o container.o unitcel + src=$(patsubst %.o,%.cc,$(objs)) + + # Makefile rules +-all: libvoro++.a voro++ ++all: libvoro++.a libvoro++.so voro++ + + depend: + $(CXX) -MM $(src) >Makefile.dep +@@ -24,7 +24,11 @@ libvoro++.a: $(objs) + rm -f libvoro++.a + ar rs libvoro++.a $^ + +-voro++: libvoro++.a cmd_line.cc ++libvoro++.so: $(objs) ++ rm -f libvoro++.so ++ $(CXX) -shared $(LDFLAGS) -o libvoro++.so -Wl,-soname,libvoro++.so $^ ++ ++voro++: libvoro++.so cmd_line.cc + $(CXX) $(CFLAGS) -L. -o voro++ cmd_line.cc -lvoro++ + + %.o: %.cc diff --git a/science/voro++/pkg-descr b/science/voro++/pkg-descr index 85c4e6c242b2..65e2d5c0b3b5 100644 --- a/science/voro++/pkg-descr +++ b/science/voro++/pkg-descr @@ -1,9 +1,9 @@ Voro++ is a software library for carrying out three-dimensional computations -of the Voronoi tessellation. A distinguishing feature of the Voro++ library -is that it carries out cell-based calculations, computing the Voronoi cell -for each particle individually. It is particularly well-suited for -applications that rely on cell-based statistics, where features of Voronoi -cells (eg. volume, centroid, number of faces) can be used to analyze a -system of particles. +of the Voronoi tessellation. A distinguishing feature of the Voro++ library is +that it carries out cell-based calculations, computing the Voronoi cell for +each particle individually. It is particularly well-suited for applications +that rely on cell-based statistics, where features of Voronoi cells (eg. +volume, centroid, number of faces) can be used to analyze a system of +particles. WWW: http://math.lbl.gov/voro++/ diff --git a/science/voro++/pkg-plist b/science/voro++/pkg-plist index 56d9e585b6c1..ba46c2c064c4 100644 --- a/science/voro++/pkg-plist +++ b/science/voro++/pkg-plist @@ -14,4 +14,5 @@ include/voro++/voro++.hh include/voro++/wall.hh include/voro++/worklist.hh lib/libvoro++.a +lib/libvoro++.so man/man1/voro++.1.gz