summaryrefslogtreecommitdiff
path: root/dev-libs/mpfr
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
committerV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
commit8376ef56580626e9c0f796d5b85b53a0a1c7d5f5 (patch)
tree7681bbd4e8b05407772df40a4bf04cbbc8afc3fa /dev-libs/mpfr
parent30a9caf154332f12ca60756e1b75d2f0e3e1822d (diff)
gentoo resync : 14.07.2018
Diffstat (limited to 'dev-libs/mpfr')
-rw-r--r--dev-libs/mpfr/Manifest19
-rw-r--r--dev-libs/mpfr/files/mpfr-3.1.4-cygwin.patch39
-rw-r--r--dev-libs/mpfr/metadata.xml8
-rw-r--r--dev-libs/mpfr/mpfr-2.4.2_p3-r1.ebuild50
-rw-r--r--dev-libs/mpfr/mpfr-3.1.3_p4.ebuild62
-rw-r--r--dev-libs/mpfr/mpfr-3.1.4.ebuild55
-rw-r--r--dev-libs/mpfr/mpfr-3.1.5_p2.ebuild55
-rw-r--r--dev-libs/mpfr/mpfr-3.1.6.ebuild54
-rw-r--r--dev-libs/mpfr/mpfr-4.0.0-r1.ebuild60
-rw-r--r--dev-libs/mpfr/mpfr-4.0.1.ebuild60
10 files changed, 462 insertions, 0 deletions
diff --git a/dev-libs/mpfr/Manifest b/dev-libs/mpfr/Manifest
new file mode 100644
index 000000000000..d27e0c5519e8
--- /dev/null
+++ b/dev-libs/mpfr/Manifest
@@ -0,0 +1,19 @@
+AUX mpfr-3.1.4-cygwin.patch 1502 BLAKE2B 6b815ff4ff5880777be4d5b11cb416787d39650cb6bf665e1f131655d5a2094eb4611068b2690b2981d2a7e3aa93d123af969e9befcb85cfc0692f8a580c8cb0 SHA512 68cb97c873ce6f25b1cc8f74e7b367941565296d027bb76943b83c46fd7eb304479896ce69f1ae850b5a8ad5796c2a99a5c1949a0215be7cab74669d3352a82b
+DIST mpfr-2.4.2-patchset.tar.bz2 2965 BLAKE2B 2748f8ebea766265ea1b31de1c0494e89e8868440675e4f8b03a771b220f3007ffa1bfdeb84112560d95107d4075ed6e37d54aa71546c8bc7e518ff32a1adce6 SHA512 d28749096ff1d8ab026eba076d7874fd0687dd5199dcadb60ab9a5adcfbe4c1a4583c83e5d4868e16e2218247f129623128af89d41e1c348c64c1e91bcb5e653
+DIST mpfr-2.4.2.tar.bz2 1077886 BLAKE2B bdbd8fcd5b3f459383fff60adb75e3e419b65b20073a86fbad83677fa546f8f2364bce799f623964cafe94b1b8652a13b54cdae8d9316350c24061c396cafa8b SHA512 c004b3dbf86c04960e4a1f8db37a409a7cc4cb76135e76e98dcc5ad93aaa8deb62334ee13ff84447a7c12a5e8cb57f25c62ac908c24920f1fb1a38d79d4a4c5e
+DIST mpfr-3.1.3-patchset.tar.xz 12988 BLAKE2B b2ebf0f0d5b90f8f9618c71762ca3def64bad6c79e7b32ca0d9121d2ed4032b869b945359da79ba2eb2cca07789cc1ede1502bb998f5f1234b206825d2db6ebd SHA512 dd2de34aad0470920f75b8911701a2979205b3173b97c41d4b5cd9ff78a38633ca7d6993c2e5465b5e5f76066d46189a32437f5b79ac50c29f2a47970c0421ea
+DIST mpfr-3.1.3.tar.xz 1112096 BLAKE2B cd7bc886e73ff43e323cde837bc90a41cf97238054e1ffe597455314f307ff7d8c95756b1414ee030a1f974c8041669b75dbf90581c9c5705e3f5c8a1878de46 SHA512 79846fd82974269aa48152c2b6dbcb2321130dc4d0f0ba2eb94d56619b177add9b2077ebf88b4382c56db19c4215910e5a252f216715c1eee40baa299da42eb4
+DIST mpfr-3.1.4.tar.xz 1122152 BLAKE2B d8d686c3280c062a0941c37cb0a0bacfb25a03a6064489b56db331ffbd9369c453ded1357b2c5841fc72eee2ef36c4d7a8acc27418dcf5f045c7e4ea6615d682 SHA512 4ef61708834efdea6b85258f46f1b25ce1c55b912f44b117d8c3d5e06d8f1177e50f627d9736f3289bd159c5bb10c80e09d1ad9f6f52c4ff43c3496034b04232
+DIST mpfr-3.1.5-patchset.tar.xz 1840 BLAKE2B c18392ecc3325c0b889b540257f3bfe3c382a7f0d12a5dc87550e9ee884f87480bcfec7541e05c6c27bcfd7c5fa60d35f575f56ccea59912434b241f51e5d113 SHA512 24ae807db036345267623dd977387b154e905197aa826e82cfc8dcf324ade78f78aef9e86ca6e2cbc091e01a8da9ea6c52a91a5183375d5fab45e54912bd3fd8
+DIST mpfr-3.1.5.tar.xz 1126668 BLAKE2B f902925036a4310e7b10461438bae5d5770b95ca6bd897038dc306d597ea412013c869b3d2f9c4ba2a1d5e59eee67f562fc3bf5db8fd1584b70c1b30574e42f5 SHA512 3643469b9099b31e41d6ec9158196cd1c30894030c8864ee5b1b1e91b488bccbf7c263c951b03fe9f4ae6f9d29279e157a7dfed0885467d875f107a3d964f032
+DIST mpfr-3.1.6.tar.xz 1133672 BLAKE2B ab8b87be9d29e9ae5807976f72d65e16cd3e5b4c2ffc4e5bd7829e664250b1969a1ec3928b3519cd75365692e23eadfd413a8116f8c77d6cd66183020b72b656 SHA512 746ee74d5026f267f74ab352d850ed30ff627d530aa840c71b24793e44875f8503946bd7399905dea2b2dd5744326254d7889337fe94cfe58d03c4066e9d8054
+DIST mpfr-4.0.0.tar.xz 1406244 BLAKE2B 2d1e356ac1f7119aa8896c438e7e30c4b316780d76fa2690e50482005e9ff5d6b5cd368d4c9a524df66ea3e7f2942c627329fa15be83402209c6e249cd1abd28 SHA512 9c9c4535f33fffd2126d1c290e5eeda7cd2804219244643f09c9a2d2acfa3d410d2cb1e4a7bb77cd86cffc2fac59c7f5d32c9910317cac37dbca474ab6d63808
+DIST mpfr-4.0.1.tar.xz 1412692 BLAKE2B 3e8d5cf558071571c21417088e74b8cb94a2e179667af41f734a68c7bd89d4beff245b9344c4c37d2f6558036a1a8c9ad3ea5ec8fbde16d2c7ebbf37a22cf424 SHA512 137ad68bc1e33a155edc1247fcdba27f999cf48ed526773136584090ddf2cfdfc9ea79fbf74ea1943b835b4b1ff29b05087114738c6ad3b485848540f30cac4f
+EBUILD mpfr-2.4.2_p3-r1.ebuild 1497 BLAKE2B 7161fc539fd4de18e4c66a057bbddf9633e45a964fa628051c800a265140fdbea1652c3e8fa8ef1e9f156dcab58d8283761218382c5af7056dcbef2b63405342 SHA512 6634ef915f69bbd2ee2f27c01a4aef7f6c8e3258adc270fca97e55c8f2155fd66b6ab827c2152db1d9ce93aba7a96b884a05220dac3ae92c02b869efb8e9f6a4
+EBUILD mpfr-3.1.3_p4.ebuild 1823 BLAKE2B 1313196a76a17659dd2217930c7927aa36d21796a63892029bddaac05378166d9538798b76bac24cdabfa62bdbcef2355a7d72781200b9fcb65b43ddbdae0cb7 SHA512 ae4016e18528c4e4835760654581ffa59d1ce497af327a0f4c1f73f1e647d01a02cb5c8d900ad63e2567aecf21290cf11f13c3df6f7292a90a5c736e9877972e
+EBUILD mpfr-3.1.4.ebuild 1645 BLAKE2B 4dcdecbc94e30f09cd4b4619585309f40a52e0845b07cb3455fda73125a064b20bff587d894a2487a67ee75bc1448336903cf84b4267a19d2f9fb735e8e062e4 SHA512 b482c8e4d47251cd0cf9298d4a2881532844e86a7302f787d9f4b5f80c0597c170516ea33ed754c20bf587d4480d465fa2440d33db0ca984570de4e4d1716f4f
+EBUILD mpfr-3.1.5_p2.ebuild 1705 BLAKE2B 4f83cc7b2078c2649afefac597628bef22a87814bd314c294ba0659c50c16b17ee7e4ed74b66d00d9be733c0cfb3110e2528f482d549d9f5561d462422f96a5b SHA512 d257664f34a7a69fa414dc141023bf13314afa55194b66070dbf90cc43c48ee28775b6a22d17a8a5e33e2ae050c7157197136c22b6164418b5c16a171c54f3ab
+EBUILD mpfr-3.1.6.ebuild 1624 BLAKE2B 3b035335d20d7dbb20f385d54c3fc04241cb448f6ef9a02d7fc60145e20ba8834bdfbb8149714b4593832d6f8fcbb6fcc8edd17d4dc8b3a61841fd49922b7176 SHA512 88318ce5042b52c77e7a7ff3099bd23b9255a299df7a2eda382a9f41e774dd55652f1455cd30f831bb1bf01ea75ea2c93c6128c25c11bda9a8d84ba6b8e17174
+EBUILD mpfr-4.0.0-r1.ebuild 1731 BLAKE2B 4236d16c7a09560e28533302a13283da3efd381754dbc249e71c1b39eaf2745883ef83220c8a78b19b7b9e679ceab846254ed781e22d3585cd3762a9a851fafa SHA512 1be6eaf4d69bc6d17929095d608b320f4ebc080b5bfdc44cdf1583320b4c66290ea1eee1b1c2e62d0bbd86c889ba1212cf5f63cbb9db7a177540aa02e2500a7a
+EBUILD mpfr-4.0.1.ebuild 1731 BLAKE2B 4236d16c7a09560e28533302a13283da3efd381754dbc249e71c1b39eaf2745883ef83220c8a78b19b7b9e679ceab846254ed781e22d3585cd3762a9a851fafa SHA512 1be6eaf4d69bc6d17929095d608b320f4ebc080b5bfdc44cdf1583320b4c66290ea1eee1b1c2e62d0bbd86c889ba1212cf5f63cbb9db7a177540aa02e2500a7a
+MISC metadata.xml 257 BLAKE2B 468bd91200194cf2104205cb18f54d629954ed0d86d85a5d3e90af1942eb199d777a0ebc17d1f610f69326d3e0caa686255709f165466f5e0a675380373b30f9 SHA512 fd85d9cf15f6b7db96e4d184e32ae6f1503a5b70cb4cb1ce930ba13a1d5d4c4b24971781e95b7f3f9ead58b31760f84c368bc6fa2a793b4b5baf78259b047ff1
diff --git a/dev-libs/mpfr/files/mpfr-3.1.4-cygwin.patch b/dev-libs/mpfr/files/mpfr-3.1.4-cygwin.patch
new file mode 100644
index 000000000000..c051b4621bd2
--- /dev/null
+++ b/dev-libs/mpfr/files/mpfr-3.1.4-cygwin.patch
@@ -0,0 +1,39 @@
+https://bugs.gentoo.org/579840
+
+fix from upstream
+
+r10260 | vlefevre | 2016-04-08 19:17:07 -0400 (Fri, 08 Apr 2016) | 8 lines
+
+[src/mpfr-impl.h] Removed the detection of possible inconsistencies
+under Unix because the tests could yield spurious errors with Cygwin
+or other similar implementations. Moreover, such tests were used for
+debugging purpose or to detect potential problems in the environment,
+thus were not really useful for the end user. They were initially
+added in the win-thread-safe-dll branch (r9682, following a problem
+found in r9680). One alternative for checking by the MPFR developers
+would be to output the status of some internal macros in tversion.
+
+Index: src/mpfr-impl.h
+===================================================================
+--- src/mpfr-impl.h (revision 10259)
++++ src/mpfr-impl.h (revision 10260)
+@@ -208,19 +208,6 @@ typedef struct __gmpfr_cache_s *mpfr_cac
+ # define MPFR_WIN_THREAD_SAFE_DLL 1
+ #endif
+
+-/* Detect some possible inconsistencies under Unix. */
+-#if defined(__unix__)
+-# if defined(_WIN32)
+-# error "Both __unix__ and _WIN32 are defined"
+-# endif
+-# if __GMP_LIBGMP_DLL
+-# error "__unix__ is defined and __GMP_LIBGMP_DLL is true"
+-# endif
+-# if defined(MPFR_WIN_THREAD_SAFE_DLL)
+-# error "Both __unix__ and MPFR_WIN_THREAD_SAFE_DLL are defined"
+-# endif
+-#endif
+-
+ #if defined(__MPFR_WITHIN_MPFR) || !defined(MPFR_WIN_THREAD_SAFE_DLL)
+ extern MPFR_THREAD_ATTR mpfr_flags_t __gmpfr_flags;
+ extern MPFR_THREAD_ATTR mpfr_exp_t __gmpfr_emin;
diff --git a/dev-libs/mpfr/metadata.xml b/dev-libs/mpfr/metadata.xml
new file mode 100644
index 000000000000..e396f3755977
--- /dev/null
+++ b/dev-libs/mpfr/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>toolchain@gentoo.org</email>
+ <name>Gentoo Toolchain Project</name>
+</maintainer>
+</pkgmetadata>
diff --git a/dev-libs/mpfr/mpfr-2.4.2_p3-r1.ebuild b/dev-libs/mpfr/mpfr-2.4.2_p3-r1.ebuild
new file mode 100644
index 000000000000..7967195aea45
--- /dev/null
+++ b/dev-libs/mpfr/mpfr-2.4.2_p3-r1.ebuild
@@ -0,0 +1,50 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# this ebuild is only for the libmpfr.so.1 ABI SONAME
+
+EAPI="5"
+
+inherit eutils libtool multilib multilib-minimal flag-o-matic
+
+MY_PV=${PV/_p*}
+MY_P=${PN}-${MY_PV}
+DESCRIPTION="library for multiple-precision floating-point computations with exact rounding"
+HOMEPAGE="https://www.mpfr.org/"
+SRC_URI="https://www.mpfr.org/mpfr-${MY_PV}/${MY_P}.tar.bz2
+ https://dev.gentoo.org/~mgorny/dist/${MY_P}-patchset.tar.bz2"
+
+LICENSE="LGPL-2.1"
+SLOT="1"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE=""
+
+RDEPEND=">=dev-libs/gmp-4.1.4-r2:0[${MULTILIB_USEDEP}]"
+DEPEND="${RDEPEND}"
+
+S=${WORKDIR}/${MY_P}
+
+src_prepare() {
+ epatch "${WORKDIR}"/${MY_P}-patchset/patch*
+ sed -i '/if test/s:==:=:' configure #261016
+ find . -type f -exec touch -r configure {} +
+ elibtoolize
+}
+
+multilib_src_configure() {
+ # Newer gmp has deleted this define, so export it for older mpfr.
+ append-cppflags -D__gmp_const=const
+ # Make sure mpfr doesn't go probing toolchains it shouldn't #476336#19
+ ECONF_SOURCE=${S} \
+ user_redefine_cc=yes \
+ econf --disable-static
+}
+
+multilib_src_compile() {
+ emake libmpfr.la
+}
+
+multilib_src_install() {
+ emake DESTDIR="${D}" install-libLTLIBRARIES
+ rm -f "${ED}"/usr/*/libmpfr.{la,so,dylib,a}
+}
diff --git a/dev-libs/mpfr/mpfr-3.1.3_p4.ebuild b/dev-libs/mpfr/mpfr-3.1.3_p4.ebuild
new file mode 100644
index 000000000000..4a7ba6e98544
--- /dev/null
+++ b/dev-libs/mpfr/mpfr-3.1.3_p4.ebuild
@@ -0,0 +1,62 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+# NOTE: we cannot depend on autotools here starting with gcc-4.3.x
+inherit libtool multilib multilib-minimal preserve-libs
+
+MY_PV=${PV/_p*}
+MY_P=${PN}-${MY_PV}
+PLEVEL=${PV/*p}
+DESCRIPTION="library for multiple-precision floating-point computations with exact rounding"
+HOMEPAGE="https://www.mpfr.org/"
+SRC_URI="https://www.mpfr.org/mpfr-${MY_PV}/${MY_P}.tar.xz
+ https://dev.gentoo.org/~mgorny/dist/${MY_P}-patchset.tar.xz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="static-libs"
+
+RDEPEND=">=dev-libs/gmp-4.1.4-r2[${MULTILIB_USEDEP},static-libs?]"
+DEPEND="${RDEPEND}"
+
+S=${WORKDIR}/${MY_P}
+
+src_prepare() {
+ if [[ ${PLEVEL} != ${PV} ]] ; then
+ local i
+ for (( i = 1; i <= PLEVEL; ++i )) ; do
+ epatch "${WORKDIR}"/${MY_P}-patchset/patch$(printf '%02d' ${i})
+ done
+ fi
+ find . -type f -exec touch -r configure {} +
+ elibtoolize
+}
+
+multilib_src_configure() {
+ # Make sure mpfr doesn't go probing toolchains it shouldn't #476336#19
+ ECONF_SOURCE=${S} \
+ user_redefine_cc=yes \
+ econf \
+ --docdir="\$(datarootdir)/doc/${PF}" \
+ $(use_enable static-libs static)
+}
+
+multilib_src_install_all() {
+ use static-libs || find "${ED}"/usr -name '*.la' -delete
+
+ # clean up html/license install
+ pushd "${ED}"/usr/share/doc/${PF} >/dev/null
+ dohtml *.html && rm COPYING* *.html || die
+ popd >/dev/null
+}
+
+pkg_preinst() {
+ preserve_old_lib /usr/$(get_libdir)/libmpfr$(get_libname 1)
+}
+
+pkg_postinst() {
+ preserve_old_lib_notify /usr/$(get_libdir)/libmpfr$(get_libname 1)
+}
diff --git a/dev-libs/mpfr/mpfr-3.1.4.ebuild b/dev-libs/mpfr/mpfr-3.1.4.ebuild
new file mode 100644
index 000000000000..aed000a2fde4
--- /dev/null
+++ b/dev-libs/mpfr/mpfr-3.1.4.ebuild
@@ -0,0 +1,55 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+# NOTE: we cannot depend on autotools here starting with gcc-4.3.x
+inherit eutils libtool multilib-minimal
+
+MY_PV=${PV/_p*}
+MY_P=${PN}-${MY_PV}
+PLEVEL=${PV/*p}
+DESCRIPTION="library for multiple-precision floating-point computations with exact rounding"
+HOMEPAGE="https://www.mpfr.org/"
+SRC_URI="https://www.mpfr.org/mpfr-${MY_PV}/${MY_P}.tar.xz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="static-libs"
+
+RDEPEND=">=dev-libs/gmp-4.1.4-r2[${MULTILIB_USEDEP},static-libs?]"
+DEPEND="${RDEPEND}"
+
+S=${WORKDIR}/${MY_P}
+
+src_prepare() {
+ if [[ ${PLEVEL} != ${PV} ]] ; then
+ local i
+ for (( i = 1; i <= PLEVEL; ++i )) ; do
+ epatch "${FILESDIR}"/${MY_PV}/patch$(printf '%02d' ${i})
+ done
+ fi
+ epatch "${FILESDIR}"/${P}-cygwin.patch #579840
+ epatch_user
+ find . -type f -exec touch -r configure {} +
+ elibtoolize
+}
+
+multilib_src_configure() {
+ # Make sure mpfr doesn't go probing toolchains it shouldn't #476336#19
+ ECONF_SOURCE=${S} \
+ user_redefine_cc=yes \
+ econf \
+ --docdir="\$(datarootdir)/doc/${PF}" \
+ $(use_enable static-libs static)
+}
+
+multilib_src_install_all() {
+ use static-libs || find "${ED}"/usr -name '*.la' -delete
+
+ # clean up html/license install
+ pushd "${ED}"/usr/share/doc/${PF} >/dev/null
+ dohtml *.html && rm COPYING* *.html || die
+ popd >/dev/null
+}
diff --git a/dev-libs/mpfr/mpfr-3.1.5_p2.ebuild b/dev-libs/mpfr/mpfr-3.1.5_p2.ebuild
new file mode 100644
index 000000000000..09e5460b545c
--- /dev/null
+++ b/dev-libs/mpfr/mpfr-3.1.5_p2.ebuild
@@ -0,0 +1,55 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+# NOTE: we cannot depend on autotools here starting with gcc-4.3.x
+inherit eutils libtool multilib-minimal
+
+MY_PV=${PV/_p*}
+MY_P=${PN}-${MY_PV}
+PLEVEL=${PV/*p}
+DESCRIPTION="library for multiple-precision floating-point computations with exact rounding"
+HOMEPAGE="https://www.mpfr.org/"
+SRC_URI="https://www.mpfr.org/mpfr-${MY_PV}/${MY_P}.tar.xz
+ https://dev.gentoo.org/~mgorny/dist/${MY_P}-patchset.tar.xz"
+
+LICENSE="LGPL-2.1"
+SLOT="0/4" # libmpfr.so version
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="static-libs"
+
+RDEPEND=">=dev-libs/gmp-4.1.4-r2[${MULTILIB_USEDEP},static-libs?]"
+DEPEND="${RDEPEND}"
+
+S=${WORKDIR}/${MY_P}
+
+src_prepare() {
+ if [[ ${PLEVEL} != ${PV} ]] ; then
+ local i
+ for (( i = 1; i <= PLEVEL; ++i )) ; do
+ epatch "${WORKDIR}"/${MY_P}-patchset/patch$(printf '%02d' ${i})
+ done
+ fi
+ epatch_user
+ find . -type f -exec touch -r configure {} +
+ elibtoolize
+}
+
+multilib_src_configure() {
+ # Make sure mpfr doesn't go probing toolchains it shouldn't #476336#19
+ ECONF_SOURCE=${S} \
+ user_redefine_cc=yes \
+ econf \
+ --docdir="\$(datarootdir)/doc/${PF}" \
+ $(use_enable static-libs static)
+}
+
+multilib_src_install_all() {
+ use static-libs || find "${ED}"/usr -name '*.la' -delete
+
+ # clean up html/license install
+ pushd "${ED}"/usr/share/doc/${PF} >/dev/null || die
+ dohtml *.html && rm COPYING* *.html
+ popd >/dev/null || die
+}
diff --git a/dev-libs/mpfr/mpfr-3.1.6.ebuild b/dev-libs/mpfr/mpfr-3.1.6.ebuild
new file mode 100644
index 000000000000..adc199a660fd
--- /dev/null
+++ b/dev-libs/mpfr/mpfr-3.1.6.ebuild
@@ -0,0 +1,54 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+# NOTE: we cannot depend on autotools here starting with gcc-4.3.x
+inherit eutils libtool multilib-minimal
+
+MY_PV=${PV/_p*}
+MY_P=${PN}-${MY_PV}
+PLEVEL=${PV/*p}
+DESCRIPTION="library for multiple-precision floating-point computations with exact rounding"
+HOMEPAGE="https://www.mpfr.org/"
+SRC_URI="https://www.mpfr.org/mpfr-${MY_PV}/${MY_P}.tar.xz"
+
+LICENSE="LGPL-2.1"
+SLOT="0/4" # libmpfr.so version
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="static-libs"
+
+RDEPEND=">=dev-libs/gmp-4.1.4-r2[${MULTILIB_USEDEP},static-libs?]"
+DEPEND="${RDEPEND}"
+
+S=${WORKDIR}/${MY_P}
+
+src_prepare() {
+ if [[ ${PLEVEL} != ${PV} ]] ; then
+ local i
+ for (( i = 1; i <= PLEVEL; ++i )) ; do
+ epatch "${FILESDIR}"/${MY_PV}/patch$(printf '%02d' ${i})
+ done
+ fi
+ epatch_user
+ find . -type f -exec touch -r configure {} +
+ elibtoolize
+}
+
+multilib_src_configure() {
+ # Make sure mpfr doesn't go probing toolchains it shouldn't #476336#19
+ ECONF_SOURCE=${S} \
+ user_redefine_cc=yes \
+ econf \
+ --docdir="\$(datarootdir)/doc/${PF}" \
+ $(use_enable static-libs static)
+}
+
+multilib_src_install_all() {
+ use static-libs || find "${ED}"/usr -name '*.la' -delete
+
+ # clean up html/license install
+ pushd "${ED}"/usr/share/doc/${PF} >/dev/null || die
+ dohtml *.html && rm COPYING* *.html
+ popd >/dev/null || die
+}
diff --git a/dev-libs/mpfr/mpfr-4.0.0-r1.ebuild b/dev-libs/mpfr/mpfr-4.0.0-r1.ebuild
new file mode 100644
index 000000000000..f2ae19aea02d
--- /dev/null
+++ b/dev-libs/mpfr/mpfr-4.0.0-r1.ebuild
@@ -0,0 +1,60 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+# NOTE: we cannot depend on autotools here starting with gcc-4.3.x
+inherit libtool multilib-minimal preserve-libs
+
+MY_PV=${PV/_p*}
+MY_P=${PN}-${MY_PV}
+PLEVEL=${PV/*p}
+DESCRIPTION="library for multiple-precision floating-point computations with exact rounding"
+HOMEPAGE="https://www.mpfr.org/"
+SRC_URI="https://www.mpfr.org/mpfr-${MY_PV}/${MY_P}.tar.xz"
+
+LICENSE="LGPL-2.1"
+SLOT="0/6" # libmpfr.so version
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="static-libs"
+
+RDEPEND=">=dev-libs/gmp-5.0.0[${MULTILIB_USEDEP},static-libs?]"
+DEPEND="${RDEPEND}"
+
+S=${WORKDIR}/${MY_P}
+
+HTML_DOCS=( doc/FAQ.html )
+
+src_prepare() {
+ if [[ ${PLEVEL} != ${PV} ]] ; then
+ local i
+ for (( i = 1; i <= PLEVEL; ++i )) ; do
+ eapply "${FILESDIR}"/${MY_PV}/patch$(printf '%02d' ${i})
+ done
+ fi
+ eapply_user
+ find . -type f -exec touch -r configure {} +
+ elibtoolize
+}
+
+multilib_src_configure() {
+ # Make sure mpfr doesn't go probing toolchains it shouldn't #476336#19
+ ECONF_SOURCE=${S} \
+ user_redefine_cc=yes \
+ econf \
+ --docdir="\$(datarootdir)/doc/${PF}" \
+ $(use_enable static-libs static)
+}
+
+multilib_src_install_all() {
+ rm "${ED}"/usr/share/doc/"${P}"/COPYING*
+ use static-libs || find "${ED}"/usr -name '*.la' -delete
+}
+
+pkg_preinst() {
+ preserve_old_lib /usr/$(get_libdir)/libmpfr$(get_libname 4)
+}
+
+pkg_postinst() {
+ preserve_old_lib_notify /usr/$(get_libdir)/libmpfr$(get_libname 4)
+}
diff --git a/dev-libs/mpfr/mpfr-4.0.1.ebuild b/dev-libs/mpfr/mpfr-4.0.1.ebuild
new file mode 100644
index 000000000000..f2ae19aea02d
--- /dev/null
+++ b/dev-libs/mpfr/mpfr-4.0.1.ebuild
@@ -0,0 +1,60 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+# NOTE: we cannot depend on autotools here starting with gcc-4.3.x
+inherit libtool multilib-minimal preserve-libs
+
+MY_PV=${PV/_p*}
+MY_P=${PN}-${MY_PV}
+PLEVEL=${PV/*p}
+DESCRIPTION="library for multiple-precision floating-point computations with exact rounding"
+HOMEPAGE="https://www.mpfr.org/"
+SRC_URI="https://www.mpfr.org/mpfr-${MY_PV}/${MY_P}.tar.xz"
+
+LICENSE="LGPL-2.1"
+SLOT="0/6" # libmpfr.so version
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="static-libs"
+
+RDEPEND=">=dev-libs/gmp-5.0.0[${MULTILIB_USEDEP},static-libs?]"
+DEPEND="${RDEPEND}"
+
+S=${WORKDIR}/${MY_P}
+
+HTML_DOCS=( doc/FAQ.html )
+
+src_prepare() {
+ if [[ ${PLEVEL} != ${PV} ]] ; then
+ local i
+ for (( i = 1; i <= PLEVEL; ++i )) ; do
+ eapply "${FILESDIR}"/${MY_PV}/patch$(printf '%02d' ${i})
+ done
+ fi
+ eapply_user
+ find . -type f -exec touch -r configure {} +
+ elibtoolize
+}
+
+multilib_src_configure() {
+ # Make sure mpfr doesn't go probing toolchains it shouldn't #476336#19
+ ECONF_SOURCE=${S} \
+ user_redefine_cc=yes \
+ econf \
+ --docdir="\$(datarootdir)/doc/${PF}" \
+ $(use_enable static-libs static)
+}
+
+multilib_src_install_all() {
+ rm "${ED}"/usr/share/doc/"${P}"/COPYING*
+ use static-libs || find "${ED}"/usr -name '*.la' -delete
+}
+
+pkg_preinst() {
+ preserve_old_lib /usr/$(get_libdir)/libmpfr$(get_libname 4)
+}
+
+pkg_postinst() {
+ preserve_old_lib_notify /usr/$(get_libdir)/libmpfr$(get_libname 4)
+}