mailing list of musl libc
 help / color / mirror / code / Atom feed
* musl live ebuild
@ 2012-07-30 22:54 Luca Barbato
  2012-08-01  0:59 ` John Spencer
  0 siblings, 1 reply; 4+ messages in thread
From: Luca Barbato @ 2012-07-30 22:54 UTC (permalink / raw)
  To: musl

[-- Attachment #1: Type: text/plain, Size: 254 bytes --]

It should work fine as system ebuild, using it in crossdev requires the
toolchain to be patched to understand musl isn't a bare-metal libc (the
default search path change between those)

lu

-- 

Luca Barbato
Gentoo/linux
http://dev.gentoo.org/~lu_zero


[-- Attachment #2: musl-9999.ebuild --]
[-- Type: text/plain, Size: 1735 bytes --]

# 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
}

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-08-01  7:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-30 22:54 musl live ebuild Luca Barbato
2012-08-01  0:59 ` John Spencer
2012-08-01  1:12   ` Kyle Sanderson
2012-08-01  7:33   ` Luca Barbato

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).