| |
@@ -1,30 +1,37 @@
|
| |
- Name: ocaml-dune
|
| |
- Version: 1.11.0
|
| |
- Release: 4%{?dist}
|
| |
- Summary: A composable build system for OCaml
|
| |
+ %global libname dune
|
| |
|
| |
- %global libname %(echo %{name} | sed -e 's/^ocaml-//')
|
| |
+ Name: ocaml-%{libname}
|
| |
+ Version: 2.1.0
|
| |
+ Release: 1%{?dist}
|
| |
+ Summary: A composable build system for OCaml
|
| |
|
| |
- # Dune itself is MIT, and there are bundled libs that are LGPLv2 with exceptions and ISC.
|
| |
- License: MIT and LGPLv2 with exceptions and ISC
|
| |
+ # Dune itself is MIT. Some bundled libraries have a different license:
|
| |
+ # ISC:
|
| |
+ # - vendor/cmdliner
|
| |
+ # LGPLv2:
|
| |
+ # - vendor/incremental-cycles
|
| |
+ # LGPLv2 with exceptions:
|
| |
+ # - vendor/opam-file-format
|
| |
+ # - vendor/re
|
| |
+ License: MIT and LGPLv2 and LGPLv2 with exceptions and ISC
|
| |
|
| |
URL: https://dune.build
|
| |
Source0: https://github.com/ocaml/%{libname}/archive/%{version}/%{libname}-%{version}.tar.gz
|
| |
-
|
| |
- # See: https://github.com/ocaml/dune/issues/2527
|
| |
- Patch1: 15c04b09a8c06871635d5fd98c3a37089bbde6d9.patch
|
| |
-
|
| |
- BuildRequires: ocaml >= 4.02.3
|
| |
- BuildRequires: ocaml-findlib-devel
|
| |
-
|
| |
- # Depend on /usr/bin/sphinx-build for python version invariance.
|
| |
- BuildRequires: /usr/bin/sphinx-build
|
| |
- BuildRequires: python3-sphinx_rtd_theme
|
| |
+ # Fix an unescaped asterisk misinterpreted as emphasis start
|
| |
+ # https://github.com/ocaml/dune/pull/2999
|
| |
+ Patch0: %{name}-doc-emphasis.patch
|
| |
+ # Use the Lisp lexer instead of Scheme when nonstandard characters are used
|
| |
+ # https://github.com/ocaml/dune/pull/3000
|
| |
+ Patch1: %{name}-doc-scheme.patch
|
| |
+
|
| |
+ BuildRequires: emacs
|
| |
+ BuildRequires: ocaml >= 4.07
|
| |
+ BuildRequires: ocaml-findlib
|
| |
+ BuildRequires: python3dist(sphinx)
|
| |
+ BuildRequires: python3dist(sphinx-rtd-theme)
|
| |
|
| |
# Required by tests.
|
| |
- BuildRequires: git
|
| |
BuildRequires: ocaml-menhir
|
| |
- BuildRequires: ocaml-result-devel
|
| |
|
| |
# Dune has vendored deps (ugh):
|
| |
# I'm not clear on how to unbundle them.
|
| |
@@ -32,7 +39,7 @@
|
| |
# doesn't seem to be able to detect libraries installed systemwide.
|
| |
# https://github.com/ocaml/dune/issues/220
|
| |
Provides: bundled(ocaml-opam-file-format) = 2.0.0
|
| |
- Provides: bundled(ocaml-cmdliner) = 1.0.2
|
| |
+ Provides: bundled(ocaml-cmdliner) = 1.0.3
|
| |
Provides: bundled(ocaml-re) = 1.7.1
|
| |
|
| |
Provides: dune = %{version}-%{release}
|
| |
@@ -68,95 +75,128 @@
|
| |
%description doc
|
| |
HTML documentation for dune, a composable build system for OCaml.
|
| |
|
| |
+ %package emacs
|
| |
+ Summary: Emacs support for %{name}
|
| |
+ License: ISC
|
| |
+ Requires: %{name} = %{version}-%{release}
|
| |
+
|
| |
+ BuildArch: noarch
|
| |
+
|
| |
+ %description emacs
|
| |
+ The %{name}-devel package contains Emacs integration with the dune build
|
| |
+ system, a mode to edit dune files, and flymake support for dune files.
|
| |
+
|
| |
%prep
|
| |
- # Restore autosetup once we have fixed this upstream issue:
|
| |
- # https://github.com/ocaml/dune/issues/2527
|
| |
- #autosetup -n %{libname}-%{version} -p1
|
| |
- %setup -n %{libname}-%{version}
|
| |
- %ifarch %{arm}
|
| |
- %patch1 -p1
|
| |
- %endif
|
| |
+ %autosetup -n %{libname}-%{version} -p1
|
| |
|
| |
%build
|
| |
- # The dune build script figures out if the native code compiler is available
|
| |
- # and uses it if it is, otherwise it uses the bytecode compiler. Thus I think
|
| |
- # we just need to "make" here.
|
| |
- %make_build release
|
| |
+ ./configure --libdir %{_libdir}/ocaml --mandir %{_mandir}
|
| |
+
|
| |
+ # This command fails, because ppx_bench, ppx_expect, and core_bench are missing.
|
| |
+ # However, it is only tests that fail, not the actual build, so ignore the
|
| |
+ # failures and continue.
|
| |
+ %make_build || :
|
| |
+ ./dune.exe build @install
|
| |
%make_build doc
|
| |
|
| |
+ %ifarch %{ocaml_native_compiler}
|
| |
+ # Relink the stublib. See https://github.com/ocaml/dune/issues/2977.
|
| |
+ cd _build/default/src/stdune
|
| |
+ ocamlmklib -g -ldopt "$RPM_LD_FLAGS" -o stdune_stubs fcntl_stubs.o
|
| |
+ cd -
|
| |
+ %endif
|
| |
+
|
| |
%install
|
| |
- # Dune's makefile has a "make install" target. Tragically, it uses opam-install(er)
|
| |
- # to install itself. Even more tragically, opam now requires dune to build.
|
| |
- # Therefore as a workaround we can just manually install things ourselves--
|
| |
- # Dune is *mostly* just a binary, making this easy.
|
| |
- mkdir -p %{buildroot}%{_bindir}
|
| |
- mkdir -p %{buildroot}%{_mandir}/man1
|
| |
- mkdir -p %{buildroot}%{_mandir}/man5
|
| |
-
|
| |
- cp -av _boot/default/bin/main/main_dune.exe %{buildroot}%{_bindir}/dune
|
| |
- ln -sfvbn dune %{buildroot}%{_bindir}/jbuilder
|
| |
- cp -av _boot/default/doc/*.1 %{buildroot}%{_mandir}/man1/
|
| |
- cp -av _boot/default/doc/*.5 %{buildroot}%{_mandir}/man5/
|
| |
-
|
| |
- # Dune also has libraries now, which need to be installed via the standard way.
|
| |
- mkdir -p %{buildroot}%{_libdir}/ocaml/%{libname}/
|
| |
- cp -aLr _boot/install/default/lib/%{libname}/* %{buildroot}%{_libdir}/ocaml/%{libname}/
|
| |
-
|
| |
- # Remove *.ml files from installation.
|
| |
- # This is a little annoying. ocaml/dune has a bunch of subdirectories that actually contain code.
|
| |
- # But the "_wp" subdirectory *itself* contains subdirectories with compiled code.
|
| |
- # So I've special-cased that one.
|
| |
- rm -fv %{buildroot}%{_libdir}/ocaml/%{libname}/*/*.ml
|
| |
- rm -fv %{buildroot}%{_libdir}/ocaml/%{libname}/_wp/*/*.ml
|
| |
+ # "make install" only installs the binary. We want the libraries, too.
|
| |
+ ./dune.exe install --destdir %{buildroot}
|
| |
+
|
| |
+ %ifarch %{ocaml_native_compiler}
|
| |
+ # Add missing executable bits
|
| |
+ find %{buildroot}%{_libdir}/ocaml -name \*.cmxs -exec chmod 0755 {} \+
|
| |
+ %endif
|
| |
+
|
| |
+ # Byte compile the Emacs files
|
| |
+ cd %{buildroot}%{_emacs_sitelispdir}
|
| |
+ %_emacs_bytecompile dune.el dune-flymake.el
|
| |
+ cd -
|
| |
|
| |
# Install documentation by way of pkgdocdir.
|
| |
+ rm -fr %{buildroot}%{_prefix}/doc
|
| |
mkdir -p %{buildroot}%{_pkgdocdir}/
|
| |
- cp -ar README.md CHANGES.md doc/_build/* %{buildroot}%{_pkgdocdir}/
|
| |
+ cp -ar README.md CHANGES.md MIGRATION.md doc/_build/* %{buildroot}%{_pkgdocdir}/
|
| |
|
| |
%check
|
| |
- # Do not run the unit tests which assume opam is installed.
|
| |
-
|
| |
- %{buildroot}%{_bindir}/dune --version
|
| |
+ # These are the only tests we can run. The others require components that
|
| |
+ # either depend on dune themselves or are not available in Fedora at all.
|
| |
+ %{buildroot}%{_bindir}/dune runtest test/unit-tests
|
| |
|
| |
%files
|
| |
%license LICENSE.md
|
| |
%doc %{_pkgdocdir}/README.md
|
| |
%doc %{_pkgdocdir}/CHANGES.md
|
| |
- %{_bindir}/jbuilder
|
| |
+ %doc %{_pkgdocdir}/MIGRATION.md
|
| |
%{_bindir}/dune
|
| |
%{_mandir}/man*/dune*
|
| |
- %dir %{_pkgdocdir}
|
| |
- %{_libdir}/ocaml/%{libname}
|
| |
+ %dir %{_pkgdocdir}/
|
| |
+ %dir %{_libdir}/ocaml/dune/
|
| |
+ %dir %{_libdir}/ocaml/dune-action-plugin/
|
| |
+ %dir %{_libdir}/ocaml/dune-build-info/
|
| |
+ %dir %{_libdir}/ocaml/dune-configurator/
|
| |
+ %dir %{_libdir}/ocaml/dune-glob/
|
| |
+ %dir %{_libdir}/ocaml/dune-private-libs/
|
| |
+ %dir %{_libdir}/ocaml/dune-private-libs/dune-lang/
|
| |
+ %dir %{_libdir}/ocaml/dune-private-libs/dune_re/
|
| |
+ %dir %{_libdir}/ocaml/dune-private-libs/ocaml-config/
|
| |
+ %dir %{_libdir}/ocaml/dune-private-libs/stdune/
|
| |
+ %{_libdir}/ocaml/dune*/META
|
| |
+ %{_libdir}/ocaml/dune*/*.cma
|
| |
+ %{_libdir}/ocaml/dune*/*.cmi
|
| |
+ %{_libdir}/ocaml/dune-private-libs/*/*.cma
|
| |
+ %{_libdir}/ocaml/dune-private-libs/*/*.cmi
|
| |
%ifarch %{ocaml_native_compiler}
|
| |
- %exclude %{_libdir}/ocaml/%{libname}/*/*.a
|
| |
- %exclude %{_libdir}/ocaml/%{libname}/*/*.cmxa
|
| |
- %exclude %{_libdir}/ocaml/%{libname}/*/*.cmx
|
| |
- %exclude %{_libdir}/ocaml/%{libname}/_wp/*/*.a
|
| |
- %exclude %{_libdir}/ocaml/%{libname}/_wp/*/*.cmxa
|
| |
- %exclude %{_libdir}/ocaml/%{libname}/_wp/*/*.cmx
|
| |
+ %{_libdir}/ocaml/dune*/*.cmxs
|
| |
+ %{_libdir}/ocaml/dune-private-libs/*/*.cmxs
|
| |
+ %{_libdir}/ocaml/stublibs/dllstdune_stubs.so
|
| |
%endif
|
| |
- %exclude %{_libdir}/ocaml/%{libname}/*/*.mli
|
| |
- %exclude %{_libdir}/ocaml/%{libname}/_wp/*/*.mli
|
| |
|
| |
%files devel
|
| |
+ %{_libdir}/ocaml/dune*/dune-package
|
| |
+ %{_libdir}/ocaml/dune*/opam
|
| |
+ %{_libdir}/ocaml/dune*/*.cmt
|
| |
+ %{_libdir}/ocaml/dune*/*.cmti
|
| |
+ %{_libdir}/ocaml/dune*/*.ml
|
| |
+ %{_libdir}/ocaml/dune*/*.mli
|
| |
+ %{_libdir}/ocaml/dune-private-libs/*/*.cmt
|
| |
+ %{_libdir}/ocaml/dune-private-libs/*/*.cmti
|
| |
+ %{_libdir}/ocaml/dune-private-libs/*/*.ml
|
| |
+ %{_libdir}/ocaml/dune-private-libs/*/*.mli
|
| |
%ifarch %{ocaml_native_compiler}
|
| |
- %{_libdir}/ocaml/%{libname}/*/*.a
|
| |
- %{_libdir}/ocaml/%{libname}/*/*.cmxa
|
| |
- %{_libdir}/ocaml/%{libname}/*/*.cmx
|
| |
- %{_libdir}/ocaml/%{libname}/_wp/*/*.a
|
| |
- %{_libdir}/ocaml/%{libname}/_wp/*/*.cmxa
|
| |
- %{_libdir}/ocaml/%{libname}/_wp/*/*.cmx
|
| |
+ %{_libdir}/ocaml/dune*/*.a
|
| |
+ %{_libdir}/ocaml/dune*/*.cmx
|
| |
+ %{_libdir}/ocaml/dune*/*.cmxa
|
| |
+ %{_libdir}/ocaml/dune-private-libs/*/*.a
|
| |
+ %{_libdir}/ocaml/dune-private-libs/*/*.cmx
|
| |
+ %{_libdir}/ocaml/dune-private-libs/*/*.cmxa
|
| |
%endif
|
| |
- %{_libdir}/ocaml/%{libname}/*/*.mli
|
| |
- # There do not seem to be headers in the _wp subdirectory.
|
| |
- #{_libdir}/ocaml/{libname}/_wp/*/*.mli
|
| |
|
| |
%files doc
|
| |
%exclude %{_pkgdocdir}/README.md
|
| |
%exclude %{_pkgdocdir}/CHANGES.md
|
| |
%doc %{_pkgdocdir}/*
|
| |
|
| |
+ %files emacs
|
| |
+ %{_emacs_sitelispdir}/dune*
|
| |
+
|
| |
%changelog
|
| |
+ * Sat Jan 4 2020 Jerry James <loganjerry@gmail.com> - 2.1.0-1
|
| |
+ - New version 2.1.0 (bz 1742638)
|
| |
+ - Invoke the configure script (bz 1740196)
|
| |
+ - Add LGPLv2 to License due to incremental-cycles
|
| |
+ - Add -emacs subpackage and byte compile the Emacs Lisp files
|
| |
+ - Drop upstreamed 15c04b09a8c06871635d5fd98c3a37089bbde6d9.patch
|
| |
+ - Add -doc-emphasis and -doc-scheme patches
|
| |
+ - Run the unit tests in %%check
|
| |
+
|
| |
* Fri Dec 06 2019 Richard W.M. Jones <rjones@redhat.com> - 1.11.0-4
|
| |
- OCaml 4.09.0 (final) rebuild.
|
| |
|
| |
I want to add the Jane Street stdio module to Fedora, but it requires dune >= 2.0.0. Note that version 2.0.0 drops the %{_bindir}/jbuilder compatibility name. That will break these Fedora packages, at a minimum, but all are easily fixed:
- ocaml-benchmark (version 1.6 uses dune)
- ocaml-camomile (just need to invoke dune instead of jbuilder)
- ocaml-lwt-log (ditto)
- ocaml-mccs (ditto)
- ocaml-qtest (ditto)