# Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ COMMIT="08e1515" EAPI="4" inherit cmake-utils DESCRIPTION="Library for emulating the Roland MT-32, CM-32L, CM-64 and LAPC-I" HOMEPAGE="https://github.com/munt/munt" SRC_URI="http://github.com/munt/munt/tarball/${COMMIT} -> munt-${PV}.tar.gz" LICENSE="LGPL-2.1" SLOT="0" KEYWORDS="~amd64 ~x86" IUSE="static-libs" DEPEND="" RDEPEND="" S="${WORKDIR}/munt-munt-${COMMIT}/mt32emu" src_prepare() { # Build shared instead of static. sed -i -e "/^install(TARGETS /,/^)/d" -e "s/STATIC/SHARED/g" CMakeLists.txt || die echo 'set_target_properties(mt32emu PROPERTIES VERSION "${libmt32emu_VERSION_MAJOR}.${libmt32emu_VERSION_MINOR}.${libmt32emu_VERSION_PATCH}" SOVERSION "${libmt32emu_VERSION_MAJOR}.${libmt32emu_VERSION_MINOR}")' >> CMakeLists.txt || die if use static-libs; then # Optionally build static as well. sed -n "/^add_library(/,/^)/{s/mt32emu SHARED/mt32emuStatic STATIC/;p}" CMakeLists.txt >> CMakeLists.txt || die fi } src_install() { cmake-utils_src_install dodoc AUTHORS NEWS README cd "${CMAKE_BUILD_DIR}" || die dolib.so libmt32emu.so* use static-libs && newlib.a libmt32emu{Static,}.a }