sthen 8d2eb0a5d3 math/lrs tweaks, ok edd@, works for maintainer
- don't patch away upstream's INCLUDEDIR/LIBDIR mechanism to replace
it with something using CPPFLAGS/LDFLAGS which does exactly the same;
simplifies the patch

- building the targets chosen for the port requires a compiler with
128-bit int support; afaik this requires clang, or GCC 4.6 or newer,
and a 64-bit arch. So I've set the compiler and restricted archs.
(alternatively we could use "ALL_TARGETS=lrs64" on those archs but that
would mean extra mess with arch-specific PLISTs).

- simplify the test target
2020-11-21 14:13:06 +00:00

50 lines
1.1 KiB
Makefile

# $OpenBSD: Makefile,v 1.8 2020/11/21 14:13:06 sthen Exp $
COMMENT = solve vertex enumeration and convex hull problems
V = 071a
REVISION = 0
DISTNAME = lrslib-${V}
PKGNAME = lrs-${V}
FIX_EXTRACT_PERMISSIONS=Yes
SHARED_LIBS = lrs 0.0 # 1.0
CATEGORIES = math
HOMEPAGE = http://cgm.cs.mcgill.ca/~avis/C/lrs.html
MAINTAINER = Dimitri Karamazov <deserter666@danwin1210.me>
# GPLv2
PERMIT_PACKAGE = Yes
WANTLIB = c gmp
MASTER_SITES = http://cgm.cs.mcgill.ca/~avis/C/lrslib/archive/
USE_GMAKE = Yes
MAKE_FILE = makefile
MAKE_FLAGS = INCLUDEDIR="${LOCALBASE}/include" \
LIBDIR="${LOCALBASE}/lib" \
CFLAGS="${CFLAGS} -Wall" \
SONAME="liblrs.so.${LIBlrs_VERSION:R}" \
SOMINOR=".${LIBlrs_VERSION:E}"
LIB_DEPENDS = devel/gmp
# targets "lrs", "lrsnash", "single", "all-shared" require 128-bit ints
COMPILER = base-clang ports-gcc
COMPILER_LANGS = c
ONLY_FOR_ARCHS = ${LP64_ARCHS}
ALL_TARGET = lrs lrsnash single all-shared
# A simple test to check it works
do-test:
cd ${FILESDIR} && \
cp test.ine expected_outcome.ine openbsd_regress.sh ${WRKBUILD}
cd ${WRKBUILD} && sh openbsd_regress.sh
.include <bsd.port.mk>