Hi,
While testing lang/rust testsuite with lldb, I noted several failure due
to not properly packaged devel/llvm,-python.
devel/llvm,-python provides a lldb python module. The module used a
_lldb.so module, which is in fact a symlink to liblldb.so (installed in
/usr/local/lib).
the library is provided by devel/llvm, but its name isn't liblldb.so
but liblldb.so.0.0. The symlink is wrong, so the python module fails to
load.
$ python2.7 -c 'import lldb'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/local/lib/python2.7/site-packages/lldb/__init__.py", line 39, in
<module>
import _lldb
ImportError: No module named _lldb
$ pkg_locate _lldb.so
py-llvm-6.0.1p2:devel/llvm,-python:/usr/local/lib/python2.7/site-packages/lldb/_lldb.so
$ ls -l /usr/local/lib/python2.7/site-packages/lldb/_lldb.so
lrwxr-xr-x 1 root wheel 26 Dec 5 13:06
/usr/local/lib/python2.7/site-packages/lldb/_lldb.so@ ->
../../../../lib/liblldb.so
(it is /usr/local/lib/liblldb.so)
$ pkg_locate liblldb.so
llvm-6.0.1p18:devel/llvm,-main:/usr/local/lib/liblldb.so.0.0
$ ls /usr/local/lib/liblldb.so*
/usr/local/lib/liblldb.so.0.0
Below an untested diff to correct the symlink in post-install. I will
test it soon.
Thanks.
--
Sebastien Marie
Index: Makefile
===================================================================
RCS file: /cvs/ports/devel/llvm/Makefile,v
retrieving revision 1.199
diff -u -p -r1.199 Makefile
--- Makefile 21 Nov 2018 08:03:05 -0000 1.199
+++ Makefile 5 Dec 2018 15:59:19 -0000
@@ -19,7 +19,7 @@ PKGSPEC-main = llvm-=${LLVM_V}
PKGNAME-main = llvm-${LLVM_V}
PKGNAME-python = py-llvm-${LLVM_V}
REVISION-main = 18
-REVISION-python = 2
+REVISION-python = 3
CATEGORIES = devel
DISTFILES = llvm-${LLVM_V}.src${EXTRACT_SUFX} \
cfe-${LLVM_V}.src${EXTRACT_SUFX} \
@@ -124,6 +124,8 @@ post-install:
${PREFIX}/man/man1
${INSTALL_DATA} ${WRKSRC}/tools/clang/docs/_build/man/clang.1 \
${PREFIX}/man/man1
+ ln -fs ${PREFIX}/lib/liblldb.so \
+ ${PREFIX}/lib/python${MODPY_VERSION}/site-packages/lldb/_lldb.so
# lit and FileCheck are not installed
@rm ${PREFIX}/man/man1/lit.1
@rm ${PREFIX}/man/man1/FileCheck.1