media-sound/dcadec: convert to multilib and build shared libs.
authorAlexis Ballier <aballier@gentoo.org>
Wed, 24 Feb 2016 10:26:30 +0000 (11:26 +0100)
committerAlexis Ballier <aballier@gentoo.org>
Wed, 24 Feb 2016 10:39:23 +0000 (11:39 +0100)
Package-Manager: portage-2.2.27
Signed-off-by: Alexis Ballier <aballier@gentoo.org>
media-sound/dcadec/dcadec-0.2.0.ebuild

index d93dc26aa6d6bf467adabdd82bfe5214efe569e8..dbd688612d1aa0ed1d1f502b27b5d2fc6d188009 100644 (file)
@@ -4,7 +4,7 @@
 
 EAPI="5"
 
-inherit toolchain-funcs multilib
+inherit toolchain-funcs multilib multilib-minimal
 
 if [[ ${PV} == "9999" ]] ; then
        EGIT_REPO_URI="git://github.com/foo86/dcadec.git"
@@ -20,18 +20,36 @@ HOMEPAGE="https://github.com/foo86/dcadec"
 LICENSE="LGPL-2.1"
 SLOT="0"
 IUSE=""
+DOCS=( CHANGELOG.md README.md )
 
-src_configure() {
-       tc-export AR CC
+src_prepare() {
        sed -i \
-               -e "/^PREFIX /s:=.*:= ${EPREFIX}/usr:" \
-               -e "/^LIBDIR /s:/lib:/$(get_libdir):" \
                -e '/^CFLAGS/s:-O3::' \
                Makefile || die
 }
 
-src_install() {
-       default
+multilib_src_compile() {
+       # Build shared libs
+       echo 'CONFIG_SHARED=1' >> .config
+
+       local target=all
+       multilib_is_native_abi || target=lib
+       tc-export AR CC
+       PREFIX="${EPREFIX}/usr" LIBDIR="${EPREFIX}/usr/$(get_libdir)" \
+               emake -f "${S}/Makefile" ${target}
+}
+
+multilib_src_install() {
+       local target=install
+       multilib_is_native_abi || target=install-lib
+       PREFIX="${EPREFIX}/usr" \
+               LIBDIR="${EPREFIX}/usr/$(get_libdir)" \
+               emake -f "${S}/Makefile" DESTDIR="${D}" ${target}
+}
+
+multilib_src_install_all() {
        # Rename the executable since it conflicts with libdca.
        mv "${ED}"/usr/bin/dcadec{,-new} || die
+
+       einstalldocs
 }