On 2017/01/04 01:00, Alexander Bluhm wrote:
> Hi,
> 
> I need the python bindings for clang to make some static code
> analysis.  So I have split the llvm port into subpackages.  The
> files DESCR MESSAGE PFRAG.lld PLIST were just renamed to -main.
> The llvm-python package contains only 3 .py files.
> 
> Is this subpackage split overkill?  The -main package has a runtime
> dependency for python anyway, although I think this is an accident
> caused by including lang/python.

That was intentional; some of the scripts (currently git-clang-format
and scan-view) use python. So if splitting, it would be good to also
move those scripts and associated files to the -python subpackage.

> Do I need some quirks to move from llvm to llvm-main?

Yes, to make that change you would need a quirk. But I would
recommend not changing the name of the main package, it seems cleaner
that way. To do this, use "PKGNAME-main=llvm-${LLVM_V}". You also
need "@pkgpath devel/llvm" in PLIST-main whether the package name
changes or not.

> +     ${INSTALL_DATA_DIR} \
> +         ${PREFIX}/lib/python${MODPY_VERSION}/site-packages/clang
> +     ${INSTALL_DATA} ${WRKSRC}/tools/clang/bindings/python/clang/* \
> +         ${PREFIX}/lib/python${MODPY_VERSION}/site-packages/clang

If the module is loaded by a user with write access to the python lib
directory (i.e. root), pyc files will be generated at runtime. We normally
pregenerate these in the port to avoid leaving unregistered files in a
"package-owned" directory. To build them, you should be able to use
something like this:

${MODPY_BIN} ${MODPY_LIBDIR}/compileall.py 
${PREFIX}/lib/python${MODPY_VERSION}/site-packages/clang

I'm not convinced pyc are really arch independent (iirc the files
can be used on different arch but I think there were differences depending
on where they were generated), so I would also remove the "PKG_ARCH-python = *".

Reply via email to