Blob Blame History Raw
Name:           ocaml-lwt
Version:        5.1.2
Release:        4%{?dist}
Summary:        OCaml lightweight thread library

# The openssl linking exception is granted.
License:        LGPLv2+ with exceptions
URL:            http://ocsigen.org/lwt
Source0:        https://github.com/ocsigen/lwt/archive/%{version}/lwt-%{version}.tar.gz

# Fix for OCaml 4.10.
# Sent upstream on 2020-02-25.
Patch1:         lwt-5.1.2-bytes.patch

BuildRequires:  ocaml >= 4.02.0
BuildRequires:  ocaml-findlib

BuildRequires:  dune
BuildRequires:  ocaml-dune-devel
BuildRequires:  ocaml-cppo
BuildRequires:  ocaml-result-devel
BuildRequires:  ocaml-seq-devel
BuildRequires:  ocaml-bisect-ppx-devel

# lwt.unix dependencies
BuildRequires:  ocaml-mmap-devel
BuildRequires:  ocaml-ocplib-endian-devel

# lwt_react dependencies.
BuildRequires:  ocaml-react-devel

# lwt_ppx dependencies.
BuildRequires:  ocaml-migrate-parsetree-devel
BuildRequires:  ocaml-ppx-tools-versioned-devel >= 5.2.3
BuildRequires:  ocaml-ppx-derivers-devel

#BuildRequires:  chrpath
BuildRequires:  glib2-devel
BuildRequires:  libev-devel


%description
Lwt is a lightweight thread library for Objective Caml.  This library
is part of the Ocsigen project.

%package        devel
Summary:        Development files for %{name}
Requires:       %{name}%{?_isa} = %{version}-%{release}
# This is probably a packaging or dependency bug, but if we don't
# have it then any package that builds using LWT fails with:
# ocamlfind: Package `seq' not found - required by `lwt'
Requires:       ocaml-seq-devel%{?_isa}
Requires:       libev-devel%{?_isa}

%description    devel
The %{name}-devel package contains libraries and signature files for
developing applications that use %{name}.

%package        react
Summary:        Helpers for using React with Lwt
Requires:       %{name}%{?_isa} = %{version}-%{release}

%description    react
Helpers for using React with Lwt.

%package        react-devel
Summary:        Development files for ocaml-lwt-react

Requires:       %{name}-react%{?_isa} = %{version}-%{release}
Requires:       %{name}-devel%{?_isa} = %{version}-%{release}

%description    react-devel
The %{name}-react-devel package contains libraries and signature files for
developing applications that use %{name}-react.

%package        ppx
Summary:        PPX syntax for Lwt
Requires:       %{name}%{?_isa} = %{version}-%{release}

%description    ppx
PPX syntax for Lwt, providing something similar to async/await from JavaScript.

%package        ppx-devel
Summary:        Development files for ocaml-lwt-ppx

Requires:       %{name}-ppx%{?_isa} = %{version}-%{release}
Requires:       %{name}-devel%{?_isa} = %{version}-%{release}

%description    ppx-devel
The %{name}-ppx-devel package contains libraries and signature files for
developing applications that use %{name}-ppx.

%prep
%setup -q -n lwt-%{version}
%patch1 -p0

# Enable libev and pthread.
sed 's/-use-libev false/-use-libev true -use-pthread true/g' -i Makefile

# Remove '-dev' from the jbuilder command line.
# This stops 'ambiguous documentation comment' from being a fatal error.
sed 's/build --dev/build/g' -i Makefile
sed 's/runtest --dev/runtest/g' -i Makefile

# It looks like one test fails.
# Actually, it looks like all the "mcast" tests fail in koji.
# They should probably be disabled via a patch, but this works for now.
sed 's,test_mcast "mcast-join-loop" true true;,(*test_mcast "mcast-join-loop" true true;*),' -i test/unix/test_mcast.ml
sed 's,test_mcast "mcast-join-noloop" true false;,(*test_mcast "mcast-join-noloop" true false;*),' -i test/unix/test_mcast.ml
sed 's,test_mcast "mcast-nojoin-loop" false true;,(*test_mcast "mcast-nojoin-loop" false true;*),' -i test/unix/test_mcast.ml
sed 's,test_mcast "mcast-nojoin-noloop" false false;,(*test_mcast "mcast-nojoin-noloop" false false;*),' -i test/unix/test_mcast.ml

# Some lwt.unix tests fail because we can't seem to look up the
# user/group name from inside koji. I guess that makes sense?
# Those tests have guards not to run on win32; we can hack them to not run here either.
sed 's,Sys.win32 && not is_wsl,Sys.unix,g' -i test/unix/test_lwt_unix.cppo.ml

%build
dune build --profile=release --verbose

# Relink the stublib with RPM_LD_FLAGS
cd _build/default/src/unix
ocamlmklib -g -ldopt "$RPM_LD_FLAGS" -lev -lpthread -lm -o lwt_unix_stubs \
  $(ar t liblwt_unix_stubs.a)
cd -

%install
dune install --profile=release --destdir %{buildroot}

#chrpath --delete $OCAMLFIND_DESTDIR/stublibs/dll*.so

# Remove spurious jbuilder-installed documentation.
rm -rf %{buildroot}/%{_prefix}/doc

%ifarch %{ocaml_native_compiler}
# Add missing executable bits
find %{buildroot}%{_libdir}/ocaml -name \*.cmxs -exec chmod 0755 {} \+
%endif

%check
dune runtest --profile=release

%files
%doc CHANGES README.md
%license LICENSE.md
%dir %{_libdir}/ocaml/lwt/
%dir %{_libdir}/ocaml/lwt/unix/
%{_libdir}/ocaml/lwt/META
%{_libdir}/ocaml/lwt/dune-package
%{_libdir}/ocaml/lwt/opam
%{_libdir}/ocaml/lwt/*.cma
%{_libdir}/ocaml/lwt/*.cmi
%{_libdir}/ocaml/lwt/unix/*.cma
%{_libdir}/ocaml/lwt/unix/*.cmi
%ifarch %{ocaml_native_compiler}
%{_libdir}/ocaml/lwt/*.cmxs
%{_libdir}/ocaml/lwt/unix/*.cmxs
%endif
%{_libdir}/ocaml/stublibs/*.so

%files devel
%doc CHANGES README.md
%ifarch %{ocaml_native_compiler}
%{_libdir}/ocaml/lwt/*.a
%{_libdir}/ocaml/lwt/*.cmxa
%{_libdir}/ocaml/lwt/*.cmx
%{_libdir}/ocaml/lwt/unix/*.a
%{_libdir}/ocaml/lwt/unix/*.cmxa
%{_libdir}/ocaml/lwt/unix/*.cmx
%endif
%{_libdir}/ocaml/lwt/*.cmt
%{_libdir}/ocaml/lwt/*.cmti
%{_libdir}/ocaml/lwt/*.ml
%{_libdir}/ocaml/lwt/*.mli
%{_libdir}/ocaml/lwt/unix/*.cmt
%{_libdir}/ocaml/lwt/unix/*.cmti
%{_libdir}/ocaml/lwt/unix/*.h
%{_libdir}/ocaml/lwt/unix/*.ml
%{_libdir}/ocaml/lwt/unix/*.mli

%files react
%doc CHANGES README.md
%license LICENSE.md
%dir %{_libdir}/ocaml/lwt_react/
%{_libdir}/ocaml/lwt_react/META
%{_libdir}/ocaml/lwt_react/dune-package
%{_libdir}/ocaml/lwt_react/opam
%{_libdir}/ocaml/lwt_react/*.cma
%{_libdir}/ocaml/lwt_react/*.cmi
%ifarch %{ocaml_native_compiler}
%{_libdir}/ocaml/lwt_react/*.cmxs
%endif

%files react-devel
%doc CHANGES README.md
%ifarch %{ocaml_native_compiler}
%{_libdir}/ocaml/lwt_react/*.a
%{_libdir}/ocaml/lwt_react/*.cmxa
%{_libdir}/ocaml/lwt_react/*.cmx
%endif
%{_libdir}/ocaml/lwt_react/*.cmt
%{_libdir}/ocaml/lwt_react/*.cmti
%{_libdir}/ocaml/lwt_react/*.ml
%{_libdir}/ocaml/lwt_react/*.mli

%files ppx
%dir %{_libdir}/ocaml/lwt_ppx/
%{_libdir}/ocaml/lwt_ppx/META
%{_libdir}/ocaml/lwt_ppx/dune-package
%{_libdir}/ocaml/lwt_ppx/opam
%{_libdir}/ocaml/lwt_ppx/ppx.exe
%{_libdir}/ocaml/lwt_ppx/*.cma
%{_libdir}/ocaml/lwt_ppx/*.cmi
%ifarch %{ocaml_native_compiler}
%{_libdir}/ocaml/lwt_ppx/*.cmxs
%endif

%files ppx-devel
%doc CHANGES README.md
%ifarch %{ocaml_native_compiler}
%{_libdir}/ocaml/lwt_ppx/*.a
%{_libdir}/ocaml/lwt_ppx/*.cmxa
%{_libdir}/ocaml/lwt_ppx/*.cmx
%endif
%{_libdir}/ocaml/lwt_ppx/*.cmt
%{_libdir}/ocaml/lwt_ppx/*.cmti
%{_libdir}/ocaml/lwt_ppx/*.ml
%{_libdir}/ocaml/lwt_ppx/*.mli


%changelog
* Fri Apr 03 2020 Richard W.M. Jones <rjones@redhat.com> - 5.1.2-4
- Update all OCaml dependencies for RPM 4.16.

* Thu Mar  5 2020 Jerry James <loganjerry@gmail.com> - 5.1.2-3
- Link the stublib with RPM_LD_FLAGS
- Add the executable bit to cmxs files
- Require libev-devel from the devel subpackage
- Require ocaml-lwt-devel from ocaml-lwt-{react,ppx}-devel
- Refactor the %files lists

* Wed Feb 26 2020 Richard W.M. Jones <rjones@redhat.com> - 5.1.2-2
- OCaml 4.10.0 final.

* Tue Feb 25 2020 Richard W.M. Jones <rjones@redhat.com> - 5.1.2-1
- New upstream version 5.1.2.
- Add trivial patch to fix OCaml 4.10 build.
- +BR ocaml-bisect-ppx-devel.

* Fri Jan 31 2020 Richard W.M. Jones <rjones@redhat.com> - 4.4.0-7
- Bump release and rebuild.

* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 4.4.0-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild

* Sun Jan 19 2020 Richard W.M. Jones <rjones@redhat.com> - 4.4.0-5
- Bump release and rebuild.

* Sun Jan 19 2020 Richard W.M. Jones <rjones@redhat.com> - 4.4.0-4
- Bump release and rebuild.

* Sun Jan 19 2020 Richard W.M. Jones <rjones@redhat.com> - 4.4.0-3
- OCaml 4.10.0+beta1 rebuild.

* Sun Jan 12 2020 Robert-André Mauchin <zebob.m@gmail.com> - 4.4.0-2
- OCaml 4.09.0 (final) rebuild.

* Tue Oct 15 2019 Ben Rosser <rosser.bjr@gmail.com> - 4.4.0-1
- Update to latest upstream release, 4.4.0 (rhbz#1755859).

* Tue Oct 01 2019 Ben Rosser <rosser.bjr@gmail.com> - 4.3.1-1
- Update to latest upstream release; reenable tests.

* Wed Aug 21 2019 Richard W.M. Jones <rjones@redhat.com> - 4.3.0-1
- New upstream version 4.3.0.
- Remove patches from git which were unused and unapplied.

* Fri Aug 16 2019 Richard W.M. Jones <rjones@redhat.com> - 4.2.1-6
- Fix previous commit.

* Fri Aug 16 2019 Richard W.M. Jones <rjones@redhat.com> - 4.2.1-5
- Add Requires: ocaml-seq-devel to devel subpackage.

* Fri Aug 16 2019 Richard W.M. Jones <rjones@redhat.com> - 4.2.1-4
- OCaml 4.08.1 (final) rebuild.

* Wed Aug 07 2019 Ben Rosser <rosser.bjr@gmail.com> - 4.2.1-3
- Add BuildRequires on ocaml-mmap.

* Thu Aug 01 2019 Richard W.M. Jones <rjones@redhat.com> - 4.2.1-2
- OCaml 4.08.1 (rc2) rebuild.

* Sun Jul 28 2019 Richard W.M. Jones <rjones@redhat.com> - 4.2.1-1
- New upstream version 4.2.1.

* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 4.1.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild

* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 4.1.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild

* Thu Sep 27 2018 Ben Rosser <rosser.bjr@gmail.com> - 4.1.0-1
- Updated to 4.1.0, using jbuilder/dune as buildsystem. (rhbz#1289549).
- lwt_react and lwt_ppx are now separate opam packages, built from this tarball.
- Split lwt_react and lwt_ppx into ocaml-lwt-react and ocaml-lwt-ppx subpackages.

* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.5.0-21
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

* Wed Jul 11 2018 Richard W.M. Jones <rjones@redhat.com> - 2.5.0-20
- OCaml 4.07.0 (final) rebuild.

* Wed Jun 20 2018 Richard W.M. Jones <rjones@redhat.com> - 2.5.0-19
- OCaml 4.07.0-rc1 rebuild.

* Thu Feb 08 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.5.0-18
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Fri Nov 17 2017 Richard W.M. Jones <rjones@redhat.com> - 2.5.0-17
- OCaml 4.06.0 rebuild.

* Tue Oct 03 2017 Richard W.M. Jones <rjones@redhat.com> - 2.5.0-16
- Rebuild against new ocaml-ssl.

* Tue Aug 08 2017 Richard W.M. Jones <rjones@redhat.com> - 2.5.0-15
- OCaml 4.05.0 rebuild.

* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.5.0-13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild

* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.5.0-12
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Tue Jun 27 2017 Richard W.M. Jones <rjones@redhat.com> - 2.5.0-11
- Bump release and rebuild.

* Mon Jun 26 2017 Richard W.M. Jones <rjones@redhat.com> - 2.5.0-10
- OCaml 4.04.2 rebuild.

* Fri May 12 2017 Richard W.M. Jones <rjones@redhat.com> - 2.5.0-9
- OCaml 4.04.1 rebuild.

* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.5.0-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Wed Nov 09 2016 Dan Horák <dan@danny.cz> - 2.5.0-7
- rebuild for s390x codegen bug

* Mon Nov 07 2016 Richard W.M. Jones <rjones@redhat.com> - 2.5.0-6
- Rebuild for OCaml 4.04.0.
- Add explicit dependency on ocamlbuild.

* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 2.5.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Sun Aug  2 2015 Michel Alexandre Salim <salimma@fedoraproject.org> - 2.5.0-4
- Re-enable React (fixes bz# 1249307)

* Tue Jul 28 2015 Richard W.M. Jones <rjones@redhat.com> - 2.5.0-3
- OCaml 4.02.3 rebuild.

* Fri Jul 24 2015 Richard W.M. Jones <rjones@redhat.com> - 2.5.0-2
- Enable building the syntax extension.
- Fix Source URL.

* Wed Jul 22 2015 Richard W.M. Jones <rjones@redhat.com> - 2.5.0-1
- New version 2.5.0.
- Enable bytecode builds.

* Wed Jun 24 2015 Richard W.M. Jones <rjones@redhat.com> - 2.4.5-6
- ocaml-4.02.2 final rebuild.

* Wed Jun 17 2015 Richard W.M. Jones <rjones@redhat.com> - 2.4.5-5
- ocaml-4.02.2 rebuild.

* Tue Feb 17 2015 Richard W.M. Jones <rjones@redhat.com> - 2.4.5-4
- ocaml-4.02.1 rebuild.

* Sun Aug 31 2014 Richard W.M. Jones <rjones@redhat.com> - 2.4.5-3
- ocaml-4.02.0 final rebuild.

* Sat Aug 23 2014 Richard W.M. Jones <rjones@redhat.com> - 2.4.5-2
- ocaml-4.02.0+rc1 rebuild.

* Mon Aug 18 2014 Scott Tsai <scottt.tw@gmail.com> 2.4.5-1
- New upstream version 2.4.5 (tarball created from tag through github https://github.com/ocsigen/lwt/tags)
- Remove patches which are now upstream.
- Disable ocaml-react support since it breaks the build (https://github.com/ocsigen/lwt/issues/77)
- Remove manual.pdf for now since tarballs from git tags don't include the pre-built documentation

* Mon Aug 18 2014 Scott Tsai <scottt.tw@gmail.com> - 2.4.3-12
- Add lwt-fix-ocaml-camlp4-19.patch to fix OCaml 4.02+ build failure
- Rebuild for ocaml-4.02.0-0.8.git10e45753.fc22.

* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.4.3-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild

* Sat Aug 09 2014 Richard W.M. Jones <rjones@redhat.com> - 2.4.3-10
- ocaml-4.02.0-0.8.git10e45753.fc22 rebuild.

* Tue Jul 22 2014 Richard W.M. Jones <rjones@redhat.com> - 2.4.3-9
- OCaml 4.02.0 beta rebuild.

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.4.3-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Tue Apr 15 2014 Richard W.M. Jones <rjones@redhat.com> - 2.4.3-7
- Remove ocaml_arches macro (RHBZ#1087794).

* Tue Apr 15 2014 Richard W.M. Jones <rjones@redhat.com> - 2.4.3-6
- Remove ocaml_arches macro (RHBZ#1087794).

* Fri Jan  3 2014 Richard W.M. Jones <rjones@redhat.com> - 2.4.3-5
- Enable lwt.react support, and check it gets enabled (RHBZ#1048367).
- Remove libev patch since headers are back to normal location
  in libev >= 4.15-3.

* Wed Sep 18 2013 Jerry James <loganjerry@gmail.com> - 2.4.3-4
- Rebuild for OCaml 4.01.0, and add -ocaml41 patch to adapt to changes
- Enable debuginfo
- Enable glib integration
- Add check script
- Add manual to -devel subpackage
- Minor spec file cleanups

* Sat Sep 14 2013 Scott Tsai <scottt.tw@gmail.com> - 2.4.3-3
- New upstream version 2.4.3

* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.4.2-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.4.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* Tue Oct 30 2012 Richard W.M. Jones <rjones@redhat.com> - 2.4.2-1
- New upstream version 2.4.2.
- Rebuild for OCaml 4.00.1.
- Remove patches which are now upstream.
- Clean up spec file.

* Mon Jul 30 2012 Richard W.M. Jones <rjones@redhat.com> - 2.3.2-7
- Rebuild for OCaml 4.00.0 official.

* Fri Jul 20 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.3.2-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Thu Jun 14 2012 Scott Tsai <scottt.tw@gmail.com> - 2.3.2-5
- Patch myocamlobuild.ml in lwt-2.3.2-ocaml-4.patch to
  add compiler-libs to search patch for "Toploop".
- Add oasis-common.patch to make setup.ml work on OCaml 4.00.0
- Both patches from https://sympa.inria.fr/sympa/arc/caml-list/2012-05/msg00223.html

* Mon Jun 11 2012 Richard W.M. Jones <rjones@redhat.com> - 2.3.2-4
- Patch for OCaml 4.00.0.

* Sun Jun 10 2012 Richard W.M. Jones <rjones@redhat.com> - 2.3.2-3
- Rebuild for OCaml 4.00.0.

* Sat Jan 07 2012 Richard W.M. Jones <rjones@redhat.com> - 2.3.2-2
- Rebuild for OCaml 3.12.1.

* Thu Dec 08 2011 Scott Tsai scottt.tw@gmail.com - 2.3.2-1
- New upstream version 2.3.2. 

* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.2.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Thu Jan  6 2011 Richard W.M. Jones <rjones@redhat.com> - 2.2.0-1
- New upstream version 2.2.0.
- Rebuild for OCaml 3.12.0.
- Add BR libev-devel.
- Patch <ev.h> -> <libev/ev.h>
- *.cmx files are no longer being distributed.
- No VERSION file.

* Wed Dec 30 2009 Richard W.M. Jones <rjones@redhat.com> - 2.0.0-0.3.rc1
- Rebuild for OCaml 3.11.2.

* Mon Oct 12 2009 Richard W.M. Jones <rjones@redhat.com> - 2.0.0-0.2.rc1.fc13
- ocaml-react is now in Fedora, so build this package.
- Missing BR on camlp4.

* Thu Oct  8 2009 Richard W.M. Jones <rjones@redhat.com> - 2.0.0-0.rc1.fc13
- New upstream version 2.0.0+rc1.
- NB. This cannot be built as it depends on new package ocaml-react
  (RHBZ#527971).

* Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.0-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Sat May 23 2009 Richard W.M. Jones <rjones@redhat.com> - 1.1.0-5
- Rebuild for OCaml 3.11.1

* Thu Apr 16 2009 S390x secondary arch maintainer <fedora-s390x@lists.fedoraproject.org>
- ExcludeArch sparc64, s390, s390x as we don't have OCaml on those archs
  (added sparc64 per request from the sparc maintainer)

* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

* Thu Dec  4 2008 Richard W.M. Jones <rjones@redhat.com> - 1.1.0-3
- Rebuild.

* Wed Sep  3 2008 Richard W.M. Jones <rjones@redhat.com> - 1.1.0-2
- Rebuild with higher EVR than F-9 branch.

* Mon Sep  1 2008 Richard W.M. Jones <rjones@redhat.com> - 1.1.0-1
- Initial RPM release.