2014-04-22 10:07:08 +00:00
|
|
|
# Note that OCaml is compiled on all architectures. However
|
|
|
|
# on some (rare) architectures, only bytecode compilation is
|
|
|
|
# available. Use these macros to find out if native code
|
|
|
|
# compilation is available on a particular architecture.
|
|
|
|
|
|
|
|
# Architectures that support the OCaml native code compiler.
|
2024-07-18 07:40:18 +00:00
|
|
|
%ocaml_native_compiler aarch64 %{power64} riscv64 s390x x86_64 x86_64_v2
|
2014-04-22 10:07:08 +00:00
|
|
|
|
|
|
|
# Architectures that support native dynamic linking of OCaml code.
|
2024-07-18 07:40:18 +00:00
|
|
|
%ocaml_natdynlink aarch64 %{power64} riscv64 s390x x86_64 x86_64_v2
|
2017-08-08 07:58:38 +00:00
|
|
|
|
|
|
|
# Architectures that support profiling of native code (ocamlopt -p).
|
2019-12-06 14:12:11 +00:00
|
|
|
# This was removed in OCaml 4.09.
|
|
|
|
# https://github.com/ocaml/ocaml/pull/2314
|
|
|
|
%ocaml_native_profiling %{nil}
|
2022-02-02 20:35:25 +00:00
|
|
|
|
|
|
|
# Toplevel OCaml directory
|
|
|
|
%ocamldir %{_libdir}/ocaml
|
|
|
|
|
2023-10-05 02:48:27 +00:00
|
|
|
# Common elements for all OCaml packages.
|
2022-02-02 20:35:25 +00:00
|
|
|
#
|
2023-10-05 02:48:27 +00:00
|
|
|
# ExcludeArch: OCaml packages have not been built on i686 since OCaml 5 was
|
|
|
|
# introduced in Fedora 39.
|
|
|
|
# -d: most OCaml packages have no ELF objects when built on a bytecode-only
|
|
|
|
# architecture, so debuginfo generation is suppressed. Use this flag to
|
|
|
|
# enable a debuginfo package on such architectures; i.e., when the package
|
|
|
|
# contains an ELF object even on bytecode-only architectures.
|
|
|
|
%ocaml_pkg(d) %{lua:
|
|
|
|
print("ExcludeArch: %{ix86}\\n")
|
|
|
|
if not opt.d then
|
|
|
|
local arch = rpm.expand("%{_target_cpu}")
|
|
|
|
local native = rpm.expand("%{ocaml_native_compiler}")
|
|
|
|
if not string.find(native, arch) then
|
|
|
|
rpm.define('debug_package %{nil}')
|
|
|
|
end
|
2022-02-02 20:35:25 +00:00
|
|
|
end
|
|
|
|
}
|
|
|
|
|
2023-10-05 02:48:27 +00:00
|
|
|
# Generate %package and %files definitions for a doc subpackage,
|
|
|
|
# containing content generated by odoc.
|
|
|
|
# Use on the top-level only, preferably just before %prep.
|
|
|
|
#
|
|
|
|
# Options:
|
|
|
|
# -L: specify the license file name. Example:
|
|
|
|
# %odoc_package -L LICENSE
|
|
|
|
%odoc_package(L:) %{expand:
|
|
|
|
%package doc
|
|
|
|
BuildArch: noarch
|
|
|
|
BuildRequires: ocaml-odoc
|
|
|
|
Summary: Documentation for %{name}
|
|
|
|
%description doc
|
|
|
|
Developer documentation for %{name}.
|
|
|
|
%files doc
|
|
|
|
%doc _build/default/_doc/_html/*
|
|
|
|
%{?-L:%%license %{-L*} %*}}
|