# Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ EAPI=4 if [[ ${PV} == *9999 ]] ; then SCM="git-2" # EGIT_REPO_URI="git://git.etalabs.net/musl" EGIT_REPO_URI="/usr/src/musl" fi inherit eutils flag-o-matic toolchain-funcs ${SCM} DESCRIPTION="Lightweight C standard library" HOMEPAGE="http://www.etalabs.net/musl/" if [[ ${PV} == *9999 ]] ; then SRC_URI="" elif [[ ${PV%_p*} != ${PV} ]] ; then # Gentoo snapshot SRC_URI="http://dev.gentoo.org/~lu_zero/${PN}/${P}.tar.xz" else # Official release SRC_URI="http://www.etalabs.net/${PN}/releases/${P}.tar.gz" fi export CBUILD=${CBUILD:-${CHOST}} export CTARGET=${CTARGET:-${CHOST}} if [[ ${CTARGET} == ${CHOST} ]] ; then if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then export CTARGET=${CATEGORY/cross-} fi fi LICENSE="MIT" [[ ${CTARGET} != ${CHOST} ]] \ && SLOT="${CTARGET}" \ || SLOT="0" [[ ${PV} == *9999 ]] || KEYWORDS="~arm ~amd64 ~x86" IUSE="crosscompile_opts_headers-only debug" DEPEND="" RDEPEND="${DEPEND}" pkt_setup() { if [[ ${CTARGET} == ${CHOST} ]] ; then case ${CHOST} in *-musl) ;; *) die "Use sys-devel/crossdev to build a musl toolchain" esac fi } src_configure() { tc-export CC local myconf="--disable-gcc-wrapper" if tc-is-cross-compiler ; then myconf+=" --target=${CTARGET}" fi # $(use_enable static-libs static) \ ./configure ${myconf} \ --prefix=/usr \ $(use_enable debug) \ || die "configure failed" } src_install() { local sysroot=${D} local target=install [[ ${CTARGET} != ${CHOST} ]] && sysroot+="/usr/${CTARGET}" emake DESTDIR="${sysroot}" ${target} [[ ${CTARGET} != ${CHOST} ]] && \ dosym usr/include /usr/${CTARGET}/sys-include }