summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2023-06-02 22:44:23 +0100
committerSam James <sam@gentoo.org>2023-06-02 22:46:30 +0100
commit90ab23e9707f3e99d96ddffd3156e8b7463c6cf3 (patch)
tree846bd10939ee68e14d6bb68ed8d2ba82e751ebc3 /dev-libs/mpfr
parentsys-libs/readline: sync SRC_URI generation with app-shells/bash (diff)
downloadgentoo-90ab23e9707f3e99d96ddffd3156e8b7463c6cf3.tar.gz
gentoo-90ab23e9707f3e99d96ddffd3156e8b7463c6cf3.tar.bz2
gentoo-90ab23e9707f3e99d96ddffd3156e8b7463c6cf3.zip
dev-libs/mpfr: optimise SRC_URI generation
Thanks to radhermit's new pkgcraft tooling. Before: ``` dev-libs/mpfr-4.1.1_p1::.: 9.772001ms dev-libs/mpfr-4.2.0::.: 10.090884ms dev-libs/mpfr-4.1.0_p13-r1::.: 25.19919ms dev-libs/mpfr-4.2.0_p9::.: 42.215071ms ``` After: ``` dev-libs/mpfr-4.1.0_p13-r1::.: 8.216098ms dev-libs/mpfr-4.1.1_p1::.: 8.41175ms dev-libs/mpfr-4.2.0::.: 8.736772ms dev-libs/mpfr-4.2.0_p9::.: 9.751731ms ``` Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-libs/mpfr')
-rw-r--r--dev-libs/mpfr/mpfr-4.1.0_p13-r1.ebuild17
-rw-r--r--dev-libs/mpfr/mpfr-4.1.1_p1.ebuild17
-rw-r--r--dev-libs/mpfr/mpfr-4.2.0.ebuild16
-rw-r--r--dev-libs/mpfr/mpfr-4.2.0_p9.ebuild17
4 files changed, 51 insertions, 16 deletions
diff --git a/dev-libs/mpfr/mpfr-4.1.0_p13-r1.ebuild b/dev-libs/mpfr/mpfr-4.1.0_p13-r1.ebuild
index c745a8df1724..25319964c958 100644
--- a/dev-libs/mpfr/mpfr-4.1.0_p13-r1.ebuild
+++ b/dev-libs/mpfr/mpfr-4.1.0_p13-r1.ebuild
@@ -18,18 +18,27 @@ MY_P=${PN}-${MY_PV}
DESCRIPTION="Library for multiple-precision floating-point computations with exact rounding"
HOMEPAGE="https://www.mpfr.org/ https://gitlab.inria.fr/mpfr"
SRC_URI="https://www.mpfr.org/${MY_P}/${MY_P}.tar.xz"
+
if [[ ${PV} == *_p* ]] ; then
# If this is a patch release, we have to download each of the patches:
# -_pN = N patches
# - patch file names are like: patch01, patch02, ..., patch10, patch12, ..
#
# => name the ebuild _pN where N is the number of patches on the 'bugs' page.
- for ((my_patch_index=1; my_patch_index <= MY_PATCH; my_patch_index++)); do
- SRC_URI+=" $(printf "https://www.mpfr.org/${MY_P}/patch%02d -> ${MY_P}-patch%02d.patch " ${my_patch_index}{,})"
- MY_PATCHES+=( "${DISTDIR}"/$(printf ${MY_P}-patch%02d.patch ${my_patch_index}) )
+ patch_url_base="https://www.mpfr.org/${MY_P}"
+ my_patch_index=
+
+ for ((my_patch_index=1; my_patch_index <= MY_PATCH ; my_patch_index++)) ; do
+ printf -v mangled_patch_ver "patch%02d" "${my_patch_index}"
+
+ SRC_URI+=" ${patch_url_base}/${mangled_patch_ver} -> ${MY_P}-${mangled_patch_ver}.patch"
+
+ MY_PATCHES+=( "${DISTDIR}"/${MY_P}-${mangled_patch_ver}.patch )
done
- unset my_patch_index
+
+ unset patch_url_base my_patch_index mangled_patch_ver
fi
+
S="${WORKDIR}/${MY_P}"
LICENSE="LGPL-2.1"
diff --git a/dev-libs/mpfr/mpfr-4.1.1_p1.ebuild b/dev-libs/mpfr/mpfr-4.1.1_p1.ebuild
index f448fa9556f6..cfa58819d8f8 100644
--- a/dev-libs/mpfr/mpfr-4.1.1_p1.ebuild
+++ b/dev-libs/mpfr/mpfr-4.1.1_p1.ebuild
@@ -18,18 +18,27 @@ MY_P=${PN}-${MY_PV}
DESCRIPTION="Library for multiple-precision floating-point computations with exact rounding"
HOMEPAGE="https://www.mpfr.org/ https://gitlab.inria.fr/mpfr"
SRC_URI="https://www.mpfr.org/${MY_P}/${MY_P}.tar.xz"
+
if [[ ${PV} == *_p* ]] ; then
# If this is a patch release, we have to download each of the patches:
# -_pN = N patches
# - patch file names are like: patch01, patch02, ..., patch10, patch12, ..
#
# => name the ebuild _pN where N is the number of patches on the 'bugs' page.
- for ((my_patch_index=1; my_patch_index <= MY_PATCH; my_patch_index++)); do
- SRC_URI+=" $(printf "https://www.mpfr.org/${MY_P}/patch%02d -> ${MY_P}-patch%02d.patch " ${my_patch_index}{,})"
- MY_PATCHES+=( "${DISTDIR}"/$(printf ${MY_P}-patch%02d.patch ${my_patch_index}) )
+ patch_url_base="https://www.mpfr.org/${MY_P}"
+ my_patch_index=
+
+ for ((my_patch_index=1; my_patch_index <= MY_PATCH ; my_patch_index++)) ; do
+ printf -v mangled_patch_ver "patch%02d" "${my_patch_index}"
+
+ SRC_URI+=" ${patch_url_base}/${mangled_patch_ver} -> ${MY_P}-${mangled_patch_ver}.patch"
+
+ MY_PATCHES+=( "${DISTDIR}"/${MY_P}-${mangled_patch_ver}.patch )
done
- unset my_patch_index
+
+ unset patch_url_base my_patch_index mangled_patch_ver
fi
+
S="${WORKDIR}/${MY_P}"
LICENSE="LGPL-2.1"
diff --git a/dev-libs/mpfr/mpfr-4.2.0.ebuild b/dev-libs/mpfr/mpfr-4.2.0.ebuild
index 1306c9897965..2d6a6826dd43 100644
--- a/dev-libs/mpfr/mpfr-4.2.0.ebuild
+++ b/dev-libs/mpfr/mpfr-4.2.0.ebuild
@@ -27,12 +27,20 @@ if [[ ${PV} == *_p* ]] ; then
# - patch file names are like: patch01, patch02, ..., patch10, patch12, ..
#
# => name the ebuild _pN where N is the number of patches on the 'bugs' page.
- for ((my_patch_index=1; my_patch_index <= MY_PATCH; my_patch_index++)); do
- SRC_URI+=" $(printf "https://www.mpfr.org/${PN}-$(ver_cut 1-3)/patch%02d -> ${PN}-$(ver_cut 1-3)-patch%02d.patch " ${my_patch_index}{,})"
- MY_PATCHES+=( "${DISTDIR}"/$(printf ${PN}-$(ver_cut 1-3)-patch%02d.patch ${my_patch_index}) )
+ patch_url_base="https://www.mpfr.org/${MY_P}"
+ my_patch_index=
+
+ for ((my_patch_index=1; my_patch_index <= MY_PATCH ; my_patch_index++)) ; do
+ printf -v mangled_patch_ver "patch%02d" "${my_patch_index}"
+
+ SRC_URI+=" ${patch_url_base}/${mangled_patch_ver} -> ${MY_P}-${mangled_patch_ver}.patch"
+
+ MY_PATCHES+=( "${DISTDIR}"/${MY_P}-${mangled_patch_ver}.patch )
done
- unset my_patch_index
+
+ unset patch_url_base my_patch_index mangled_patch_ver
fi
+
S="${WORKDIR}/${MY_P}"
LICENSE="LGPL-2.1"
diff --git a/dev-libs/mpfr/mpfr-4.2.0_p9.ebuild b/dev-libs/mpfr/mpfr-4.2.0_p9.ebuild
index f622527c68cf..bcbbe69004fc 100644
--- a/dev-libs/mpfr/mpfr-4.2.0_p9.ebuild
+++ b/dev-libs/mpfr/mpfr-4.2.0_p9.ebuild
@@ -27,12 +27,21 @@ if [[ ${PV} == *_p* ]] ; then
# - patch file names are like: patch01, patch02, ..., patch10, patch12, ..
#
# => name the ebuild _pN where N is the number of patches on the 'bugs' page.
- for ((my_patch_index=1; my_patch_index <= MY_PATCH; my_patch_index++)); do
- SRC_URI+=" $(printf "https://www.mpfr.org/${PN}-$(ver_cut 1-3)/patch%02d -> ${PN}-$(ver_cut 1-3)-patch%02d.patch " ${my_patch_index}{,})"
- MY_PATCHES+=( "${DISTDIR}"/$(printf ${PN}-$(ver_cut 1-3)-patch%02d.patch ${my_patch_index}) )
+ patch_url_base="https://www.mpfr.org/${MY_P}"
+ my_patch_index=
+
+ for ((my_patch_index=1; my_patch_index <= MY_PATCH ; my_patch_index++)) ; do
+ printf -v mangled_patch_ver "patch%02d" "${my_patch_index}"
+
+ SRC_URI+=" ${patch_url_base}/${mangled_patch_ver} -> ${MY_P}-${mangled_patch_ver}.patch"
+
+ MY_PATCHES+=( "${DISTDIR}"/${MY_P}-${mangled_patch_ver}.patch )
done
- unset my_patch_index
+
+ unset patch_url_base my_patch_index mangled_patch_ver
+
fi
+
S="${WORKDIR}/${MY_P}"
LICENSE="LGPL-2.1"