Update py-llvmlite to unbreak with our LLVM version. From aisha, I added

devel/quirks and @pkgpath markers.

Drops py2 support so py-miasm needs work to fix with this version,
however the situation isn't worse than it is now, because it was already
unusable because py-llvmlite was already broken.

I only waited a few days for maintainer (no reply) because it's already
broken.
This commit is contained in:
sthen 2022-09-08 09:47:44 +00:00
parent 667fdd3909
commit 9c1762e933
11 changed files with 104 additions and 20 deletions

View File

@ -1430,7 +1430,6 @@
SUBDIR += py-liblarch,python3
SUBDIR += py-lief,python3
SUBDIR += py-littleutils,python3
SUBDIR += py-llvmlite
SUBDIR += py-llvmlite,python3
SUBDIR += py-logilab-common,python3
SUBDIR += py-magic,python3

View File

@ -1,8 +1,4 @@
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 +13,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

View File

@ -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

View File

@ -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 "

View File

@ -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"
-#endif
#include "llvm/IR/LLVMRemarkStreamer.h"
#include "llvm/Remarks/RemarkStreamer.h"
#include "llvm/Transforms/IPO.h"

View File

@ -0,0 +1,13 @@
Index: ffi/targets.cpp
--- ffi/targets.cpp.orig
+++ ffi/targets.cpp
@@ -204,7 +204,9 @@ LLVMPY_CreateTargetMachine(LLVMTargetRef T, const char
rm = Reloc::DynamicNoPIC;
TargetOptions opt;
+#if LLVM_VERSION_MAJOR < 12
opt.PrintMachineCode = PrintMC;
+#endif
opt.MCOptions.ABIName = ABIName;
bool jit = JIT;

View File

@ -0,0 +1,41 @@
Index: llvmlite/tests/test_binding.py
--- llvmlite/tests/test_binding.py.orig
+++ llvmlite/tests/test_binding.py
@@ -18,6 +18,16 @@ from llvmlite.binding import ffi
from llvmlite.tests import TestCase
+def clean_string_whitespace(x: str) -> str:
+ # Remove trailing whitespace from the end of each line
+ x = re.sub(r"\s+$", "", x, flags=re.MULTILINE)
+ # Remove intermediate blank lines
+ x = re.sub(r"\n\s*\n", r"\n", x, flags=re.MULTILINE)
+ # Remove extraneous whitespace from the beginning and end of the string
+ x = x.strip()
+ return x
+
+
# arvm7l needs extra ABI symbols to link successfully
if platform.machine() == 'armv7l':
llvm.load_library_permanently('libgcc_s.so.1')
@@ -555,7 +565,10 @@ class TestMisc(BaseTest):
bd = ir.IRBuilder(fn.append_basic_block(name="<>!*''#"))
bd.ret(ir.Constant(ir.IntType(32), 12345))
asm = str(mod)
- self.assertEqual(asm, asm_nonalphanum_blocklabel)
+ self.assertEqual(
+ clean_string_whitespace(asm),
+ clean_string_whitespace(asm_nonalphanum_blocklabel)
+ )
def test_global_context(self):
gcontext1 = llvm.context.get_global_context()
@@ -640,7 +653,7 @@ class TestMisc(BaseTest):
def test_version(self):
major, minor, patch = llvm.llvm_version_info
# one of these can be valid
- valid = [(11,)]
+ valid = [(11,), (12,), (13,)]
self.assertIn((major,), valid)
self.assertIn(patch, range(10))

View File

@ -1,10 +1,10 @@
@pkgpath devel/py-llvmlite
lib/python${MODPY_VERSION}/site-packages/llvmlite/
lib/python${MODPY_VERSION}/site-packages/llvmlite-${MODPY_EGG_VERSION}-py${MODPY_VERSION}.egg-info
lib/python${MODPY_VERSION}/site-packages/llvmlite/__init__.py
${MODPY_COMMENT}lib/python${MODPY_VERSION}/site-packages/llvmlite/${MODPY_PYCACHE}/
lib/python${MODPY_VERSION}/site-packages/llvmlite/${MODPY_PYCACHE}__init__.${MODPY_PYC_MAGIC_TAG}pyc
lib/python${MODPY_VERSION}/site-packages/llvmlite/${MODPY_PYCACHE}_version.${MODPY_PYC_MAGIC_TAG}pyc
lib/python${MODPY_VERSION}/site-packages/llvmlite/${MODPY_PYCACHE}six.${MODPY_PYC_MAGIC_TAG}pyc
lib/python${MODPY_VERSION}/site-packages/llvmlite/${MODPY_PYCACHE}utils.${MODPY_PYC_MAGIC_TAG}pyc
lib/python${MODPY_VERSION}/site-packages/llvmlite/_version.py
lib/python${MODPY_VERSION}/site-packages/llvmlite/binding/
@ -33,7 +33,7 @@ lib/python${MODPY_VERSION}/site-packages/llvmlite/binding/dylib.py
lib/python${MODPY_VERSION}/site-packages/llvmlite/binding/executionengine.py
lib/python${MODPY_VERSION}/site-packages/llvmlite/binding/ffi.py
lib/python${MODPY_VERSION}/site-packages/llvmlite/binding/initfini.py
lib/python${MODPY_VERSION}/site-packages/llvmlite/binding/libllvmlite.so
@so lib/python${MODPY_VERSION}/site-packages/llvmlite/binding/libllvmlite.so
lib/python${MODPY_VERSION}/site-packages/llvmlite/binding/linker.py
lib/python${MODPY_VERSION}/site-packages/llvmlite/binding/module.py
lib/python${MODPY_VERSION}/site-packages/llvmlite/binding/object_file.py
@ -70,7 +70,6 @@ lib/python${MODPY_VERSION}/site-packages/llvmlite/llvmpy/${MODPY_PYCACHE}core.${
lib/python${MODPY_VERSION}/site-packages/llvmlite/llvmpy/${MODPY_PYCACHE}passes.${MODPY_PYC_MAGIC_TAG}pyc
lib/python${MODPY_VERSION}/site-packages/llvmlite/llvmpy/core.py
lib/python${MODPY_VERSION}/site-packages/llvmlite/llvmpy/passes.py
lib/python${MODPY_VERSION}/site-packages/llvmlite/six.py
lib/python${MODPY_VERSION}/site-packages/llvmlite/tests/
lib/python${MODPY_VERSION}/site-packages/llvmlite/tests/__init__.py
lib/python${MODPY_VERSION}/site-packages/llvmlite/tests/__main__.py
@ -78,13 +77,17 @@ ${MODPY_COMMENT}lib/python${MODPY_VERSION}/site-packages/llvmlite/tests/${MODPY_
lib/python${MODPY_VERSION}/site-packages/llvmlite/tests/${MODPY_PYCACHE}__init__.${MODPY_PYC_MAGIC_TAG}pyc
lib/python${MODPY_VERSION}/site-packages/llvmlite/tests/${MODPY_PYCACHE}__main__.${MODPY_PYC_MAGIC_TAG}pyc
lib/python${MODPY_VERSION}/site-packages/llvmlite/tests/${MODPY_PYCACHE}customize.${MODPY_PYC_MAGIC_TAG}pyc
lib/python${MODPY_VERSION}/site-packages/llvmlite/tests/${MODPY_PYCACHE}refprune_proto.${MODPY_PYC_MAGIC_TAG}pyc
lib/python${MODPY_VERSION}/site-packages/llvmlite/tests/${MODPY_PYCACHE}test_binding.${MODPY_PYC_MAGIC_TAG}pyc
lib/python${MODPY_VERSION}/site-packages/llvmlite/tests/${MODPY_PYCACHE}test_ir.${MODPY_PYC_MAGIC_TAG}pyc
lib/python${MODPY_VERSION}/site-packages/llvmlite/tests/${MODPY_PYCACHE}test_llvmpy.${MODPY_PYC_MAGIC_TAG}pyc
lib/python${MODPY_VERSION}/site-packages/llvmlite/tests/${MODPY_PYCACHE}test_refprune.${MODPY_PYC_MAGIC_TAG}pyc
lib/python${MODPY_VERSION}/site-packages/llvmlite/tests/${MODPY_PYCACHE}test_valuerepr.${MODPY_PYC_MAGIC_TAG}pyc
lib/python${MODPY_VERSION}/site-packages/llvmlite/tests/customize.py
lib/python${MODPY_VERSION}/site-packages/llvmlite/tests/refprune_proto.py
lib/python${MODPY_VERSION}/site-packages/llvmlite/tests/test_binding.py
lib/python${MODPY_VERSION}/site-packages/llvmlite/tests/test_ir.py
lib/python${MODPY_VERSION}/site-packages/llvmlite/tests/test_llvmpy.py
lib/python${MODPY_VERSION}/site-packages/llvmlite/tests/test_refprune.py
lib/python${MODPY_VERSION}/site-packages/llvmlite/tests/test_valuerepr.py
lib/python${MODPY_VERSION}/site-packages/llvmlite/utils.py

View File

@ -3,7 +3,7 @@ CATEGORIES = devel databases
DISTFILES =
# API.rev
PKGNAME = quirks-6.32
PKGNAME = quirks-6.33
PKG_ARCH = *
MAINTAINER = Marc Espie <espie@openbsd.org>

View File

@ -1,7 +1,7 @@
#! /usr/bin/perl
# ex:ts=8 sw=4:
# $OpenBSD: Quirks.pm,v 1.1426 2022/09/07 08:22:36 ajacoutot Exp $
# $OpenBSD: Quirks.pm,v 1.1427 2022/09/08 09:47:44 sthen Exp $
#
# Copyright (c) 2009 Marc Espie <espie@openbsd.org>
#
@ -742,6 +742,7 @@ my $stem_extensions = {
'py-ecdsa' => 'py3-ecdsa',
'py-virtualenv' => 'py3-virtualenv',
'webkitgtk4' => 'webkitgtk40',
'py-llvmlite' => 'py3-llvmlite',
};
my $obsolete_reason = {};

View File

@ -1,4 +1,5 @@
BROKEN-i386 = uint128_t
BROKEN = Needs to be updated for py-llvmlite-0.39.0
COMMENT = reverse engineering framework in Python