From 627013735c6d0bc438124f7f54f36b5d6414081d Mon Sep 17 00:00:00 2001 From: Jerry James Date: Dec 28 2021 18:56:08 +0000 Subject: New upstream version 1.2.14 - Drop upstreamed mpfr4 patch - Invoke the configure script and simplify the spec file accordingly --- diff --git a/README.md b/README.md new file mode 100644 index 0000000..d8aebfd --- /dev/null +++ b/README.md @@ -0,0 +1,8 @@ +# ocaml-mlgmpidl + +[MLGMPIDL](https://github.com/nberth/mlgmpidl) is an OCaml interface to the +GMP and MPFR rational and real number math libraries. Although there is +another such interface, this one is different in that it provides a more +imperative (rather than functional) interface to conserve memory and that this +one uses CAMLIDL to take care of the C/OCaml interface in a convenient and +modular way. diff --git a/ocaml-mlgmpidl-mpfr4.patch b/ocaml-mlgmpidl-mpfr4.patch deleted file mode 100644 index a9d22a8..0000000 --- a/ocaml-mlgmpidl-mpfr4.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/mpfr.idl 2019-06-05 08:14:51.000000000 -0600 -+++ b/mpfr.idl 2019-07-17 15:24:31.943682738 -0600 -@@ -222,7 +222,7 @@ int mpfr_pow (mpfr_ptrm ROP, mpfr_ptr OP - int mpfr_neg (mpfr_ptrm ROP, mpfr_ptr OP, mpfr_rnd_t RND); - int mpfr_abs (mpfr_ptrm ROP, mpfr_ptr OP, mpfr_rnd_t RND); - int mpfr_cbrt (mpfr_ptrm ROP, mpfr_ptr OP, mpfr_rnd_t RND); --int mpfr_root (mpfr_ptrm ROP, mpfr_ptr OP1, unsigned long int OP2, mpfr_rnd_t RND); -+int mpfr_rootn_ui (mpfr_ptrm ROP, mpfr_ptr OP1, unsigned long int OP2, mpfr_rnd_t RND); - - quote(MLMLI,"\n(** {2 Comparison Functions} *)") - quote(MLMLI,"(** {{:http://www.mpfr.org/mpfr-current/mpfr.html#Comparison-Functions}C documentation} *)\n") diff --git a/ocaml-mlgmpidl.spec b/ocaml-mlgmpidl.spec index 207b2f8..4ebb22d 100644 --- a/ocaml-mlgmpidl.spec +++ b/ocaml-mlgmpidl.spec @@ -1,8 +1,10 @@ %global srcname mlgmpidl +%global ocaml_lib_dir %{_libdir}/ocaml +%global my_ocaml_lib_dir %{ocaml_lib_dir}/gmp Name: ocaml-%{srcname} -Version: 1.2.12 -Release: 14%{?dist} +Version: 1.2.14 +Release: 1%{?dist} Summary: OCaml interface to GMP and MPFR libraries # The license includes a linking exception License: LGPLv2 with exceptions @@ -12,17 +14,14 @@ Source0: https://github.com/nberth/mlgmpidl/archive/%{version}/%{srcname} Source1: mlgmpidl_test.ml Source2: mlgmpidl_test_result -# Adapt to mpfr 4 -Patch0: %{name}-mpfr4.patch - # We cannot use LDFLAGS to pass RPM_LD_FLAGS into the Makefile, because it # passes them unmodified to both ocamlopt and ocamlmklib. The latter needs # to have them guarded with -ldopt. Therefore, we splice the flags into the # Makefile at strategic locations. -Patch1: %{name}-ldflags.patch +Patch0: %{name}-ldflags.patch -BuildRequires: make BuildRequires: gcc +BuildRequires: make BuildRequires: ocaml BuildRequires: ocaml-ocamldoc BuildRequires: ocaml-findlib @@ -74,60 +73,35 @@ fi # Insert our linker flags; see patch1 above sed -i "s|@LDFLAGS@|$RPM_LD_FLAGS|" Makefile +# Build with debug information +sed -i 's/^OCAMLOPTFLAGS = -annot/& -g/' Makefile.config.in -%build -mv Makefile.config.model Makefile.config +# Do not force -O3 +sed -i 's/ -O3//' configure -# Look for ocaml tools in the right place and build with debug information -sed -e 's,\$(CAML_PREFIX)/bin,%{_bindir},' \ - -e 's/^OCAMLOPTFLAGS = -annot/& -g/' \ - -i Makefile.config -%ifarch %{ocaml_native_compiler} -# Build a cmxs -sed -i '/HAS_SHARED=1/a\\nHAS_NATIVE_PLUGINS=1' Makefile.config +%build +%set_build_flags +# This is not an autoconf-generated script. Do NOT use %%configure. +./configure \ +%ifnarch %{ocaml_native_compiler} + -no-native-plugins \ %endif - -%ifarch %{ocaml_native_profiling} -echo 'ENABLE_PROF = 1' >> Makefile.config -%else -echo 'ENABLE_PROF = 0' >> Makefile.config +%ifnarch %{ocaml_native_profiling} + -disable-profiling \ %endif - -%global ocaml_lib_dir %{_libdir}/ocaml -%global my_ocaml_lib_dir %{ocaml_lib_dir}/gmp + -gmp-prefix %{_prefix} \ + -mpfr-prefix %{_prefix} \ + -prefix %{ocaml_lib_dir} # Upstream Makefile is NOT safe to be called in parallel. -unset MAKEFLAGS - -%global make1 \\\ -make MLGMPIDL_PREFIX=%{_prefix} GMP_PREFIX=%{_prefix} \\\ - MFPR_PREFIX=%{_prefix} CAML_PREFIX=%{ocaml_lib_dir} \\\ - CAMLIDL_PREFIX=%{ocaml_lib_dir} %ifarch %{ocaml_native_compiler} -%global make \\\ -%make1 \\\ - OCAMLC=ocamlc.opt OCAMLOPT=ocamlopt.opt \\\ - OCAMLLEX=ocamllex.opt OCAMLDOC=ocamldoc.opt \\\ - CFLAGS="%{optflags} -fPIC -DNDEBUG" \\\ - CFLAGS_DEBUG="%{optflags} -fPIC -UNDEBUG" \\\ - CFLAGS_PROF="%{optflags} -fPIC -DNDEBUG -pg" +make all %else -%global make \\\ -%make1 \\\ - OCAMLC=ocamlc HAS_OCAMLOPT= \\\ - OCAMLLEX=ocamllex OCAMLDOC=ocamldoc \\\ - CFLAGS="%{optflags} -DNDEBUG" \\\ - CFLAGS_DEBUG="%{optflags} -UNDEBUG" \\\ - CFLAGS_PROF="%{optflags} -DNDEBUG -pg" +make byte %endif -%ifarch %{ocaml_native_compiler} -%make all -%else -%make byte -%endif -%make mlgmpidl.pdf -%make html +make mlgmpidl.pdf +make html %check @@ -144,7 +118,7 @@ unset MAKEFLAGS # so that it works. export MLGMPIDL_PREFIX=$RPM_BUILD_ROOT%{_prefix} export DESTDIR=$RPM_BUILD_ROOT -export OCAMLFIND_DESTDIR=$RPM_BUILD_ROOT%{_libdir}/ocaml +export OCAMLFIND_DESTDIR=$RPM_BUILD_ROOT%{ocaml_lib_dir} mkdir -p $OCAMLFIND_DESTDIR $OCAMLFIND_DESTDIR/stublibs %ifarch %{ocaml_native_compiler} @@ -189,6 +163,11 @@ cp -p opam/opam $RPM_BUILD_ROOT%{my_ocaml_lib_dir} %changelog +* Mon Dec 26 2021 Jerry James - 1.2.14-1 +- New upstream version 1.2.14 +- Drop upstreamed mpfr4 patch +- Invoke the configure script and simplify the spec file accordingly + * Mon Oct 04 2021 Richard W.M. Jones - 1.2.12-14 - OCaml 4.13.1 build diff --git a/sources b/sources index 3e5219f..516b431 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (mlgmpidl-1.2.12.tar.gz) = 5c3b959afb56c6ddafab33096ed1168fe6bc264a5b6fd58bedac1ef1cb275c7cf461861912f85ea2fd48cafaa1670931848f1231822ade5b77ed2a63e20267f0 +SHA512 (mlgmpidl-1.2.14.tar.gz) = cd1d937583914d999ecaf10279350918684d9b0a39c347b5641d9e0f9b3189cdf1fcaf1d9d8a74e4c09a3e88814aa3f95e325544d7c6fdb541c53ab90167d273