The package rpms/ocaml-mlgmpidl.git has added or updated architecture specific content in
its
spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s):
https://src.fedoraproject.org/cgit/rpms/ocaml-mlgmpidl.git/commit/?id=f67....
Change:
+%ifarch %{ocaml_native_compiler}
Thanks.
Full change:
============
commit f67c966c6c34570a4bfd20c77cac500d1c905a6e
Author: Jerry James <loganjerry(a)gmail.com>
Date: Sun Dec 3 20:31:19 2017 -0700
New upstream version 1.2.6-1.
Also:
- Drop upstreamed patches 0001, 0002, 0003, and 0004.
- Ensure that patch 0005 is in the srpm regardless of build arch.
- Use the upstream way of building a cmxs.
diff --git a/.gitignore b/.gitignore
index d1e0b45..56c19d0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,3 +2,4 @@
/mlgmpidl-20150204.tar.gz
/mlgmpidl-20150921.tar.gz
/mlgmpidl-1.2.4.tar.gz
+/mlgmpidl-1.2.6-1.tar.gz
diff --git a/0001-Patch-makefile-to-take-custom-locations-for-librarie.patch
b/0001-Patch-makefile-to-take-custom-locations-for-librarie.patch
deleted file mode 100644
index c95f169..0000000
--- a/0001-Patch-makefile-to-take-custom-locations-for-librarie.patch
+++ /dev/null
@@ -1,85 +0,0 @@
-From 4784d19f657c2b2eba6e4c516c6db9424a70088d Mon Sep 17 00:00:00 2001
-From: "Richard W.M. Jones" <rjones(a)redhat.com>
-Date: Thu, 9 Nov 2017 09:04:24 +0000
-Subject: [PATCH 1/5] Patch makefile to take custom locations for libraries and
- installing.
-
----
- Makefile | 32 +++++++++++++++++++++++++-------
- 1 file changed, 25 insertions(+), 7 deletions(-)
-
-diff --git a/Makefile b/Makefile
-index db3a7f1..61a98b5 100644
---- a/Makefile
-+++ b/Makefile
-@@ -24,6 +24,24 @@ OCAMLC := $(OCAMLFIND) ocamlc -package "$(REQ_PKG)"
- OCAMLOPT := $(OCAMLFIND) ocamlopt -package "$(REQ_PKG)"
- endif
-
-+# Location of includes
-+GMP_INCLUDEDIR = $(GMP_PREFIX)/include
-+MPFR_INCLUDEDIR = $(MPFR_PREFIX)/include
-+
-+# Location of C libraries
-+GMP_LIBDIR = $(GMP_PREFIX)/lib
-+MPFR_LIBDIR = $(MPFR_PREFIX)/lib
-+
-+# Location of OCaml libraries
-+CAML_LIBDIR = $(CAML_PREFIX)/lib/ocaml
-+CAMLIDL_LIBDIR = $(CAMLIDL_PREFIX)/lib/ocaml
-+MLGMPIDL_LIBDIR = $(MLGMPIDL_PREFIX)/lib
-+
-+# Eventual installation destination directories
-+INSTALL_INCLUDEDIR = $(PREFIX)/include
-+INSTALL_OCAML_LIBDIR = $(PREFIX)/lib/ocaml/mlgmpidl
-+INSTALL_BINDIR = $(PREFIX)/bin
-+
- #---------------------------------------
- # CAML part
- #---------------------------------------
-@@ -32,8 +50,8 @@ OCAMLCCOPT += \
- -ccopt "$(LDFLAGS)" \
- -ccopt -L$(CAMLIDL_DIR) \
- -ccopt -L$(CAML_DIR) \
---ccopt -L$(GMP_PREFIX)/lib \
---ccopt -L$(MPFR_PREFIX)/lib \
-+-ccopt -L$(GMP_LIBDIR) \
-+-ccopt -L$(MPFR_LIBDIR) \
-
- LIBS = -lmpfr -lgmp -lcamlidl
- OCAMLLDFLAGS = $(OCAMLCCOPT) $(addprefix -cclib ,$(LIBS))
-@@ -52,8 +70,8 @@ $(CPPFLAGS) \
- -I$(CAML_DIR) -I$(CAMLIDL_DIR)
-
- LDFLAGS += \
---L$(GMP_PREFIX)/lib \
---L$(MPFR_PREFIX)/lib \
-+-L$(GMP_LIBDIR) \
-+-L$(MPFR_LIBDIR) \
- -L$(CAML_DIR) -L$(CAML_DIR)/stublibs -L$(CAMLIDL_DIR) \
- -lmpfr -lgmp -lcamlidl
-
-@@ -154,17 +172,17 @@ META:
- ifeq ($(OCAMLFIND),)
- install:
- $(INSTALLd) $(MLGMPIDL_PREFIX)/include
-- $(INSTALLd) $(MLGMPIDL_PREFIX)/lib
-+ $(INSTALLd) $(MLGMPIDL_LIBDIR)
- $(INSTALL) gmp_caml.h $(MLGMPIDL_PREFIX)/include
- $(INSTALL) \
- $(IDLMODULES:%=%.idl) \
- $(MLMODULES:%=%.ml) $(MLMODULES:%=%.mli) \
- $(MLMODULES:%=%.cmi) gmp.cma \
- $(MLLIBx) $(CCLIB) \
-- $(MLGMPIDL_PREFIX)/lib
-+ $(MLGMPIDL_LIBDIR)
- uninstall:
- (cd $(MLGMPIDL_PREFIX)/include; /bin/rm -f gmp_caml.h)
-- (cd $(MLGMPIDL_PREFIX)/lib; /bin/rm -f \
-+ (cd $(MLGMPIDL_LIBDIR); /bin/rm -f \
- $(IDLMODULES:%=%.idl) \
- $(MLMODULES:%=%.ml) $(MLMODULES:%=%.mli) \
- $(MLMODULES:%=%.cmi) gmp.cma \
---
-2.13.1
-
diff --git a/0002-Supply-compare_ext-functions-for-the-C-data-types.patch
b/0002-Supply-compare_ext-functions-for-the-C-data-types.patch
deleted file mode 100644
index 419d4bc..0000000
--- a/0002-Supply-compare_ext-functions-for-the-C-data-types.patch
+++ /dev/null
@@ -1,264 +0,0 @@
-From bc4a69353e853be0eda1f15bf564e94a1658257c Mon Sep 17 00:00:00 2001
-From: "Richard W.M. Jones" <rjones(a)redhat.com>
-Date: Thu, 9 Nov 2017 09:05:02 +0000
-Subject: [PATCH 2/5] Supply compare_ext functions for the C data types.
-
----
- gmp_caml.c | 150 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++----
- 1 file changed, 142 insertions(+), 8 deletions(-)
-
-diff --git a/gmp_caml.c b/gmp_caml.c
-index b979c06..2e30ba6 100644
---- a/gmp_caml.c
-+++ b/gmp_caml.c
-@@ -44,6 +44,27 @@ int camlidl_custom_mpz_compare(value val1, value val2)
- res = res > 0 ? 1 : res==0 ? 0 : -1;
- return res;
- }
-+
-+int camlidl_custom_mpz_compare_ext(value val1, value val2)
-+{
-+ int res;
-+ __mpz_struct* mpz1;
-+ long lint;
-+
-+ if (Is_long(val1)) {
-+ lint = Long_val(val1);
-+ mpz1 = (__mpz_struct*)(Data_custom_val(val2));
-+ res = mpz_cmp_si(mpz1,lint);
-+ res = (res > 0) ? -1 : (res==0) ? 0 : 1;
-+ } else {
-+ mpz1 = (__mpz_struct*)(Data_custom_val(val1));
-+ lint = Long_val(val2);
-+ res = mpz_cmp_si(mpz1,lint);
-+ res = (res > 0) ? 1 : (res==0) ? 0 : -1;
-+ }
-+ return res;
-+}
-+
- long camlidl_custom_mpz_hash(value val)
- {
- __mpz_struct* mpz = (__mpz_struct*)(Data_custom_val(val));
-@@ -57,7 +78,8 @@ struct custom_operations camlidl_custom_mpz = {
- &camlidl_custom_mpz_compare,
- &camlidl_custom_mpz_hash,
- custom_serialize_default,
-- custom_deserialize_default
-+ custom_deserialize_default,
-+ &camlidl_custom_mpz_compare_ext
- };
-
- value camlidl_mpz_ptr_c2ml(mpz_ptr* mpz)
-@@ -101,6 +123,27 @@ int camlidl_custom_mpq_compare(value val1, value val2)
- res = res > 0 ? 1 : res==0 ? 0 : -1;
- return res;
- }
-+
-+int camlidl_custom_mpq_compare_ext(value val1, value val2)
-+{
-+ int res;
-+ __mpq_struct* mpq1;
-+ long lint;
-+
-+ if (Is_long(val1)) {
-+ lint = Long_val(val1);
-+ mpq1 = (__mpq_struct*)(Data_custom_val(val2));
-+ res = mpq_cmp_si(mpq1,lint,1UL);
-+ res = (res > 0) ? -1 : (res==0) ? 0 : 1;
-+ } else {
-+ mpq1 = (__mpq_struct*)(Data_custom_val(val1));
-+ lint = Long_val(val2);
-+ res = mpq_cmp_si(mpq1,lint,1UL);
-+ res = (res > 0) ? 1 : (res==0) ? 0 : -1;
-+ }
-+ return res;
-+}
-+
- long camlidl_custom_mpq_hash(value val)
- {
- __mpq_struct* mpq = (__mpq_struct*)(Data_custom_val(val));
-@@ -119,7 +162,8 @@ struct custom_operations camlidl_custom_mpq = {
- &camlidl_custom_mpq_compare,
- &camlidl_custom_mpq_hash,
- custom_serialize_default,
-- custom_deserialize_default
-+ custom_deserialize_default,
-+ &camlidl_custom_mpq_compare_ext
- };
-
- value camlidl_mpq_ptr_c2ml(mpq_ptr* mpq)
-@@ -174,6 +218,27 @@ int camlidl_custom_mpf_compare(value val1, value val2)
- res = res > 0 ? 1 : res==0 ? 0 : -1;
- return res;
- }
-+
-+int camlidl_custom_mpf_compare_ext(value val1, value val2)
-+{
-+ int res;
-+ __mpf_struct* mpf1;
-+ long lint;
-+
-+ if (Is_long(val1)) {
-+ lint = Long_val(val1);
-+ mpf1 = (__mpf_struct*)(Data_custom_val(val2));
-+ res = mpf_cmp_si(mpf1,lint);
-+ res = (res > 0) ? -1 : (res==0) ? 0 : 1;
-+ } else {
-+ mpf1 = (__mpf_struct*)(Data_custom_val(val1));
-+ lint = Long_val(val2);
-+ res = mpf_cmp_si(mpf1,lint);
-+ res = (res > 0) ? 1 : (res==0) ? 0 : -1;
-+ }
-+ return res;
-+}
-+
- long camlidl_custom_mpf_hash(value val)
- {
- __mpf_struct* mpf = (__mpf_struct*)(Data_custom_val(val));
-@@ -191,7 +256,8 @@ struct custom_operations camlidl_custom_mpf = {
- &camlidl_custom_mpf_compare,
- &camlidl_custom_mpf_hash,
- custom_serialize_default,
-- custom_deserialize_default
-+ custom_deserialize_default,
-+ &camlidl_custom_mpf_compare_ext
- };
-
- value camlidl_mpf_ptr_c2ml(mpf_ptr* mpf)
-@@ -245,6 +311,27 @@ int camlidl_custom_mpfr_compare(value val1, value val2)
- res = res > 0 ? 1 : res==0 ? 0 : -1;
- return res;
- }
-+
-+int camlidl_custom_mpfr_compare_ext(value val1, value val2)
-+{
-+ int res;
-+ __mpfr_struct* mpfr1;
-+ long lint;
-+
-+ if (Is_long(val1)) {
-+ lint = Long_val(val1);
-+ mpfr1 = (__mpfr_struct*)(Data_custom_val(val2));
-+ res = mpfr_cmp_si(mpfr1,lint);
-+ res = (res > 0) ? -1 : (res==0) ? 0 : 1;
-+ } else {
-+ mpfr1 = (__mpfr_struct*)(Data_custom_val(val1));
-+ lint = Long_val(val2);
-+ res = mpfr_cmp_si(mpfr1,lint);
-+ res = (res > 0) ? 1 : (res==0) ? 0 : -1;
-+ }
-+ return res;
-+}
-+
- long camlidl_custom_mpfr_hash(value val)
- {
- __mpfr_struct* mpfr = (__mpfr_struct*)(Data_custom_val(val));
-@@ -263,7 +350,8 @@ struct custom_operations camlidl_custom_mpfr = {
- &camlidl_custom_mpfr_compare,
- &camlidl_custom_mpfr_hash,
- custom_serialize_default,
-- custom_deserialize_default
-+ custom_deserialize_default,
-+ &camlidl_custom_mpfr_compare_ext
- };
-
- value camlidl_mpfr_ptr_c2ml(mpfr_ptr* mpfr)
-@@ -300,7 +388,8 @@ struct custom_operations camlidl_custom_gmp_randstate = {
- custom_compare_default,
- custom_hash_default,
- custom_serialize_default,
-- custom_deserialize_default
-+ custom_deserialize_default,
-+ custom_compare_ext_default
- };
-
- value camlidl_gmp_randstate_ptr_c2ml(gmp_randstate_ptr* gmp_randstate)
-@@ -345,6 +434,27 @@ int camlidl_custom_mpz2_compare(value val1, value val2)
- res = res > 0 ? 1 : res==0 ? 0 : -1;
- CAMLreturn(res);
- }
-+
-+int camlidl_custom_mpz2_compare_ext(value val1, value val2)
-+{
-+ int res;
-+ __mpz_struct** mpz1;
-+ long lint;
-+
-+ if (Is_long(val1)) {
-+ lint = Long_val(val1);
-+ mpz1 = (__mpz_struct**)(Data_custom_val(val2));
-+ res = mpz_cmp_si(*mpz1,lint);
-+ res = (res > 0) ? -1 : (res==0) ? 0 : 1;
-+ } else {
-+ mpz1 = (__mpz_struct**)(Data_custom_val(val1));
-+ lint = Long_val(val2);
-+ res = mpz_cmp_si(*mpz1,lint);
-+ res = (res > 0) ? 1 : (res==0) ? 0 : -1;
-+ }
-+ return res;
-+}
-+
- long camlidl_custom_mpz2_hash(value val)
- {
- CAMLparam1(val);
-@@ -359,7 +469,8 @@ struct custom_operations camlidl_custom_mpz2 = {
- &camlidl_custom_mpz2_compare,
- &camlidl_custom_mpz2_hash,
- custom_serialize_default,
-- custom_deserialize_default
-+ custom_deserialize_default,
-+ &camlidl_custom_mpz2_compare_ext
- };
-
- value camlidl_mpz2_ptr_c2ml(mpz_ptr* mpz)
-@@ -402,6 +513,27 @@ int camlidl_custom_mpq2_compare(value val1, value val2)
- res = res > 0 ? 1 : res==0 ? 0 : -1;
- CAMLreturn(res);
- }
-+
-+int camlidl_custom_mpq2_compare_ext(value val1, value val2)
-+{
-+ int res;
-+ __mpq_struct** mpq1;
-+ long lint;
-+
-+ if (Is_long(val1)) {
-+ lint = Long_val(val1);
-+ mpq1 = (__mpq_struct**)(Data_custom_val(val2));
-+ res = mpq_cmp_si(*mpq1,lint,1UL);
-+ res = (res > 0) ? -1 : (res==0) ? 0 : 1;
-+ } else {
-+ mpq1 = (__mpq_struct**)(Data_custom_val(val1));
-+ lint = Long_val(val2);
-+ res = mpq_cmp_si(*mpq1,lint,1UL);
-+ res = (res > 0) ? 1 : (res==0) ? 0 : -1;
-+ }
-+ return res;
-+}
-+
- long camlidl_custom_mpq2_hash(value val)
- {
- CAMLparam1(val);
-@@ -418,7 +550,8 @@ struct custom_operations camlidl_custom_mpq2 = {
- &camlidl_custom_mpq2_compare,
- &camlidl_custom_mpq2_hash,
- custom_serialize_default,
-- custom_deserialize_default
-+ custom_deserialize_default,
-+ &camlidl_custom_mpq2_compare_ext
- };
-
- value camlidl_mpq2_ptr_c2ml(mpq_ptr* mpq)
-@@ -454,7 +587,8 @@ struct custom_operations camlidl_custom_gmp_randstate2 = {
- custom_compare_default,
- custom_hash_default,
- custom_serialize_default,
-- custom_deserialize_default
-+ custom_deserialize_default,
-+ custom_compare_ext_default
- };
-
- value camlidl_gmp_randstate2_ptr_c2ml(gmp_randstate_ptr* gmp_randstate)
---
-2.13.1
-
diff --git a/0003-Eliminate-compiler-warnings-that-might-indicate-runt.patch
b/0003-Eliminate-compiler-warnings-that-might-indicate-runt.patch
deleted file mode 100644
index 1d96290..0000000
--- a/0003-Eliminate-compiler-warnings-that-might-indicate-runt.patch
+++ /dev/null
@@ -1,101 +0,0 @@
-From 94671390f2d516c75d810c246a4c80be4895db6b Mon Sep 17 00:00:00 2001
-From: "Richard W.M. Jones" <rjones(a)redhat.com>
-Date: Thu, 9 Nov 2017 09:05:39 +0000
-Subject: [PATCH 3/5] Eliminate compiler warnings that might indicate runtime
- bugs.
-
----
- gmp_caml.c | 2 +-
- mpfr.idl | 24 +++++++++++++-----------
- mpq.idl | 16 ++++++++--------
- 3 files changed, 22 insertions(+), 20 deletions(-)
-
-diff --git a/gmp_caml.c b/gmp_caml.c
-index 2e30ba6..dba2795 100644
---- a/gmp_caml.c
-+++ b/gmp_caml.c
-@@ -152,7 +152,7 @@ long camlidl_custom_mpq_hash(value val)
- long hash;
- if (num==0) hash = 0;
- else if (den==0) hash = num>0 ? LONG_MAX : LONG_MIN;
-- else hash = (labs(num)<den ? den/num : num/den);
-+ else hash = (((unsigned long)labs(num))<den) ? den/num : num/den;
- return hash;
- }
-
-diff --git a/mpfr.idl b/mpfr.idl
-index 2688771..850e760 100644
---- a/mpfr.idl
-+++ b/mpfr.idl
-@@ -93,11 +93,12 @@ int mpfr_set_d (mpfr_ptrm ROP, double OP, mpfr_rnd_t RND);
- int mpfr_set_z (mpfr_ptrm ROP, mpz_ptr OP, mpfr_rnd_t RND);
- int mpfr_set_q (mpfr_ptrm ROP, mpq_ptr OP, mpfr_rnd_t RND)
- quote(call,"\n\
--if (mpz_sgn(mpq_denref(OP)))\n\
-- mpfr_set_q(ROP,OP,RND);\n\
--else\n\
-- mpfr_set_inf(ROP,mpq_sgn(OP));\n\
--");
-+ if (mpz_sgn(mpq_denref(OP)))\n\
-+ _res = mpfr_set_q(ROP,OP,RND);\n\
-+ else {\n\
-+ mpfr_set_inf(ROP,mpq_sgn(OP));\n\
-+ _res = 0;\n\
-+ }");
- void mpfr__set_str (mpfr_ptrm ROP, [string]char *STR, int BASE, mpfr_rnd_t RND)
- quote(call,"{\n\
- int n = mpfr_set_str(ROP,STR,BASE,RND);\n\
-@@ -134,12 +135,13 @@ int mpfr_init_set_f ([out] mpfr_ptr OUTOUTOUT, mpf_ptr OP,
mpfr_rnd_t RND);
- int mpfr_init_set_z ([out] mpfr_ptr OUTOUTOUT, mpz_ptr OP, mpfr_rnd_t RND);
- int mpfr_init_set_q ([out] mpfr_ptr OUTOUTOUT, mpq_ptr OP, mpfr_rnd_t RND)
- quote(call,"\n\
--if (mpz_sgn(mpq_denref(OP)))\n\
-- mpfr_init_set_q(OUTOUTOUT,OP,RND);\n\
--else\n\
-- mpfr_init(OUTOUTOUT);\n\
-- mpfr_set_inf(OUTOUTOUT,mpq_sgn(OP));\n\
--");
-+ if (mpz_sgn(mpq_denref(OP)))\n\
-+ _res = mpfr_init_set_q(OUTOUTOUT,OP,RND);\n\
-+ else {\n\
-+ mpfr_init(OUTOUTOUT);\n\
-+ mpfr_set_inf(OUTOUTOUT,mpq_sgn(OP));\n\
-+ _res = 0;\n\
-+ }");
- void mpfr__init_set_str ([out] mpfr_ptr OUTOUTOUT, [string]char *STR, int BASE,
mpfr_rnd_t RND)
- quote(call,"\
- {\n\
-diff --git a/mpq.idl b/mpq.idl
-index d2d0cbd..d7c9d66 100644
---- a/mpq.idl
-+++ b/mpq.idl
-@@ -219,18 +219,18 @@ else {\n\
- ");
- int mpq_cmp_si (mpq_ptr OP1, long int NUM2, unsigned long int DEN2)
- quote(call,"\n\
--if (mpz_sgn(mpq_denref(OP1))==0)\n\
-- _res = mpq_sgn(OP1);\n\
--else\n\
-- _res = mpq_cmp_si(OP1,NUM2,DEN2);\n\
-+ if (mpz_sgn(mpq_denref(OP1))==0)\n\
-+ _res = mpq_sgn(OP1);\n\
-+ else\n\
-+ _res = mpq_cmp_si(OP1,NUM2,DEN2);\n\
- ");
- int mpq_sgn (mpq_ptr OP);
- boolean mpq_equal (mpq_ptr OP1, mpq_ptr OP2)
- quote(call,"\n\
--if (mpz_sgn(mpq_denref(OP1))==0 && mpz_sgn(mpq_denref(OP2))==0)\n\
-- _res = mpq_sgn(OP1)==mpq_sgn(OP2);\n\
--else \n\
-- _res = mpq_equal(OP1,OP2);\n\
-+ if (mpz_sgn(mpq_denref(OP1))==0 && mpz_sgn(mpq_denref(OP2))==0)\n\
-+ _res = mpq_sgn(OP1)==mpq_sgn(OP2);\n\
-+ else \n\
-+ _res = mpq_equal(OP1,OP2);\n\
- ");
-
- quote(MLMLI,"\n(** {2 Applying Integer Functions to Rationals} *)")
---
-2.13.1
-
diff --git a/0004-Fix-for-immutable-strings-in-OCaml-4.06.patch
b/0004-Fix-for-immutable-strings-in-OCaml-4.06.patch
deleted file mode 100644
index 9792ffc..0000000
--- a/0004-Fix-for-immutable-strings-in-OCaml-4.06.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-From da459fc76f2f8bd4f843e3948b09a038824b7a42 Mon Sep 17 00:00:00 2001
-From: "Richard W.M. Jones" <rjones(a)redhat.com>
-Date: Thu, 9 Nov 2017 09:13:50 +0000
-Subject: [PATCH 4/5] Fix for immutable strings in OCaml 4.06.
-
----
- mpfr.idl | 4 +++-
- 1 file changed, 3 insertions(+), 1 deletion(-)
-
-diff --git a/mpfr.idl b/mpfr.idl
-index 850e760..9ede350 100644
---- a/mpfr.idl
-+++ b/mpfr.idl
-@@ -334,7 +334,9 @@ let (s,e) = get_str ~base:10 ~digits:0 x Near in \n\
- if s=\"\" \n\
- then \"0.\" \n\
- else if s.[0] = '-' then begin\n\
-- s.[0] <- '.';\n\
-+ let s = Bytes.of_string s in\n\
-+ Bytes.set s 0 '.';\n\
-+ let s = Bytes.to_string s in\n\
- Format.sprintf \"-0%sE%i\" s e\n\
- end\n\
- else Format.sprintf \"0.%sE%i\" s e \n\
---
-2.13.1
-
diff --git a/0005-Remove-profiling-only-applied-on-aarch64-and-s390x.patch
b/0005-Remove-profiling-only-applied-on-aarch64-and-s390x.patch
index ceb46b3..18320aa 100644
--- a/0005-Remove-profiling-only-applied-on-aarch64-and-s390x.patch
+++ b/0005-Remove-profiling-only-applied-on-aarch64-and-s390x.patch
@@ -11,7 +11,7 @@ diff --git a/Makefile b/Makefile
index 61a98b5..79bb9a4 100644
--- a/Makefile
+++ b/Makefile
-@@ -77,14 +77,13 @@ LDFLAGS += \
+@@ -59,14 +59,13 @@ LDFLAGS += \
CCMODULES = $(IDLMODULES:%=%_caml) gmp_caml
@@ -28,7 +28,7 @@ index 61a98b5..79bb9a4 100644
ifneq ($(HAS_NATIVE_PLUGINS),)
MLLIBx += gmp.cmxs
endif
-@@ -107,14 +106,13 @@ endif
+@@ -89,14 +88,13 @@ endif
# Rules
#---------------------------------------
@@ -44,7 +44,7 @@ index 61a98b5..79bb9a4 100644
# Example of compilation command with ocamlfind
%.byte: %.ml
-@@ -167,7 +165,6 @@ META:
+@@ -149,7 +147,6 @@ META:
echo "archive(byte,plugin) = \"gmp.cma\"" >>META
echo "archive(native) = \"gmp.cmxa\"" >>META
echo "archive(native,plugin) = \"gmp.cmxs\"" >>META
diff --git a/ocaml-mlgmpidl.spec b/ocaml-mlgmpidl.spec
index a98e451..6f7fc6b 100644
--- a/ocaml-mlgmpidl.spec
+++ b/ocaml-mlgmpidl.spec
@@ -1,33 +1,20 @@
+%global upstreamver 1.2.6-1
+
Name: ocaml-mlgmpidl
-Version: 1.2.4
-Release: 2
+Version: %(tr - . <<< %{upstreamver})
+Release: 1%{?dist}
Summary: OCaml interface to GMP and MPFR libraries
-# The license includes a static linking exception
+# The license includes a linking exception
License: LGPLv2 with exceptions
URL:
https://github.com/nberth/mlgmpidl
-Source0:
https://github.com/nberth/mlgmpidl/archive/%{version}/mlgmpidl-%{version}...
+Source0:
https://github.com/nberth/mlgmpidl/archive/%{upstreamver}/mlgmpidl-%{upst...
Source1: mlgmpidl_test.ml
Source2: mlgmpidl_test_result
-# Patch makefile to take custom locations for libraries and installing
-Patch1: 0001-Patch-makefile-to-take-custom-locations-for-librarie.patch
-# Supply compare_ext functions for the C data types
-Patch2: 0002-Supply-compare_ext-functions-for-the-C-data-types.patch
-# Eliminate compiler warnings that might indicate runtime bugs
-Patch3: 0003-Eliminate-compiler-warnings-that-might-indicate-runt.patch
-# Fix for immutable strings in OCaml 4.06.
-Patch4: 0004-Fix-for-immutable-strings-in-OCaml-4.06.patch
-%ifnarch %{ocaml_native_profiling}
# Eliminate profiling on architectures which don't support it.
Patch5: 0005-Remove-profiling-only-applied-on-aarch64-and-s390x.patch
-%endif
-
-# These patches were removed because they were too difficult to
-# apply to the 1.2.4 sources.
-# Build a shared library in addition to a static library
-#Patch4: mlgmpidl-1.2.1-cmxs.patch
BuildRequires: gcc
BuildRequires: ocaml
@@ -71,14 +58,27 @@ BuildArch: noarch
The %{name}-doc package contains documentation for using %{name}.
%prep
-%setup -q -n mlgmpidl-%{version}
-%autopatch -p1
+%setup -q -n mlgmpidl-%{upstreamver}
+%ifnarch %{ocaml_native_profiling}
+%patch5 -p1
+%endif
cp -p %{SOURCE1} %{SOURCE2} .
+if [ "%{_libdir}" != "%{_prefix}/lib" ]; then
+ sed -i 's,/lib,%{_lib},g' Makefile
+fi
%build
mv Makefile.config.model Makefile.config
+# Look for ocaml tools in the right place
+sed -i 's,\$(CAML_PREFIX)/bin,%{_bindir},' Makefile.config
+
+%ifarch %{ocaml_native_compiler}
+# Build a cmxs
+sed -i '/HAS_SHARED=1/a\\nHAS_NATIVE_PLUGINS=1' Makefile.config
+%endif
+
%global ocaml_lib_dir %{_libdir}/ocaml
%global my_ocaml_lib_dir %{ocaml_lib_dir}/gmp
@@ -86,9 +86,9 @@ mv Makefile.config.model Makefile.config
unset MAKEFLAGS
%global make1 \\\
-make PREFIX=%{_prefix} GMP_LIBDIR=%{_libdir} MPFR_LIBDIR=%{_libdir} \\\
- CAML_LIBDIR=%{ocaml_lib_dir} CAMLIDL_LIBDIR=%{ocaml_lib_dir} \\\
- MLGMPIDL_LIBDIR=%{_libdir} LDFLAGS="$RPM_LD_FLAGS -L%{_libdir}/ocaml"
+make MLGMPIDL_PREFIX=%{_prefix} GMP_PREFIX=%{_prefix} \\\
+ MFPR_PREFIX=%{_prefix} CAML_PREFIX=%{ocaml_lib_dir} \\\
+ CAMLIDL_PREFIX=%{ocaml_lib_dir} LDFLAGS="$RPM_LD_FLAGS
-L%{_libdir}/ocaml"
%ifarch %{ocaml_native_compiler}
%global make \\\
%make1 \\\
@@ -128,6 +128,7 @@ unset MAKEFLAGS
# Library uses ocamlfind install to install itself. Set up environment
# so that it works.
+export MLGMPIDL_PREFIX=$RPM_BUILD_ROOT%{_prefix}
export DESTDIR=$RPM_BUILD_ROOT
export OCAMLFIND_DESTDIR=$RPM_BUILD_ROOT%{_libdir}/ocaml
mkdir -p $OCAMLFIND_DESTDIR $OCAMLFIND_DESTDIR/stublibs
@@ -157,6 +158,9 @@ mv $RPM_BUILD_ROOT%{my_ocaml_lib_dir}/gmp_caml.h
$RPM_BUILD_ROOT%{_includedir}
%exclude %{my_ocaml_lib_dir}/*.a
%{ocaml_lib_dir}/stublibs/*.so
%{ocaml_lib_dir}/stublibs/*.so.owner
+%ifarch %{ocaml_native_compiler}
+%{my_ocaml_lib_dir}/*.cmxs
+%endif
%doc README
%license COPYING
@@ -179,6 +183,12 @@ mv $RPM_BUILD_ROOT%{my_ocaml_lib_dir}/gmp_caml.h
$RPM_BUILD_ROOT%{_includedir}
%changelog
+* Sat Dec 2 2017 Jerry James <loganjerry(a)gmail.com> - 1.2.6.1-1
+- New upstream version 1.2.6-1.
+- Drop upstreamed patches 0001, 0002, 0003, and 0004
+- Ensure that patch 0005 is in the srpm regardless of build arch
+- Use the upstream way of building a cmxs
+
* Fri Nov 17 2017 Richard W.M. Jones <rjones(a)redhat.com> - 1.2.4-2
- Add back the no-profiling patch for aarch64 and s390x.
diff --git a/sources b/sources
index e1d3717..fa18ecf 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (mlgmpidl-1.2.4.tar.gz) =
1fbbee76602d1a027b41673b0e395e99124ee0307368e889152c3a09f218d47dbcf34e6f1b402d1b40e4bb8ced62935e88d28e6ba286125a8c3d0e9cec38813f
+SHA512 (mlgmpidl-1.2.6-1.tar.gz) =
c5a6a18b3d902f43d370411b2256af72065521a8a0bf9c3b0e80b2e942b7e22e4b174d6b4879fe999916c673d5f9422e39cf2f6fd313498dbd338667c067e450