#1 Update to re 1.7.3, switch to jbuilder for buildsystem
Merged 5 years ago by rjones. Opened 5 years ago by tc01.
rpms/ tc01/ocaml-re update_to_jbuilder  into  master

file modified
+25 -14
@@ -5,8 +5,8 @@ 

  %endif

  

  Name:           ocaml-re

- Version:        1.7.1

- Release:        6%{?dist}

+ Version:        1.7.3

+ Release:        1%{?dist}

  Summary:        A regular expression library for OCaml

  

  License:        LGPLv2 with exceptions
@@ -18,6 +18,8 @@ 

  BuildRequires:  ocaml-ocamldoc

  BuildRequires:  ocaml-ocamlbuild

  

+ BuildRequires:  jbuilder

+ 

  %description

  A pure OCaml regular expression library. Supports Perl-style regular

  expressions, Posix extended regular expressions, Emacs-style regular
@@ -38,23 +40,30 @@ 

  %setup -q -n ocaml-re-%{version}

  

  %build

- ./configure --prefix %{prefix}

- make %{?_smp_mflags}

- make doc

+ jbuilder build -p re %{?_smp_mflags}

  

  %install

- export OCAMLFIND_DESTDIR=$RPM_BUILD_ROOT%{_libdir}/ocaml

- mkdir -p $OCAMLFIND_DESTDIR

- make install

  

- # We want to manually get the documentation anyway especially

- # since documentation gets put in _docdir/re by buildsystem.

- rm -rf %{buildroot}%{_docdir}/re/

+ # jbuilder/dune 1.0+ supports installing without opam-installer,

+ # which means in theory we could do something like the below even for

+ # "ocaml critical path" packages (e.g. dependencies of opam and opam-installer).

+ 

+ # However... in this package it seems to stop RPM from finding debug info

+ # correctly. I am not sure why. :(

+ 

+ #export OCAMLFIND_DESTDIR=$RPM_BUILD_ROOT%{_libdir}/ocaml

+ #mkdir -p $OCAMLFIND_DESTDIR

+ #jbuilder install --destdir %{buildroot}

+ #rm -r %{buildroot}/doc/re/

+ 

+ # So use the "manual jbuilder install" technique instead.

+ mkdir -p %{buildroot}%{_libdir}/ocaml

+ cp -aLr _build/install/default/lib/* %{buildroot}%{_libdir}/ocaml/

  

  %files

- %doc CHANGES

+ %doc CHANGES.md

  %doc README.md

- %license LICENSE

+ %license LICENSE.md

  %{_libdir}/ocaml/re

  %if %{native_compiler}

  %exclude %{_libdir}/ocaml/re/*.a
@@ -64,7 +73,6 @@ 

  %exclude %{_libdir}/ocaml/re/*.mli

  

  %files devel

- %doc re-api.docdir/*

  %if %{native_compiler}

  %{_libdir}/ocaml/re/*.a

  %{_libdir}/ocaml/re/*.cmx
@@ -73,6 +81,9 @@ 

  %{_libdir}/ocaml/re/*.mli

  

  %changelog

+ * Tue Aug 07 2018 Ben Rosser <rosser.bjr@gmail.com> - 1.7.3-1

+ - Update to 1.7.3, switch to jbuilder.

+ 

  * Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.7.1-6

  - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

  

This updates to ocaml-re 1.7.3, which involves switching the package to use "jbuilder" (now known as "dune") as its build system.

This update is unfortunately necessary in order to build recent releases of opam on Fedora 29, because re 1.7.2 includes this change: "Deprecate all Re_* modules. Re_x is now available as Re.X". And opam >= 2.0.0-rc2 has switched to using "Re.X" to refer to the re modules.

It would be awesome if re could be updated to at least 1.7.3 on Fedora 30 and Fedora 29 soon, so I can build opam (opam is currently FTBFS, because older versions of opam seem to no longer build for other reasons.

There has since been a release of ocaml-re 1.8.0, but I didn't want to jump too far ahead.

As far as I know, the only dependencies on ocaml-re are ocaml-dose3 and opam.

Pull-Request has been merged by rjones

5 years ago