Monday, September 05, 2022

[update] and unbreak devel/py-llvmlite to 0.39.0

Hi,
I've attached an update to devel/py-llvmlite to 0.39.0, which removes the BROKEN tag.

The reverse dependency py-miasm needs to be updated but I don't use it, I'll try to do it in the weekend.

Best,
Aisha

diff --git a/devel/py-llvmlite/Makefile b/devel/py-llvmlite/Makefile
index 79f7a816a13..d6eb26e1ae3 100644
--- a/devel/py-llvmlite/Makefile
+++ b/devel/py-llvmlite/Makefile
@@ -1,8 +1,6 @@
-BROKEN = requires update to 0.34.0 for LLVM 10
COMMENT = lightweight LLVM-Python binding for writing JIT compilers

-MODPY_EGG_VERSION = 0.29.0
-REVISION = 2
+MODPY_EGG_VERSION = 0.39.0
GH_ACCOUNT = numba
GH_PROJECT = llvmlite
GH_TAGNAME = v${MODPY_EGG_VERSION}
@@ -17,20 +15,22 @@ HOMEPAGE = http://llvmlite.pydata.org/
# BSD
PERMIT_PACKAGE = Yes

-WANTLIB += ${COMPILER_LIBCXX} LLVM m
+WANTLIB += ${COMPILER_LIBCXX} LLVM m

COMPILER = base-clang
MODULES = lang/python

FLAVORS = python3
-FLAVOR ?=
+FLAVOR ?= python3

-.if !${FLAVOR:Mpython3}
-BUILD_DEPENDS += devel/py-enum34
-RUN_DEPENDS += devel/py-enum34
-.endif
+MAKE_ENV += LLVM_CONFIG="/usr/bin/llvm-config" \
+ LDLIBS="`llvm-config --libs all`" \
+ CXXFLAGS="`llvm-config --cxxflags` -fPIC ${CFLAGS}" \
+ LDFLAGS="`llvm-config --ldflags` ${LDFLAGS}"

-MAKE_ENV = LLVM_CONFIG="/usr/bin/llvm-config"
+pre-build:
+ cd ${WRKSRC} && \
+ ${CXX} -shared `llvm-config --cxxflags` -fPIC ${CXXFLAGS} `llvm-config --ldflags` ${LDFLAGS} -o ffi/libllvmlite.so ffi/*.cpp `llvm-config --libs all`

do-test:
cd ${WRKSRC} && PYTHONPATH=. ${SETENV} ${MODPY_BIN} ./runtests.py
diff --git a/devel/py-llvmlite/distinfo b/devel/py-llvmlite/distinfo
index 464df2c98f1..73fb12458e4 100644
--- a/devel/py-llvmlite/distinfo
+++ b/devel/py-llvmlite/distinfo
@@ -1,2 +1,2 @@
-SHA256 (llvmlite-0.29.0.tar.gz) = vO54HC3Ga+09tbqF9cBMTv/TjHwQ9Sh+6+qBy029zjQ=
-SIZE (llvmlite-0.29.0.tar.gz) = 196507
+SHA256 (llvmlite-0.39.0.tar.gz) = mfzpfagc/XjrfbEjRTnhmnPH0B84Zt1m6TJEkmxNHgg=
+SIZE (llvmlite-0.39.0.tar.gz) = 237004
diff --git a/devel/py-llvmlite/patches/patch-ffi_build_py b/devel/py-llvmlite/patches/patch-ffi_build_py
new file mode 100644
index 00000000000..1aaccf114e9
--- /dev/null
+++ b/devel/py-llvmlite/patches/patch-ffi_build_py
@@ -0,0 +1,15 @@
+Index: ffi/build.py
+--- ffi/build.py.orig
++++ ffi/build.py
+@@ -163,9 +163,8 @@ def main_posix(kind, library_ext):
+ print(msg)
+ print(warning + '\n')
+ else:
+-
+- if not out.startswith('11'):
+- msg = ("Building llvmlite requires LLVM 11.x.x, got "
++ if not (out.startswith('11') or out.startswith('12') or out.startswith('13')):
++ msg = ("Building llvmlite requires LLVM 11-13.x.x, got "
+ "{!r}. Be sure to set LLVM_CONFIG to the right executable "
+ "path.\nRead the documentation at "
+ "http://llvmlite.pydata.org/ for more information about "
diff --git a/devel/py-llvmlite/patches/patch-ffi_passmanagers_cpp b/devel/py-llvmlite/patches/patch-ffi_passmanagers_cpp
new file mode 100644
index 00000000000..95f9a3ee390
--- /dev/null
+++ b/devel/py-llvmlite/patches/patch-ffi_passmanagers_cpp
@@ -0,0 +1,13 @@
+Index: ffi/passmanagers.cpp
+--- ffi/passmanagers.cpp.orig
++++ ffi/passmanagers.cpp
+@@ -17,9 +17,6 @@
+ #include "llvm-c/Transforms/IPO.h"
+ #include "llvm-c/Transforms/Scalar.h"
+ #include "llvm/IR/LegacyPassManager.h"
+-#if LLVM_VERSION_MAJOR > 11
+-#include "llvm/IR/RemarkStreamer.h"
+-

No comments:

Post a Comment