Skip to content

Commit 836ccfc

Browse files
committed
Don't build HTML documentation. Add lldb man pages.
* Install a redirection index.html page to point users to the upstream HTML documentation. * Remove myst parser patch for RHEL. * Remove -DLLVM_INCLUDE_DOCS * Add lldb man-pages
1 parent 680f925 commit 836ccfc

File tree

3 files changed

+50
-113
lines changed

3 files changed

+50
-113
lines changed

0001-19-Remove-myst_parser-dependency-for-RHEL.patch

Lines changed: 0 additions & 41 deletions
This file was deleted.

0001-20-Remove-myst_parser-dependency-for-RHEL.patch

Lines changed: 0 additions & 43 deletions
This file was deleted.

llvm.spec

Lines changed: 50 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@
182182
#region main package
183183
Name: %{pkg_name_llvm}
184184
Version: %{maj_ver}.%{min_ver}.%{patch_ver}%{?rc_ver:~rc%{rc_ver}}%{?llvm_snapshot_version_suffix:~%{llvm_snapshot_version_suffix}}
185-
Release: 3%{?dist}
185+
Release: 4%{?dist}
186186
Summary: The Low Level Virtual Machine
187187

188188
License: Apache-2.0 WITH LLVM-exception OR NCSA
@@ -261,13 +261,6 @@ Patch2000: 0001-19-Always-build-shared-libs-for-LLD.patch
261261
#endregion LLD patches
262262

263263
#region RHEL patches
264-
# All RHEL
265-
%if %{maj_ver} >= 20
266-
Patch500: 0001-20-Remove-myst_parser-dependency-for-RHEL.patch
267-
%else
268-
Patch500: 0001-19-Remove-myst_parser-dependency-for-RHEL.patch
269-
%endif
270-
271264
# RHEL 8 only
272265
Patch501: 0001-Fix-page-size-constant-on-aarch64-and-ppc64le.patch
273266
#endregion RHEL patches
@@ -803,13 +796,9 @@ The package contains the LLDB Python module.
803796
# automatically apply patches based on LLVM version
804797
%autopatch -m%{maj_ver}00 -M%{maj_ver}99 -p1
805798

806-
%if %{defined rhel}
807-
%patch -p1 -P500
808-
809-
%if %{rhel} == 8
799+
%if %{defined rhel} && 0%{?rhel} == 8
810800
%patch -p1 -P501
811801
%endif
812-
%endif
813802

814803
#region LLVM preparation
815804

@@ -844,10 +833,6 @@ The package contains the LLDB Python module.
844833

845834
#endregion COMPILER-RT preparation
846835

847-
#region LLDB preparation
848-
# Empty lldb/docs/CMakeLists.txt because we cannot build it
849-
echo "" > lldb/docs/CMakeLists.txt
850-
#endregion LLDB preparation
851836
#endregion prep
852837

853838
#region build
@@ -929,14 +914,20 @@ popd
929914
#endregion compiler-rt options
930915

931916
#region docs options
917+
918+
# Add all *enabled* documentation targets (no doxygen but sphinx)
932919
%global cmake_config_args %{cmake_config_args} \\\
933-
-DLLVM_BUILD_DOCS:BOOL=ON \\\
920+
-DLLVM_ENABLE_DOXYGEN:BOOL=OFF \\\
934921
-DLLVM_ENABLE_SPHINX:BOOL=ON \\\
922+
-DLLVM_BUILD_DOCS:BOOL=ON
923+
924+
# Configure sphinx:
925+
# Build man-pages but no HTML docs using sphinx
926+
%global cmake_config_args %{cmake_config_args} \\\
935927
-DSPHINX_EXECUTABLE=%{_bindir}/sphinx-build-3 \\\
936-
-DSPHINX_WARNINGS_AS_ERRORS=OFF \\\
937-
-DLLVM_ENABLE_DOXYGEN:BOOL=OFF \\\
938-
-DLLVM_INCLUDE_DOCS:BOOL=ON \\\
939-
-DLLVM_INSTALL_SPHINX_HTML_DIR=%{_pkgdocdir}/html
928+
-DSPHINX_OUTPUT_HTML:BOOL=OFF \\\
929+
-DSPHINX_OUTPUT_MAN:BOOL=ON \\\
930+
-DSPHINX_WARNINGS_AS_ERRORS=OFF
940931
#endregion docs options
941932

942933
#region lldb options
@@ -1193,6 +1184,35 @@ done
11931184
mkdir -p %{buildroot}%{pkg_datadir}/llvm/cmake
11941185
cp -Rv cmake/* %{buildroot}%{pkg_datadir}/llvm/cmake
11951186

1187+
# Install a placeholder to redirect users of the formerly shipped
1188+
# HTML documentation to the upstream HTML documentation.
1189+
mkdir -pv %{buildroot}%{_pkgdocdir}/html
1190+
cat <<EOF > %{buildroot}%{_pkgdocdir}/html/index.html
1191+
<!doctype html>
1192+
<html lang=en>
1193+
<head>
1194+
<title>LLVM %{maj_ver}.%{min_ver} documentation</title>
1195+
</head>
1196+
<body>
1197+
<h1>
1198+
LLVM %{maj_ver}.%{min_ver} Documentation
1199+
</h1>
1200+
<ul>
1201+
<li>
1202+
<a href="https://releases.llvm.org/%{maj_ver}.%{min_ver}.0/docs/index.html">
1203+
Click here for the upstream documentation of LLVM %{maj_ver}.%{min_ver}.
1204+
</a>
1205+
</li>
1206+
<li>
1207+
<a href="https://llvm.org/docs/">
1208+
Click here for the latest upstream documentation of LLVM.
1209+
</a>
1210+
</li>
1211+
</ul>
1212+
</body>
1213+
</html>
1214+
EOF
1215+
11961216
#endregion LLVM installation
11971217

11981218
#region CLANG installation
@@ -1270,9 +1290,7 @@ chmod a+x %{buildroot}%{install_datadir}/scan-view/{Reporter.py,startfile.py}
12701290
rm -vf %{buildroot}%{install_datadir}/clang/clang-format-bbedit.applescript
12711291
rm -vf %{buildroot}%{install_datadir}/clang/clang-format-sublime.py*
12721292

1273-
# TODO: Package html docs
1274-
rm -Rvf %{buildroot}%{install_docdir}/LLVM/clang/html
1275-
rm -Rvf %{buildroot}%{install_docdir}/LLVM/clang-tools/html
1293+
# Remove unpackaged files
12761294
rm -Rvf %{buildroot}%{install_datadir}/clang-doc/clang-doc-default-stylesheet.css
12771295
rm -Rvf %{buildroot}%{install_datadir}/clang-doc/index.js
12781296

@@ -1361,9 +1379,6 @@ rm %{buildroot}%{install_bindir}/llvm-omp-kernel-replay
13611379

13621380
#region LLD installation
13631381

1364-
# Remove LLD's HTML documentation files
1365-
rm -Rvf %{buildroot}%{install_docdir}/LLVM/lld/html
1366-
13671382
%if %{without compat_build}
13681383
# Required when using update-alternatives:
13691384
# https://docs.fedoraproject.org/en-US/packaging-guidelines/Alternatives/
@@ -2086,7 +2101,7 @@ fi
20862101

20872102
%files -n %{pkg_name_llvm}-doc
20882103
%license llvm/LICENSE.TXT
2089-
%doc %{_pkgdocdir}/html
2104+
%doc %{_pkgdocdir}/html/index.html
20902105

20912106
%files -n %{pkg_name_llvm}-static
20922107
%license llvm/LICENSE.TXT
@@ -2463,6 +2478,8 @@ fi
24632478
%{install_libdir}/liblldb*.so
24642479
%{install_libdir}/liblldb.so.*
24652480
%{install_libdir}/liblldbIntelFeatures.so.*
2481+
%{_mandir}/man1/lldb-server%{exec_suffix}.1.gz
2482+
%{_mandir}/man1/lldb%{exec_suffix}.1.gz
24662483
%if %{with bundle_compat_lib}
24672484
%{_libdir}/liblldb.so.%{compat_maj_ver}*
24682485
%endif
@@ -2478,6 +2495,10 @@ fi
24782495

24792496
#region changelog
24802497
%changelog
2498+
* Tue Nov 19 2024 Konrad Kleine <[email protected]> - 19.1.3-4
2499+
- Remove HTML documentation
2500+
- Add lldb man pages
2501+
24812502
* Mon Nov 18 2024 Josh Stone <[email protected]> - 19.1.3-3
24822503
- Fix profiling after a binutils NOTE change (rhbz#2322754)
24832504

0 commit comments

Comments
 (0)