summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhang Le <r0bertz@gentoo.org>2009-03-12 23:59:47 +0800
committerZhang Le <r0bertz@gentoo.org>2009-03-12 23:59:47 +0800
commit1050084c256fe38cb96ec4698869e677d2554b03 (patch)
tree5f624b5a5e1070ef448983fbcc6d86f082d4598f /dev-libs
parentnspr: added inherit flag-o-matic (diff)
downloadloongson-1050084c256fe38cb96ec4698869e677d2554b03.tar.gz
loongson-1050084c256fe38cb96ec4698869e677d2554b03.tar.bz2
loongson-1050084c256fe38cb96ec4698869e677d2554b03.zip
added mpfr-2.4.1_p2.ebuild
Signed-off-by: Zhang Le <r0bertz@gentoo.org>
Diffstat (limited to 'dev-libs')
-rw-r--r--dev-libs/mpfr/Manifest4
-rw-r--r--dev-libs/mpfr/files/2.4.1/patch01123
-rw-r--r--dev-libs/mpfr/files/2.4.1/patch0255
-rw-r--r--dev-libs/mpfr/mpfr-2.4.1_p2.ebuild49
4 files changed, 231 insertions, 0 deletions
diff --git a/dev-libs/mpfr/Manifest b/dev-libs/mpfr/Manifest
index ee8e447..4a8f612 100644
--- a/dev-libs/mpfr/Manifest
+++ b/dev-libs/mpfr/Manifest
@@ -1,8 +1,12 @@
AUX 2.3.2/patch01 1969 RMD160 bc69e028d61407a56c762cad4e5cd2f645ca457e SHA1 a5310b699f80bcf2768434531776bbfb2af4e640 SHA256 e9fdf4dbdb32c10894d1d0bb8c6d8731397074ae212e927d3b6e1e32b90b1c26
AUX 2.4.0/patch01 1969 RMD160 bc69e028d61407a56c762cad4e5cd2f645ca457e SHA1 a5310b699f80bcf2768434531776bbfb2af4e640 SHA256 e9fdf4dbdb32c10894d1d0bb8c6d8731397074ae212e927d3b6e1e32b90b1c26
+AUX 2.4.1/patch01 3512 RMD160 a68a65e3ba90fabb8d634d69b172a32162488661 SHA1 82eb4c34685b6d655d33e0dfcea003248a8967d9 SHA256 6abd8c5abac124041fc0508fbcfdb04f564d0f78118235d70edd81daa3b6169d
+AUX 2.4.1/patch02 1969 RMD160 bc69e028d61407a56c762cad4e5cd2f645ca457e SHA1 a5310b699f80bcf2768434531776bbfb2af4e640 SHA256 e9fdf4dbdb32c10894d1d0bb8c6d8731397074ae212e927d3b6e1e32b90b1c26
DIST mpfr-2.3.2.tar.lzma 816537 RMD160 eff9b819dee971cd907dde461cd525c473516e29 SHA1 1c48c7a545b571e54ea2418bd1eae8b5e3bfe753 SHA256 d8285d3f7fc824eb1fe86ebeb5b8e5064265be8e7439d5aec49bafcb53d710be
DIST mpfr-2.4.0.tar.lzma 903115 RMD160 a9db0f2b2dcd9b6a855f2e5f7a794a152dc48f43 SHA1 345ac4edfb324e7c4ea944540007996a78788c1e SHA256 98a690bc941cfc7a741ae69e659438f8af171cb0d4dcb1e0c54d13e32ada62df
+DIST mpfr-2.4.1.tar.lzma 903875 RMD160 e848db799fc3b6a4681de3b38df8809c2369f266 SHA1 6145947361fac880b87976e21e28fab12ccf4881 SHA256 95e507b26bac3b64215bc3cf1463525781582d40358b09becdb24d058b31def8
EBUILD mpfr-2.3.2_p1.ebuild 1414 RMD160 093e6f72a3174b59566deb19ceb047f9e6090601 SHA1 5174c86341e24b147205afe523c8beeba9abe07a SHA256 5aad2ce00fd4a81a48e257e7c856b3bb10ec2fdb1986def6c23ade6628c93b5f
EBUILD mpfr-2.4.0_p1.ebuild 1416 RMD160 917ecd3e064ec200947d742eb7a99c69e11ba0d9 SHA1 85e3eb5033625f57a477937669e6e69ce8decf37 SHA256 209f558be6ed026d85fcbf3b5689445c4f9a2c674d7a61bdbdac5b41789674f0
+EBUILD mpfr-2.4.1_p2.ebuild 1476 RMD160 17763aa8e3971fffed004c3de94db1c62acae29a SHA1 af34bbb3c339646392d353a755a1bfe061a55384 SHA256 317d8f0f21eeaaa81fac338b5f943c79d46889f139391fa2975a1767f2b28101
MISC ChangeLog 9991 RMD160 bcaeb88e150b4aa878f49742cc78fa950d106166 SHA1 914fa38a621aa37aeca97d62733d7c67e011ca09 SHA256 a88a71799640fa947a75a3549d228b884d068399d1468b3bf0185efd62d1ded6
MISC metadata.xml 162 RMD160 d002486a43522f2116b1d9d59828c484956d66e2 SHA1 d6b4923897f6ae673b4f93646f5b4ba61d5a2c3c SHA256 65a915d44de1f01d4b7f72d313b4192c38374a9835d24988c00c1e73dca5805a
diff --git a/dev-libs/mpfr/files/2.4.1/patch01 b/dev-libs/mpfr/files/2.4.1/patch01
new file mode 100644
index 0000000..ae92788
--- /dev/null
+++ b/dev-libs/mpfr/files/2.4.1/patch01
@@ -0,0 +1,123 @@
+diff -Naurd mpfr-2.4.1-a/PATCHES mpfr-2.4.1-b/PATCHES
+--- mpfr-2.4.1-a/PATCHES 2009-02-20 09:43:17.000000000 +0000
++++ mpfr-2.4.1-b/PATCHES 2009-02-27 16:56:29.000000000 +0000
+@@ -0,0 +1 @@
++remainder-neg
+diff -Naurd mpfr-2.4.1-a/VERSION mpfr-2.4.1-b/VERSION
+--- mpfr-2.4.1-a/VERSION 2009-02-25 16:16:08.000000000 +0000
++++ mpfr-2.4.1-b/VERSION 2009-02-27 16:55:37.000000000 +0000
+@@ -1 +1 @@
+-2.4.1
++2.4.1-p1
+diff -Naurd mpfr-2.4.1-a/mpfr.h mpfr-2.4.1-b/mpfr.h
+--- mpfr-2.4.1-a/mpfr.h 2009-02-25 16:16:08.000000000 +0000
++++ mpfr-2.4.1-b/mpfr.h 2009-02-27 16:55:38.000000000 +0000
+@@ -27,7 +27,7 @@
+ #define MPFR_VERSION_MAJOR 2
+ #define MPFR_VERSION_MINOR 4
+ #define MPFR_VERSION_PATCHLEVEL 1
+-#define MPFR_VERSION_STRING "2.4.1"
++#define MPFR_VERSION_STRING "2.4.1-p1"
+
+ /* Macros dealing with MPFR VERSION */
+ #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
+diff -Naurd mpfr-2.4.1-a/rem1.c mpfr-2.4.1-b/rem1.c
+--- mpfr-2.4.1-a/rem1.c 2009-02-20 09:43:17.000000000 +0000
++++ mpfr-2.4.1-b/rem1.c 2009-02-27 16:55:15.000000000 +0000
+@@ -170,7 +170,12 @@
+ }
+
+ if (mpz_cmp_ui (r, 0) == 0)
+- inex = mpfr_set_ui (rem, 0, GMP_RNDN);
++ {
++ inex = mpfr_set_ui (rem, 0, GMP_RNDN);
++ /* take into account sign of x */
++ if (signx < 0)
++ mpfr_neg (rem, rem, GMP_RNDN);
++ }
+ else
+ {
+ if (rnd_q == GMP_RNDN)
+@@ -190,6 +195,9 @@
+ *quo += 1;
+ }
+ }
++ /* take into account sign of x */
++ if (signx < 0)
++ mpz_neg (r, r);
+ inex = mpfr_set_z (rem, r, rnd);
+ /* if ex > ey, rem should be multiplied by 2^ey, else by 2^ex */
+ MPFR_EXP (rem) += (ex > ey) ? ey : ex;
+@@ -198,13 +206,6 @@
+ if (quo)
+ *quo *= sign;
+
+- /* take into account sign of x */
+- if (signx < 0)
+- {
+- mpfr_neg (rem, rem, GMP_RNDN);
+- inex = -inex;
+- }
+-
+ mpz_clear (mx);
+ mpz_clear (my);
+ mpz_clear (r);
+diff -Naurd mpfr-2.4.1-a/tests/tremquo.c mpfr-2.4.1-b/tests/tremquo.c
+--- mpfr-2.4.1-a/tests/tremquo.c 2009-02-20 09:43:15.000000000 +0000
++++ mpfr-2.4.1-b/tests/tremquo.c 2009-02-27 16:55:15.000000000 +0000
+@@ -25,6 +25,36 @@
+
+ #include "mpfr-test.h"
+
++static void
++bug20090227 (void)
++{
++ mpfr_t x, y, r1, r2;
++ int inex1, inex2;
++
++ mpfr_init2 (x, 118);
++ mpfr_init2 (y, 181);
++ mpfr_init2 (r1, 140);
++ mpfr_init2 (r2, 140);
++ mpfr_set_si (x, -1, GMP_RNDN);
++ mpfr_set_str_binary (y, "1.100100100001111110110101010001000100001011010001100001000110100110001001100011001100010100010111000000011011100000111001101000100101001000000100100111000001000100010100110011111010");
++ inex1 = mpfr_remainder (r1, x, y, GMP_RNDU);
++ /* since the quotient is -1, r1 is the rounding of x+y */
++ inex2 = mpfr_add (r2, x, y, GMP_RNDU);
++ if (mpfr_cmp (r1, r2))
++ {
++ printf ("Error in mpfr_remainder (bug20090227)\n");
++ printf ("Expected ");
++ mpfr_dump (r2);
++ printf ("Got ");
++ mpfr_dump (r1);
++ exit (1);
++ }
++ mpfr_clear (x);
++ mpfr_clear (y);
++ mpfr_clear (r1);
++ mpfr_clear (r2);
++}
++
+ int
+ main (int argc, char *argv[])
+ {
+@@ -50,6 +80,8 @@
+
+ tests_start_mpfr ();
+
++ bug20090227 ();
++
+ mpfr_init (x);
+ mpfr_init (y);
+ mpfr_init (r);
+diff -Naurd mpfr-2.4.1-a/version.c mpfr-2.4.1-b/version.c
+--- mpfr-2.4.1-a/version.c 2009-02-25 16:16:08.000000000 +0000
++++ mpfr-2.4.1-b/version.c 2009-02-27 16:55:38.000000000 +0000
+@@ -25,5 +25,5 @@
+ const char *
+ mpfr_get_version (void)
+ {
+- return "2.4.1";
++ return "2.4.1-p1";
+ }
diff --git a/dev-libs/mpfr/files/2.4.1/patch02 b/dev-libs/mpfr/files/2.4.1/patch02
new file mode 100644
index 0000000..f14df45
--- /dev/null
+++ b/dev-libs/mpfr/files/2.4.1/patch02
@@ -0,0 +1,55 @@
+--- a/mpfr-gmp.h 2008-11-28 03:03:22.000000000 +0800
++++ b/mpfr-gmp.h 2008-11-28 03:04:29.000000000 +0800
+@@ -179,6 +179,10 @@
+ typedef unsigned int USItype __attribute__ ((mode (SI)));
+ typedef int DItype __attribute__ ((mode (DI)));
+ typedef unsigned int UDItype __attribute__ ((mode (DI)));
++#if BITS_PER_MP_LIMB == 64
++typedef int TItype __attribute__ ((mode (TI)));
++typedef unsigned int UTItype __attribute__ ((mode (TI)));
++#endif
+ #else
+ typedef unsigned char UQItype;
+ typedef long SItype;
+diff --git a/mpfr-longlong.h b/mpfr-longlong.h
+index 111b36c..57eba49 100644
+--- a/mpfr-longlong.h
++++ b/mpfr-longlong.h
+@@ -1011,27 +1011,23 @@ extern UWtype __MPN(udiv_qrnnd) _PROTO ((UWtype *, UWtype, UWtype, UWtype));
+ #endif /* __m88000__ */
+
+ #if defined (__mips) && W_TYPE_SIZE == 32
+-#if __GNUC__ > 2 || __GNUC_MINOR__ >= 7
+ #define umul_ppmm(w1, w0, u, v) \
+- __asm__ ("multu %2,%3" : "=l" (w0), "=h" (w1) : "d" (u), "d" (v))
+-#else
+-#define umul_ppmm(w1, w0, u, v) \
+- __asm__ ("multu %2,%3\n\tmflo %0\n\tmfhi %1" \
+- : "=d" (w0), "=d" (w1) : "d" (u), "d" (v))
+-#endif
++ do { \
++ UDItype __x = (UDItype) (USItype) (u) * (USItype) (v); \
++ (w1) = (USItype) (__x >> 32); \
++ (w0) = (USItype) (__x); \
++ } while (0)
+ #define UMUL_TIME 10
+ #define UDIV_TIME 100
+ #endif /* __mips */
+
+ #if (defined (__mips) && __mips >= 3) && W_TYPE_SIZE == 64
+-#if __GNUC__ > 2 || __GNUC_MINOR__ >= 7
+ #define umul_ppmm(w1, w0, u, v) \
+- __asm__ ("dmultu %2,%3" : "=l" (w0), "=h" (w1) : "d" (u), "d" (v))
+-#else
+-#define umul_ppmm(w1, w0, u, v) \
+- __asm__ ("dmultu %2,%3\n\tmflo %0\n\tmfhi %1" \
+- : "=d" (w0), "=d" (w1) : "d" (u), "d" (v))
+-#endif
++ do { \
++ UTItype __x = (UTItype) (UDItype) (u) * (UDItype) (v); \
++ (w1) = (UDItype) (__x >> 64); \
++ (w0) = (UDItype) (__x); \
++ } while (0)
+ #define UMUL_TIME 20
+ #define UDIV_TIME 140
+ #endif /* __mips */
diff --git a/dev-libs/mpfr/mpfr-2.4.1_p2.ebuild b/dev-libs/mpfr/mpfr-2.4.1_p2.ebuild
new file mode 100644
index 0000000..911d083
--- /dev/null
+++ b/dev-libs/mpfr/mpfr-2.4.1_p2.ebuild
@@ -0,0 +1,49 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-libs/mpfr/mpfr-2.4.1_p1.ebuild,v 1.6 2009/03/07 14:23:09 armin76 Exp $
+
+# NOTE: we cannot depend on autotools here starting with gcc-4.3.x
+inherit eutils
+
+MY_PV=${PV/_p*}
+MY_P=${PN}-${MY_PV}
+PLEVEL=${PV/*p}
+DESCRIPTION="library for multiple-precision floating-point computations with exact rounding"
+HOMEPAGE="http://www.mpfr.org/"
+SRC_URI="http://www.mpfr.org/mpfr-current/${MY_P}.tar.lzma"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 ~m68k ~mips ~ppc ppc64 s390 sh sparc ~sparc-fbsd x86 ~x86-fbsd"
+IUSE=""
+
+RDEPEND=">=dev-libs/gmp-4.1.4-r2"
+DEPEND="${RDEPEND}
+ app-arch/lzma-utils"
+
+S=${WORKDIR}/${MY_P}
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ [[ -d ${FILESDIR}/${PV} ]] && epatch "${FILESDIR}"/${PV}/*.patch
+ [[ ${PLEVEL} == ${PV} ]] && return 0
+ for ((i=1; i<=PLEVEL; ++i)) ; do
+ patch=patch$(printf '%02d' ${i})
+ if [[ -f ${FILESDIR}/${MY_PV}/${patch} ]] ; then
+ epatch "${FILESDIR}"/${MY_PV}/${patch}
+ elif [[ -f ${DISTDIR}/${PN}-${MY_PV}_p${i} ]] ; then
+ epatch "${DISTDIR}"/${PN}-${MY_PV}_p${i}
+ else
+ ewarn "${DISTDIR}/${PN}-${MY_PV}_p${i}"
+ die "patch ${i} missing - please report to bugs.gentoo.org"
+ fi
+ done
+ find . -type f -print0 | xargs -0 touch -r configure
+}
+
+src_install() {
+ emake install DESTDIR="${D}" || die
+ dodoc AUTHORS BUGS ChangeLog NEWS README TODO
+ dohtml *.html
+}