On Mon, Apr 01 2019, Rafael Sadowski <rafael@sizeofvoid.org> wrote:
> Enable clang extra tools in devel/llvm to provide some useful C/C++
> tools. I started with the extra tools because we don't have an C++ Language
> Server Protocol (LSP) server in the tree but I want to play with it.
>
> However, build and works fine on amd64. Notable changes:
>
> - Zap all ":Bool" tags in cmake configure args. It's 2019 and cmake is
> smart enough.
I'm no cmake guru, what do the cmake authors/best practices say here?
> - Set CLANG_ENABLE_STATIC_ANALYZER=True, CLANG_INCLUDE_TESTS=True to
> build clang-tidy and enable test. (It is ignored if the folder extra
> don't exists)
> - Adjust WANTLIB
>
> Comments? OK?
In this port I'm caring mostly about what is actually used by the ports
tree. So if the extras subpackage breaks somehow, expect me to disable
it, not to fix it.
You say you "want to play with it". Do you have an actual use case?
I think it's too late to add "extra" stuff in this release cycle.
Comments inline,
> RS
>
> Index: Makefile
> ===================================================================
> RCS file: /cvs/ports/devel/llvm/Makefile,v
> retrieving revision 1.216
> diff -u -p -u -p -r1.216 Makefile
> --- Makefile 9 Mar 2019 06:18:11 -0000 1.216
> +++ Makefile 1 Apr 2019 06:25:18 -0000
> @@ -8,9 +8,10 @@ ONLY_FOR_ARCHS = ${LLVM_ARCHS}
>
> DPB_PROPERTIES = parallel
>
> -MULTI_PACKAGES = -main -python -lldb
> +MULTI_PACKAGES = -main -python -lldb -extras
> COMMENT-main = modular, fast C/C++/ObjC compiler, static analyzer and tools
> COMMENT-lldb = LLDB debugger
> +COMMENT-extras = clang extra tools
> COMMENT-python = Python bindings for Clang
>
> LLVM_V = 7.0.1
> @@ -20,13 +21,15 @@ PKGSPEC-main = llvm-=${LLVM_V}
> PKGNAME-main = llvm-${LLVM_V}
> PKGNAME-python = py-llvm-${LLVM_V}
> PKGNAME-lldb = lldb-${LLVM_V}
> +PKGNAME-extras = extras-${LLVM_V}
> REVISION-main = 9
> REVISION-lldb = 0
> CATEGORIES = devel
> DISTFILES = llvm-${LLVM_V}.src${EXTRACT_SUFX} \
> cfe-${LLVM_V}.src${EXTRACT_SUFX} \
> lld-${LLVM_V}.src${EXTRACT_SUFX} \
> - lldb-${LLVM_V}.src${EXTRACT_SUFX}
> + lldb-${LLVM_V}.src${EXTRACT_SUFX} \
> + clang-tools-extra-${LLVM_V}.src${EXTRACT_SUFX}
> MASTER_SITES = https://www.llvm.org/releases/${LLVM_V}/
> EXTRACT_SUFX = .tar.xz
>
> @@ -42,10 +45,10 @@ MAINTAINER= Jeremie Courreges-Anglas <jc
> # BSD
> PERMIT_PACKAGE_CDROM = Yes
>
> -WANTLIB = ${COMPILER_LIBCXX} c curses edit form m panel pthread \
> +WANTLIB = ${COMPILER_LIBCXX} c edit form m panel pthread \
> ${MODPY_WANTLIB} z
>
> -PSEUDO_FLAVORS = no_lldb
> +PSEUDO_FLAVORS = no_lldb _no_tools
"no_tools" instead of "_no_tools"?
> FLAVOR ?=
> NOT_FOR_ARCHS-lldb = ${GCC4_ARCHS}
>
> @@ -72,18 +75,24 @@ WANTLIB-python = clang
> RUN_DEPENDS-python = ${MODPY_RUN_DEPENDS}
> LIB_DEPENDS-python = ${BUILD_PKGPATH},-main
>
> -WANTLIB-lldb = clang
> +WANTLIB-lldb = ${COMPILER_LIBCXX} clang c curses edit form m panel
> +WANTLIB-lldb += ${MODPY_WANTLIB}
> LIB_DEPENDS-lldb = ${BUILD_PKGPATH},-main
> RUN_DEPENDS-lldb = ${MODPY_RUN_DEPENDS} \
> devel/py-six
>
> -SEPARATE_BUILD = Yes
Removed because it's the default for CONFIGURE_STYLE=cmake, I guess?
> -CONFIGURE_ARGS = -DLLVM_ENABLE_FFI:Bool=False \
> - -DLLVM_ENABLE_TERMINFO:Bool=False \
> - -DLLVM_ENABLE_RTTI:Bool=True \
> - -DCMAKE_DISABLE_FIND_PACKAGE_LibXml2:Bool=True \
> - -DLLVM_LINK_LLVM_DYLIB:Bool=True \
> - -DLLVM_BUILD_LLVM_DYLIB:Bool=True \
> +WANTLIB-extras = ${COMPILER_LIBCXX} c m clang
> +LIB_DEPENDS-extras = ${BUILD_PKGPATH},-main
> +RUN_DEPENDS-extras = ${MODPY_RUN_DEPENDS}
> +
> +CONFIGURE_ARGS = -DLLVM_ENABLE_FFI=False \
> + -DLLVM_ENABLE_TERMINFO=False \
> + -DLLVM_ENABLE_RTTI=True \
> + -DCLANG_ENABLE_STATIC_ANALYZER=True \
> + -DCLANG_INCLUDE_TESTS=True \
> + -DCMAKE_DISABLE_FIND_PACKAGE_LibXml2=True \
> + -DLLVM_LINK_LLVM_DYLIB=True \
> + -DLLVM_BUILD_LLVM_DYLIB=True \
> -DGO_EXECUTABLE=GO_EXECUTABLE-NOTFOUND \
> -DBacktrace_LIBRARY=''
>
> @@ -111,7 +120,7 @@ PKG_ARGS += -Dpowerpc=1
> PKG_ARGS += -Dpowerpc=0
> .endif
>
> -TEST_TARGET = check
> +TEST_TARGET = check-clang{,-tools}
I'd rather inline this:
TEST_TARGET = check-clang check-clang-tools
>
> # XXX sync
> GCC_VER = 4.9.4
> @@ -127,12 +136,16 @@ post-extract:
> mv ${WRKDIR}/cfe-${LLVM_V}.src ${WRKSRC}/tools/clang
> mv ${WRKDIR}/lld-${LLVM_V}.src ${WRKSRC}/tools/lld
> mv ${WRKDIR}/lldb-${LLVM_V}.src ${WRKSRC}/tools/lldb
> + mv ${WRKDIR}/clang-tools-extra-${LLVM_V}.src ${WRKSRC}/tools/clang/tools/extra
>
> pre-configure:
> @${SUBST_CMD} ${WRKSRC}/tools/clang/lib/Driver/ToolChains/OpenBSD.cpp
> -@ln -s ${MODPY_BIN} ${WRKDIR}/bin/python
> .if !${BUILD_PACKAGES:M-lldb}
> rm -r ${WRKSRC}/tools/lldb
> +.endif
> +.if !${BUILD_PACKAGES:M-extras}
> + rm -r ${WRKSRC}/tools/clang/tools/extra
> .endif
>
> post-build:
> Index: distinfo
> ===================================================================
> RCS file: /cvs/ports/devel/llvm/distinfo,v
> retrieving revision 1.30
> diff -u -p -u -p -r1.30 distinfo
> --- distinfo 28 Jan 2019 06:27:28 -0000 1.30
> +++ distinfo 1 Apr 2019 06:25:18 -0000
> @@ -1,8 +1,10 @@
> SHA256 (cfe-7.0.1.src.tar.xz) = pFti3eXX1f3N+odrCvkvFk1DSwbp6JtdCxy8Zd/j9Bg=
> +SHA256 (clang-tools-extra-7.0.1.src.tar.xz) = TJPH0rsHkjqLJy2j73kUQ4CArraTcl9PxcGc0OJhO+0=
> SHA256 (lld-7.0.1.src.tar.xz) = iGmqst0tjgDWmUM1LTFm0VnX6uJhX2amhPSgmZ/HQDE=
> SHA256 (lldb-7.0.1.src.tar.xz) = drRr51tBKj0i8NJieTBq5+J0/k15iKIYTFKcOKanaYI=
> SHA256 (llvm-7.0.1.src.tar.xz) = o438TbRxAux53MKqYek3IsX28G8KlhBzvYS3j7lJQZs=
> SIZE (cfe-7.0.1.src.tar.xz) = 12488668
> +SIZE (clang-tools-extra-7.0.1.src.tar.xz) = 901368
> SIZE (lld-7.0.1.src.tar.xz) = 912812
> SIZE (lldb-7.0.1.src.tar.xz) = 19384628
> SIZE (llvm-7.0.1.src.tar.xz) = 28311056
> Index: pkg/DESCR-extras
> ===================================================================
> RCS file: pkg/DESCR-extras
> diff -N pkg/DESCR-extras
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ pkg/DESCR-extras 1 Apr 2019 06:25:18 -0000
> @@ -0,0 +1,14 @@
> +The clang-tools-extra contains helpful developer tools using Clangs tooling
> +APIs.
> +
> +- clang-tidy, is a clang-based C++ linter tool.
> +- clang-include-fixer, adds missing namespace qualifiers to all instances of an
> + unidentified symbol if the symbol is missing some prefix namespace
> + qualifiers.
> +- modularize,is a standalone tool that checks whether a set of headers provides
> + the consistent definitions required to use modules.
> +- pp-trace is a standalone tool that traces preprocessor activity.
> +- clang-rename is a C++ refactoring tool.
> +- clangd is a language server that implements the Language Server Protocol.
> +- clang-doc is a tool for generating C and C++ documenation from source code
> + and comments.
> Index: pkg/PLIST-extras
> ===================================================================
> RCS file: pkg/PLIST-extras
> diff -N pkg/PLIST-extras
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ pkg/PLIST-extras 1 Apr 2019 06:25:18 -0000
> @@ -0,0 +1,46 @@
> +@comment $OpenBSD: PLIST-extras,v$
> +@bin bin/clang-apply-replacements
> +@bin bin/clang-change-namespace
> +@bin bin/clang-reorder-fields
> +@bin bin/clang-tidy
> +@bin bin/clang-query
> +@bin bin/clangd
> +@bin bin/clang-include-fixer
> +@bin bin/find-all-symbols
> +@bin bin/modularize
> +lib/libclangApplyReplacements.a
> +lib/libclangChangeNamespace.a
> +lib/libclangDaemon.a
> +lib/libclangDoc.a
> +lib/libclangIncludeFixer.a
> +lib/libclangIncludeFixerPlugin.a
> +lib/libclangMove.a
> +lib/libclangQuery.a
> +lib/libclangReorderFields.a
> +lib/libclangTidy.a
> +lib/libclangTidyAbseilModule.a
> +lib/libclangTidyAndroidModule.a
> +lib/libclangTidyBoostModule.a
> +lib/libclangTidyBugproneModule.a
> +lib/libclangTidyCERTModule.a
> +lib/libclangTidyCppCoreGuidelinesModule.a
> +lib/libclangTidyFuchsiaModule.a
> +lib/libclangTidyGoogleModule.a
> +lib/libclangTidyHICPPModule.a
> +lib/libclangTidyLLVMModule.a
> +lib/libclangTidyMPIModule.a
> +lib/libclangTidyMiscModule.a
> +lib/libclangTidyModernizeModule.a
> +lib/libclangTidyObjCModule.a
> +lib/libclangTidyPerformanceModule.a
> +lib/libclangTidyPlugin.a
> +lib/libclangTidyPortabilityModule.a
> +lib/libclangTidyReadabilityModule.a
> +lib/libclangTidyUtils.a
> +lib/libclangTidyZirconModule.a
> +lib/libfindAllSymbols.a
> +share/clang/clang-include-fixer.el
> +share/clang/clang-include-fixer.py
> +share/clang/clang-tidy-diff.py
> +share/clang/run-clang-tidy.py
> +share/clang/run-find-all-symbols.py
>
--
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF DDCC 0DFA 74AE 1524 E7EE
No comments:
Post a Comment