Make the ocaml-odoc dependency conditional.

This commit is contained in:
Richard W.M. Jones 2021-03-01 17:54:41 +00:00
parent d510385514
commit 60e387bcf8

View File

@ -2,6 +2,10 @@
%global debug_package %{nil}
%endif
# Documentation adds a circular dependency, so by
# default we build without.
%bcond_with doc
%global srcname ppx-cold
%global upname ppx_cold
@ -18,7 +22,9 @@ BuildRequires: ocaml >= 4.04.2
BuildRequires: ocaml-base-devel >= 0.14
BuildRequires: ocaml-dune >= 2.0.0
BuildRequires: ocaml-ppxlib-devel >= 0.11.0
%if %{with doc}
BuildRequires: ocaml-odoc
%endif
%description
Ppx_cold translates [@@cold] attributes to [@@inline never]
@ -39,13 +45,17 @@ files for developing applications that use %{name}.
%build
dune build %{?_smp_mflags}
%if %{with doc}
dune build %{?_smp_mflags} @doc
%endif
%install
dune install --destdir=%{buildroot}
%if %{with doc}
# We do not want the dune markers
find _build/default/_doc/_html -name .dune-keep -delete
%endif
# We do not want the ml files
find %{buildroot}%{_libdir}/ocaml -name \*.ml -delete
@ -74,7 +84,9 @@ dune runtest
%endif
%files devel
%if %{with doc}
%doc _build/default/_doc/_html/*
%endif
%{_libdir}/ocaml/%{upname}/dune-package
%{_libdir}/ocaml/%{upname}/opam
%ifarch %{ocaml_native_compiler}
@ -89,6 +101,7 @@ dune runtest
%changelog
* Mon Mar 1 17:35:06 GMT 2021 Richard W.M. Jones <rjones@redhat.com> - 0.14.0-8
- OCaml 4.12.0 build
- Make the ocaml-odoc dependency conditional.
* Sat Feb 20 2021 Jerry James <loganjerry@gmail.com> - 0.14.0-7
- Rebuild for ocaml-base 0.14.1