From a8bf8d94eccd0c43c3533880c639f850f30ae9acfa7328e18ed5292343186f99 Mon Sep 17 00:00:00 2001 From: Petr Gajdos Date: Mon, 30 Sep 2019 14:34:40 +0000 Subject: [PATCH] Accepting request 734103 from home:fsirl:doxygen-libclang Hi, this request adds optional support for doxygen with libclang integration to the specfile. Doxygen with libclang support is regularly requested by my users, so it would be nice to have upstream. The build currently only fails against SUSE-SLE-15-SP1:Update because the following clang7 change hasn't been backported yet: * Mon Jul 01 2019 Aaron Puchert - Add a clang-%{_sonum} symlink, which is referenced by /usr/lib64/cmake/clang/ClangTargets.cmake (boo#1138457) Franz. OBS-URL: https://build.opensuse.org/request/show/734103 OBS-URL: https://build.opensuse.org/package/show/devel:tools/doxygen?expand=0&rev=140 --- doxygen-llvm-libs.patch | 13 +++++++++++++ doxygen.changes | 7 +++++++ doxygen.spec | 13 +++++++++++++ 3 files changed, 33 insertions(+) create mode 100644 doxygen-llvm-libs.patch diff --git a/doxygen-llvm-libs.patch b/doxygen-llvm-libs.patch new file mode 100644 index 0000000..0e1e997 --- /dev/null +++ b/doxygen-llvm-libs.patch @@ -0,0 +1,13 @@ +--- src/CMakeLists.txt~ 2019-07-28 13:32:49.436473952 +0200 ++++ src/CMakeLists.txt 2019-07-28 13:33:52.016439550 +0200 +@@ -261,9 +261,8 @@ + endif() + include_directories(${LLVM_INCLUDE_DIRS}) + add_definitions(${LLVM_DEFINITIONS}) +- llvm_map_components_to_libnames(llvm_libs support core option) + target_compile_definitions(doxygen PRIVATE ${LLVM_DEFINITIONS}) +- set(CLANG_LIBS libclang clangTooling ${llvm_libs}) ++ set(CLANG_LIBS libclang clangTooling LLVM) + endif() + + target_link_libraries(doxygen diff --git a/doxygen.changes b/doxygen.changes index ff179c9..019a3c1 100644 --- a/doxygen.changes +++ b/doxygen.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Mon Sep 30 13:06:06 UTC 2019 - Franz Sirl + +- Optional build with libclang support: + * add doxygen-llvm-libs.patch to link with monolithic libLLVM + * support "--with libclang" in specfile + ------------------------------------------------------------------- Mon Sep 30 11:13:23 UTC 2019 - pgajdos@suse.com diff --git a/doxygen.spec b/doxygen.spec index f4e1a28..396ae0b 100644 --- a/doxygen.spec +++ b/doxygen.spec @@ -16,6 +16,9 @@ # +# build with "--with libclang" to enable libclang support +%bcond_with libclang + Name: doxygen Version: 1.8.16 Release: 0 @@ -35,12 +38,16 @@ Patch3: vhdlparser-no-return.patch Patch4: doxygen-dot-one-thread.patch # really do not require git executable Patch5: doxygen-git-not-required.patch +Patch6: doxygen-llvm-libs.patch BuildRequires: bison BuildRequires: cmake >= 2.8.12 BuildRequires: flex BuildRequires: gcc-c++ BuildRequires: python3-base BuildRequires: python3-xml +%if %{with libclang} +BuildRequires: llvm-clang-devel +%endif # Do not bother building documentation with latex since it is present on the # web trivialy for all versions of doxygen Obsoletes: doxygen-doc @@ -62,6 +69,9 @@ as well. %patch4 -p1 %endif %patch5 -p1 +%if %{with libclang} +%patch6 +%endif %build %cmake \ @@ -69,6 +79,9 @@ as well. -Dbuild_xmlparser=ON \ -Dbuild_search=OFF \ -Dbuild_wizard=OFF \ +%if %{with libclang} + -Duse_libclang=ON \ +%endif -DCMAKE_EXE_LINKER_FLAGS="-Wl,--as-needed -Wl,-z,relro,-z,now" \ -DCMAKE_MODULE_LINKER_FLAGS="-Wl,--as-needed -Wl,-z,relro,-z,now" \ -DCMAKE_SHARED_LINKER_FLAGS="-Wl,--as-needed -Wl,-z,relro,-z,now" \