Skip to content

Commit

Permalink
media-sound/dcadec: convert to multilib and build shared libs.
Browse files Browse the repository at this point in the history
Package-Manager: portage-2.2.27
Signed-off-by: Alexis Ballier <[email protected]>
  • Loading branch information
aballier committed Feb 24, 2016
1 parent fdbc296 commit 8c33bb9
Showing 1 changed file with 25 additions and 7 deletions.
32 changes: 25 additions & 7 deletions media-sound/dcadec/dcadec-0.2.0.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
}

0 comments on commit 8c33bb9

Please sign in to comment.