[65834] trunk/dports/lang/gst

jmr at macports.org jmr at macports.org
Thu Apr 1 14:09:27 PDT 2010


Revision: 65834
          http://trac.macports.org/changeset/65834
Author:   jmr at macports.org
Date:     2010-04-01 14:09:25 -0700 (Thu, 01 Apr 2010)
Log Message:
-----------
gst: patch for GMP 5 compatibility (#23782)

Modified Paths:
--------------
    trunk/dports/lang/gst/Portfile

Added Paths:
-----------
    trunk/dports/lang/gst/files/
    trunk/dports/lang/gst/files/04ac00a8.patch

Modified: trunk/dports/lang/gst/Portfile
===================================================================
--- trunk/dports/lang/gst/Portfile	2010-04-01 19:35:13 UTC (rev 65833)
+++ trunk/dports/lang/gst/Portfile	2010-04-01 21:09:25 UTC (rev 65834)
@@ -4,7 +4,7 @@
 
 name             gst
 version          3.1
-revision         1
+revision         2
 categories       lang
 maintainers      saispo
 description      Free implementation of Smalltalk-80
@@ -29,6 +29,9 @@
                                 port:ncursesw \
                                 port:readline
 
+patchfiles      04ac00a8.patch
+patch.pre_args  -p1
+
 configure.args  --infodir=${prefix}/share/info \
                                 --mandir=${prefix}/share/man \
                                 --enable-disassembler \

Added: trunk/dports/lang/gst/files/04ac00a8.patch
===================================================================
--- trunk/dports/lang/gst/files/04ac00a8.patch	                        (rev 0)
+++ trunk/dports/lang/gst/files/04ac00a8.patch	2010-04-01 21:09:25 UTC (rev 65834)
@@ -0,0 +1,84 @@
+From 04ac00a8126a0b328e231e01ab4b257b28c5da3c Mon Sep 17 00:00:00 2001
+From: Paolo Bonzini <bonzini at gnu.org>
+Date: Fri, 8 Jan 2010 16:00:36 +0100
+Subject: [PATCH] hack to build with GMP 5
+
+libgst:
+2010-01-08  Paolo Bonzini  <bonzini at gnu.org>
+
+	* libgst/mpz.c: Hack to build with GMP 5.
+---
+ libgst/ChangeLog |    4 ++++
+ libgst/mpz.c     |   20 ++++++++++++++++++--
+ 2 files changed, 22 insertions(+), 2 deletions(-)
+
+diff --git a/libgst/mpz.c b/libgst/mpz.c
+index eaee0e8..d8e8b6b 100644
+--- a/libgst/mpz.c
++++ b/libgst/mpz.c
+@@ -1513,13 +1513,21 @@ _gst_mpz_xor (gst_mpz *res, const gst_mpz *op1, const gst_mpz *op2)
+   }
+ }
+ 
++#if __GNU_MP_VERSION >= 5
++extern void __gmpn_divexact (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t);
++#endif
++
+ void
+ _gst_mpz_divexact (gst_mpz *quot, const gst_mpz *num, const gst_mpz *den)
+ {
+-  mp_ptr qp, tp;
++  mp_ptr qp;
+   mp_srcptr np, dp;
+-  mp_size_t nsize, dsize, qsize, d_zero_limbs;
++  mp_size_t nsize, dsize, qsize;
++#if __GNU_MP_VERSION < 5
++  mp_ptr tp;
++  mp_size_t d_zero_limbs;
+   int d_zero_bits;
++#endif
+ 
+   nsize = ABS (num->size);
+   dsize = ABS (den->size);
+@@ -1542,6 +1550,7 @@ _gst_mpz_divexact (gst_mpz *quot, const gst_mpz *num, const gst_mpz *den)
+       return;
+     }
+ 
++#if __GNU_MP_VERSION < 5
+   /* Avoid quadratic behaviour, but do it conservatively.  */
+   if (nsize - dsize > 1500)
+     {
+@@ -1560,6 +1569,7 @@ _gst_mpz_divexact (gst_mpz *quot, const gst_mpz *num, const gst_mpz *den)
+   dsize -= d_zero_limbs;
+   np += d_zero_limbs;
+   nsize -= d_zero_limbs;
++#endif
+ 
+   /* Allocate where we place the result.  It must be nsize limbs big
+      because it also acts as a temporary area.  */
+@@ -1567,6 +1577,7 @@ _gst_mpz_divexact (gst_mpz *quot, const gst_mpz *num, const gst_mpz *den)
+     gst_mpz_realloc (quot, nsize);
+   qp = quot->d;
+ 
++#if __GNU_MP_VERSION < 5
+   if (d_zero_bits != 0)
+     {
+       tp = (mp_ptr) alloca (dsize * SIZEOF_MP_LIMB_T);
+@@ -1579,9 +1590,14 @@ _gst_mpz_divexact (gst_mpz *quot, const gst_mpz *num, const gst_mpz *den)
+     }
+   else
+     MPN_COPY(qp, np, nsize);
++#endif
+ 
+   qsize = nsize - dsize + 1;
++#if __GNU_MP_VERSION < 5
+   mpn_bdivmod (qp, qp, nsize, dp, dsize, qsize * GMP_NUMB_BITS);
++#else
++  __gmpn_divexact (qp, np, nsize, dp, dsize);
++#endif
+   quot->size = (num->size ^ den->size) >= 0 ? qsize : -qsize;
+ }
+ 
+-- 
+1.6.4.3
+
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20100401/86f0ac86/attachment.html>


More information about the macports-changes mailing list