commit:     91b1318ad198df0d7117825a12fb0507346ca557
Author:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Sat Apr 13 07:30:04 2024 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Sat Apr 13 07:32:20 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=91b1318a

media-libs/imlib: more refactors

- use PATCHES
- use ver_cut instead of custom version extract
- use array for econf args
- use "-delete" of find command

Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>

 media-libs/imlib/imlib-1.9.15-r8.ebuild | 42 +++++++++++++++++----------------
 1 file changed, 22 insertions(+), 20 deletions(-)

diff --git a/media-libs/imlib/imlib-1.9.15-r8.ebuild 
b/media-libs/imlib/imlib-1.9.15-r8.ebuild
index d9d627be63f7..494be1fba26d 100644
--- a/media-libs/imlib/imlib-1.9.15-r8.ebuild
+++ b/media-libs/imlib/imlib-1.9.15-r8.ebuild
@@ -5,10 +5,9 @@ EAPI=8
 
 inherit autotools multilib-minimal
 
-PVP=(${PV//[-\._]/ })
 DESCRIPTION="Image loading and rendering library"
 HOMEPAGE="https://ftp.acc.umu.se/pub/GNOME/sources/imlib/1.9/";
-SRC_URI="mirror://gnome/sources/${PN}/${PVP[0]}.${PVP[1]}/${P}.tar.bz2
+SRC_URI="mirror://gnome/sources/${PN}/$(ver_cut 1-2)/${P}.tar.bz2
        mirror://gentoo/gtk-1-for-imlib.m4.bz2"
 
 LICENSE="GPL-2"
@@ -27,33 +26,36 @@ RDEPEND="
 "
 DEPEND="${RDEPEND}"
 
-src_prepare() {
-       default
-
+PATCHES=(
        # Fix aclocal underquoted definition warnings.
        # Conditionalize gdk functions for bug 40453.
        # Fix imlib-config for bug 3425.
-       eapply "${FILESDIR}"/${P}.patch
-       eapply "${FILESDIR}"/${PN}-security.patch #security #72681
-       eapply "${FILESDIR}"/${P}-bpp16-CVE-2007-3568.patch # security #201887
-       eapply "${FILESDIR}"/${P}-fix-rendering.patch #197489
-       eapply "${FILESDIR}"/${P}-asneeded.patch #207638
-       eapply "${FILESDIR}"/${P}-libpng15.patch #357167
-       eapply "${FILESDIR}"/${P}-underlinking-test.patch #367645
-       eapply "${FILESDIR}"/${P}-no-LDFLAGS-in-pc.patch
-       eapply "${FILESDIR}"/${P}-giflib51-{1,2}.patch #538976
+       "${FILESDIR}"/${P}.patch
+       "${FILESDIR}"/${PN}-security.patch #security #72681
+       "${FILESDIR}"/${P}-bpp16-CVE-2007-3568.patch # security #201887
+       "${FILESDIR}"/${P}-fix-rendering.patch #197489
+       "${FILESDIR}"/${P}-asneeded.patch #207638
+       "${FILESDIR}"/${P}-libpng15.patch #357167
+       "${FILESDIR}"/${P}-underlinking-test.patch #367645
+       "${FILESDIR}"/${P}-no-LDFLAGS-in-pc.patch
+       "${FILESDIR}"/${P}-giflib51-{1,2}.patch #538976
+)
 
-       mkdir m4 && cp "${WORKDIR}"/gtk-1-for-imlib.m4 m4 || die
+src_prepare() {
+       default
 
+       mkdir m4 && cp "${WORKDIR}"/gtk-1-for-imlib.m4 m4 || die
        AT_M4DIR="m4" eautoreconf
 }
 
 multilib_src_configure() {
-       ECONF_SOURCE="${S}" econf \
-               --sysconfdir=/etc/imlib \
-               $(use_enable static-libs static) \
-               --disable-gdk \
+       local myeconfargs=(
+               --sysconfdir=/etc/imlib
+               $(use_enable static-libs static)
+               --disable-gdk
                --disable-gtktest
+       )
+       ECONF_SOURCE="${S}" econf "${myeconfargs[@]}"
 }
 
 multilib_src_install() {
@@ -69,5 +71,5 @@ multilib_src_install_all() {
 
        # Punt unused files
        rm -f "${D}"/usr/lib*/pkgconfig/imlibgdk.pc || die
-       find "${D}" -name '*.la' -exec rm -f {} + || die
+       find "${D}" -name '*.la' -delete || die
 }

Reply via email to