From 16fed01b22bf023abd6fc2e710de64e7800db21c Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Mon, 8 Apr 2024 13:34:36 -0400 Subject: [PATCH] Disable docs in RHEL builds ocaml-dune is the only consumer of sphinx-copybutton in RHEL/ELN, and the recent addition of sphinx-design pulls in many unwanted Python build dependencies. --- ocaml-dune.spec | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/ocaml-dune.spec b/ocaml-dune.spec index f8128c6..8632ee6 100644 --- a/ocaml-dune.spec +++ b/ocaml-dune.spec @@ -7,9 +7,12 @@ # library in Fedora, so don't build it. %bcond lwt 0 +# docs are not needed in RHEL, and add unwanted build dependencies +%bcond docs %{undefined rhel} + Name: ocaml-dune Version: 3.15.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Composable build system for OCaml and Reason # Dune itself is MIT. Some bundled libraries have a different license: @@ -54,10 +57,13 @@ BuildRequires: ocaml-compiler-libs BuildRequires: ocaml-csexp-devel >= 1.5.0 BuildRequires: ocaml-pp-devel >= 1.2.0 BuildRequires: ocaml-rpm-macros + +%if %{with docs} BuildRequires: %{py3_dist sphinx} BuildRequires: %{py3_dist sphinx-copybutton} BuildRequires: %{py3_dist sphinx-design} BuildRequires: %{py3_dist sphinx-rtd-theme} +%endif %if %{with lwt} BuildRequires: ocaml-lwt-devel >= 5.6.0 @@ -114,6 +120,7 @@ adapted to the open source world. It has matured over a long time and is used daily by hundred of developers, which means that it is highly tested and productive. +%if %{with docs} %package doc # The content is MIT. Other licenses are due to files added by sphinx. # BSD-2-Clause: @@ -143,6 +150,7 @@ BuildArch: noarch %description doc HTML documentation for dune, a composable build system for OCaml. +%endif %package emacs Summary: Emacs support for %{name} @@ -477,7 +485,9 @@ sed -i 's/, < 6//'g doc/requirements.txt --sbindir %{_sbindir} %make_build release +%if %{with docs} %make_build doc +%endif # We also want the libraries # Do not use the bundled csexp and pp when building them @@ -507,8 +517,10 @@ cd - %{_bindir}/dune %{_mandir}/man*/dune* +%if %{with docs} %files doc %doc doc/_build/* +%endif %files emacs %{_emacs_sitelispdir}/dune* @@ -576,6 +588,9 @@ cd - %files -n ocaml-xdg-devel -f .ofiles-xdg-devel %changelog +* Mon Apr 08 2024 Yaakov Selkowitz - 3.15.0-2 +- Disable docs in RHEL builds + * Fri Apr 5 2024 Jerry James - 3.15.0-1 - Version 3.15.0