math/abacus: unbreak build on 11.0C [1] and fix minor issues

- Builds fine with gcc42 and clang
- Build shared library versioned (for soname in future)
- Fix LICENSE
- Improve style of post-patch target
- Convert to NO_WRKSUBDIR
- Convert to INSTALL_LIB
- Parenthesize commands using `cd`
- Wrap long lines

PR:		199243
Submitted by:	tkato432@yahoo.com
Reported by:	pkg-fallout [1]
This commit is contained in:
Jan Beich 2015-04-29 03:17:52 +00:00
parent a811a9505f
commit 690e66bf69
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=384953
3 changed files with 33 additions and 20 deletions

View file

@ -3,36 +3,40 @@
PORTNAME= abacus
DISTVERSION= 3.2betaU1
PORTREVISION= 4
PORTREVISION= 5
CATEGORIES= math
MASTER_SITES= http://www.informatik.uni-koeln.de/abacus/
MAINTAINER= ports@FreeBSD.org
COMMENT= Branch-And-CUt System
LICENSE= GPLv2
LICENSE= LGPL21 # (or later)
LIB_DEPENDS= libClp.so:${PORTSDIR}/math/coinmp
USE_GCC= yes
NO_WRKSUBDIR= yes
USES= gmake perl5
USE_PERL5= build
USE_LDCONFIG= yes
ALL_TARGET= abacus
WRKSRC= ${WRKDIR}
post-patch:
${REINPLACE_CMD} -e '\
s|%%LOCALBASE%%|${LOCALBASE}|g; \
s|%%CXX%%|${CXX}|g; \
s|%%PERL5%%|${PERL5}|g' \
@${REINPLACE_CMD} \
-e 's|%%LOCALBASE%%|${LOCALBASE}|' \
-e 's|%%CXX%%|${CXX}|' \
-e 's|%%PERL5%%|${PERL5}|' \
-e 's|%%CXXFLAGS%%|${CXXFLAGS}|' \
${WRKSRC}/Makefile
do-install:
${INSTALL_DATA} ${WRKSRC}/lib/linux20-gcc44/libabacus-osi.a ${STAGEDIR}${PREFIX}/lib/libabacus-osi.a
${INSTALL_PROGRAM} ${WRKSRC}/lib/linux20-gcc44/libabacus-osi.so ${STAGEDIR}${PREFIX}/lib/libabacus-osi.so.1
${LN} -sf libabacus-osi.so.1 ${STAGEDIR}${PREFIX}/lib/libabacus-osi.so
cd ${WRKSRC}/Include && ${COPYTREE_SHARE} abacus ${STAGEDIR}${PREFIX}/include
${INSTALL_DATA} ${WRKSRC}/lib/linux20-gcc44/libabacus-osi.a \
${STAGEDIR}${PREFIX}/lib
${INSTALL_LIB} ${WRKSRC}/lib/linux20-gcc44/libabacus-osi.so.1 \
${STAGEDIR}${PREFIX}/lib
${LN} -sf libabacus-osi.so.1 \
${STAGEDIR}${PREFIX}/lib/libabacus-osi.so
(cd ${WRKSRC}/Include && ${COPYTREE_SHARE} abacus \
${STAGEDIR}${PREFIX}/include)
.include <bsd.port.mk>

View file

@ -31,6 +31,15 @@
# Gnu cp
GCP = /bin/cp
@@ -59,7 +59,7 @@
CPLEXFLAGS = -DCPX_PROTOTYPE_ANSI -DPROTOTYPE_MAX
CCFLAG_SYS = -DABACUS_SYS_LINUX -DABACUS_THROW_WITH_INFO
CCFLAG_COMPILER = -DABACUS_COMPILER_GCC43 -Wall
-CCFLAG_DEBOPT = -O2
+CCFLAG_DEBOPT = %%CXXFLAGS%%
CCFLAG_PARALLEL =
# default parallel flags (to be defined in machine specific makefile).
@@ -141,7 +141,8 @@
DEPEND = $(OBJDIR)/Makefile.dep
@ -47,14 +56,14 @@
# The basic ABACUS library
-abacus-base: $(LIBDIR)/stuff/abacus-base.a
+abacus-base-static: $(LIBDIR)/stuff/abacus-base.a
+abacus-base-shared: $(LIBDIR)/stuff/abacus-base.so
+abacus-base-shared: $(LIBDIR)/stuff/abacus-base.so.1
$(LIBDIR)/stuff/abacus-base.a: $(ABACUS_O)
rm -f $@
@$(PRE_ARCHIVE) $(ABACUS_O)
$(ARCHIVE) $@ $(ABACUS_O)
+$(LIBDIR)/stuff/abacus-base.so: $(ABACUS_O)
+$(LIBDIR)/stuff/abacus-base.so.1: $(ABACUS_O)
+ rm -f $@
+ $(CXX) -shared -o $@ $(ABACUS_O)
+
@ -68,7 +77,7 @@
abacus: lib-all
cp $(LIBDIR)/stuff/abacus-base.a $(LIBDIR)/libabacus-osi.a
+ cp $(LIBDIR)/stuff/abacus-base.so $(LIBDIR)/libabacus-osi.so
+ cp $(LIBDIR)/stuff/abacus-base.so.1 $(LIBDIR)/libabacus-osi.so.1
mkdir $(LIBDIR)/temp
cd $(LIBDIR)/temp; ar x ../stuff/interface-osi.a
find $(LIBDIR)/temp -name \*.o | xargs -n1 ar r $(LIBDIR)/libabacus-osi.a

View file

@ -1,6 +1,3 @@
lib/libabacus-osi.a
lib/libabacus-osi.so
lib/libabacus-osi.so.1
include/abacus/abacusroot.h
include/abacus/active.h
include/abacus/active.inc
@ -102,3 +99,6 @@ include/abacus/timer.h
include/abacus/valbranchrule.h
include/abacus/variable.h
include/abacus/vartype.h
lib/libabacus-osi.a
lib/libabacus-osi.so
lib/libabacus-osi.so.1