Monday, July 01, 2019

py-llvmlite: base-clang or ports-clang?

Hi,

the Makefile of py-llvmlite reads as follows:

--8<--
WANTLIB += ${COMPILER_LIBCXX} m

COMPILER = base-clang ports-gcc base-gcc

MODULES = lang/python

FLAVORS = python3
FLAVOR ?=

BUILD_DEPENDS = devel/llvm>=7.0.1
-->8--

The COMPILER line was mechanically added because of ${COMPILER_LIBCXX}.
devel/llvm in BUILD_DEPENDS is not needed: by default base-clang,
/usr/bin/llvm-config and /usr/lib/libLLVM.so.1.0 are used.

The build system also explicitely passes -stdlib=libc++; libc++ is
(officially) available only on CLANG_ARCHS, and using libestdc++ with
ports-clang isn't tested AFAIK.

This lead me to the diff below:
- reorder GH_*/PKGNAME and tweak spacing (reads better to me)
- move to PERMIT_PACKAGE
- properly register libLLVM in WANTLIB
- require base-clang. This officially restricts py-llvmlite and
py-miasm to CLANG_ARCHS.
- drop BUILD_DEPENDS
- explicitely use /usr/bin/llvm-config
- move do-test after BUILD/RUN_DEPENDS tweaks

All tests still pass (3 skipped).

ok?


Index: Makefile
===================================================================
RCS file: /cvs/ports/devel/py-llvmlite/Makefile,v
retrieving revision 1.6
diff -u -p -r1.6 Makefile
--- Makefile 22 Jun 2019 07:07:58 -0000 1.6
+++ Makefile 1 Jul 2019 12:20:46 -0000
@@ -3,12 +3,11 @@
COMMENT = lightweight LLVM-Python binding for writing JIT compilers

MODPY_EGG_VERSION = 0.29.0
-
-PKGNAME = py-${DISTNAME}
-
+REVISION = 0
GH_ACCOUNT = numba
GH_PROJECT = llvmlite
GH_TAGNAME = v${MODPY_EGG_VERSION}
+PKGNAME = py-${DISTNAME}

CATEGORIES = devel

@@ -17,25 +16,24 @@ MAINTAINER = Remi Pointel <rpointel@open
HOMEPAGE = http://llvmlite.pydata.org/

# BSD
-PERMIT_PACKAGE_CDROM = Yes
+PERMIT_PACKAGE = Yes

-WANTLIB += ${COMPILER_LIBCXX} m
-
-COMPILER = base-clang ports-gcc base-gcc
+WANTLIB += ${COMPILER_LIBCXX} LLVM m

+COMPILER = base-clang
MODULES = lang/python

FLAVORS = python3
FLAVOR ?=

-BUILD_DEPENDS = devel/llvm>=7.0.1
-
-do-test:
- cd ${WRKSRC} && PYTHONPATH=. ${SETENV} ${MODPY_BIN} ./runtests.py
-
.if !${FLAVOR:Mpython3}
BUILD_DEPENDS += devel/py-enum34
RUN_DEPENDS += devel/py-enum34
.endif
+
+MAKE_ENV = LLVM_CONFIG="/usr/bin/llvm-config"
+
+do-test:
+ cd ${WRKSRC} && PYTHONPATH=. ${SETENV} ${MODPY_BIN} ./runtests.py

.include <bsd.port.mk>

--
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF DDCC 0DFA 74AE 1524 E7EE

No comments:

Post a Comment