summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /sys-libs/newlib
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'sys-libs/newlib')
-rw-r--r--sys-libs/newlib/Manifest7
-rw-r--r--sys-libs/newlib/files/newlib-1.20.0-arm-targets.patch55
-rw-r--r--sys-libs/newlib/files/newlib-1.20.0-cris-install.patch13
-rw-r--r--sys-libs/newlib/files/newlib-2.1.0-msp430-destdir.patch41
-rw-r--r--sys-libs/newlib/metadata.xml8
-rw-r--r--sys-libs/newlib/newlib-1.18.0.ebuild72
-rw-r--r--sys-libs/newlib/newlib-1.19.0.ebuild72
-rw-r--r--sys-libs/newlib/newlib-1.20.0.ebuild77
-rw-r--r--sys-libs/newlib/newlib-2.0.0.ebuild70
-rw-r--r--sys-libs/newlib/newlib-2.1.0.ebuild75
-rw-r--r--sys-libs/newlib/newlib-2.2.0.20150423.ebuild82
-rw-r--r--sys-libs/newlib/newlib-2.2.0.ebuild83
-rw-r--r--sys-libs/newlib/newlib-9999.ebuild82
13 files changed, 737 insertions, 0 deletions
diff --git a/sys-libs/newlib/Manifest b/sys-libs/newlib/Manifest
new file mode 100644
index 000000000000..d5e19256c3f3
--- /dev/null
+++ b/sys-libs/newlib/Manifest
@@ -0,0 +1,7 @@
+DIST newlib-1.18.0.tar.gz 13598301 SHA256 d608f22b0b2e7725d2fca13cac19f34bc652d9773acadae778db9881746cb071 SHA512 67b80060fd7bb9d035c004cfbcfbc66b8c8f176366c1ce11ae68dd31b8ee3e02b59ad37ceaf6f54da3c35eeee977c462ddaff4492a27425128ee5d5898840771 WHIRLPOOL 04908a55d1e992877668b80a8e5743f433ab96b7d9f8ab0b936ff4aa27862024490e2856acb88188d7f45ecb0d2197cbc22362f8aaf10ff07b9d89d15d258906
+DIST newlib-1.19.0.tar.gz 14323667 SHA256 4f43807236b2274c220881ca69f7dc6aecc52f14bb32a6f03404d30780c25007 SHA512 041004947fbbf1a205f365512de52f9052060f35291827e38caa202c202a76e2f442bbd880abf8edd05317fe179b8c3cb94662b2688b58b3390136d6214ef6f6 WHIRLPOOL e24575945c4d2338694fb00230fa82d5081ba8bb8ddb84d68c1d9eaac778e229d2c56356b0ba5f962480478aeb39df1b4f301f60becb48e9feea923e6b57ceea
+DIST newlib-1.20.0.tar.gz 14571004 SHA256 c644b2847244278c57bec2ddda69d8fab5a7c767f3b9af69aa7aa3da823ff692 SHA512 2abf1d30980e460c4d6ffe4d1682e38403d056048e00675362256731e57fe6759d01e85bcba84258d211941926e13bf3c632ff3824931a844c8b2596e795451f WHIRLPOOL be7996e493b0f2be6992c579796ea9d6968ed3b0a4f5d9c58e1c8b255a1060df18e6ae3d7ecf3a291c5859a6c04bdd39296e9ee5811eb59e2e7646da27089f66
+DIST newlib-2.0.0.tar.gz 15868470 SHA256 49c29e9129325e7c3b221aa829743ddcd796d024440e47c80fc0d6769af72d8a SHA512 539cc6e3854a52a7871a822e35563ff0dff7124b667fd9471150b9c56f556c0bcc526dfb5503aba5160a5fb61955a3d0876df639374727d2a444b08f90dbf233 WHIRLPOOL f9fbd87e36c1bfc94cfabfdcfa3a347d611e275eafa9167f9c4b5adea6b1833b090960ba37503210146aec4060dc360f43c31dab5cb8def2d51db33fac935640
+DIST newlib-2.1.0.tar.gz 16199705 SHA256 3e4d5ab9f0508942b6231b8ade4f8e5048cf92c96ed574c2bd6bd3320a599a48 SHA512 6770864f9307abb2401a4e48f286845d3a4afc30b2ac987da4b964a5485cc3823b32d06a0abf61528e93c4ad8a3a0aa3cc1ecd3b033850e6b2bde6d9bbc9a547 WHIRLPOOL 6faba54a72c6242c694f43a7f2e62d23584fec658818201ee58e1d2954d45b58a5f4effd63f5274b99748ed7730db76e0cf2aa1ecfbdf7001f10929d7db6353c
+DIST newlib-2.2.0.20150423.tar.gz 17485660 SHA256 b1ff3642b246adc6ee546884cb9ea3b0913f17394cbf7ca4d3b82544fef759f7 SHA512 0eecaf5dbf6caf0e0fca3697dfd70e5f60ecbc0a3365852586bc40a32bd535ef0936fa7fc68fceda3426cdb9b6259de12ed00303cadeea09d95b5f1a07022bae WHIRLPOOL 37d78cf24a072819bcf098e3b384cf6fa3a11ded461d6fb12e8635169fcb8b638400622878ad947df55236957a6ce3884ad46f02f7351414842eb048ceed7d73
+DIST newlib-2.2.0.tar.gz 16521910 SHA256 f8add263b0737591aff451b12a00c262c2efac4fa87d741fa1c318fc3bb335be SHA512 ab9161f16845367c823b6709e3c5708969f29f05c77edb1cf969ff4202f358648f1e55080974599dcefed2fbced4694dc73748596e76c1aa37c50cddff6e4be3 WHIRLPOOL 8dfc23f93d774c5092d64d1482c3ecc6e3ba35395822bb1d52f5e3b86f644ee803927bff133883926f3e019cfd5d9f04ffe0dcaac20bdf144c542ba1dc3edff9
diff --git a/sys-libs/newlib/files/newlib-1.20.0-arm-targets.patch b/sys-libs/newlib/files/newlib-1.20.0-arm-targets.patch
new file mode 100644
index 000000000000..1704cc0ba7f4
--- /dev/null
+++ b/sys-libs/newlib/files/newlib-1.20.0-arm-targets.patch
@@ -0,0 +1,55 @@
+https://bugs.gentoo.org/413547
+
+From 3b98b99eaa23f242b984af8cbf4a0e707bc7eae8 Mon Sep 17 00:00:00 2001
+From: Corinna Vinschen <corinna@vinschen.de>
+Date: Thu, 23 Feb 2012 09:30:17 +0000
+Subject: [PATCH] * configure.host: Accept "arm*" host spec instead of
+ just "arm".
+
+---
+ newlib/ChangeLog | 4 ++++
+ newlib/configure.host | 8 ++++----
+ 2 files changed, 8 insertions(+), 4 deletions(-)
+
++2012-02-23 Dan Egnor <egnor@ofb.net>
+
+ * configure.host: Accept "arm*" host spec instead of just "arm".
+
+diff --git a/newlib/configure.host b/newlib/configure.host
+index a6673af..dc44e80 100644
+--- a/newlib/configure.host
++++ b/newlib/configure.host
+@@ -98,7 +98,7 @@ case "${host_cpu}" in
+ arc)
+ machine_dir=
+ ;;
+- arm)
++ arm*)
+ machine_dir=arm
+ ;;
+ avr*)
+@@ -367,7 +367,7 @@ case "${host}" in
+ arc-*-*)
+ sys_dir=arc
+ ;;
+- arm-*-*)
++ arm*-*-*)
+ sys_dir=arm
+ if [ "x${newlib_may_supply_syscalls}" = "xno" ] ; then
+ have_crt0="no"
+@@ -560,10 +560,10 @@ case "${host}" in
+ arc-*-*)
+ syscall_dir=syscalls
+ ;;
+- arm-*-pe)
++ arm*-*-pe)
+ syscall_dir=syscalls
+ ;;
+- arm-*-*)
++ arm*-*-*)
+ syscall_dir=syscalls
+ # If newlib is supplying syscalls, select which debug protocol is being used.
+ # ARM_RDP_MONITOR selects the Demon monitor.
+--
+1.7.8.5
+
diff --git a/sys-libs/newlib/files/newlib-1.20.0-cris-install.patch b/sys-libs/newlib/files/newlib-1.20.0-cris-install.patch
new file mode 100644
index 000000000000..05f571fbe258
--- /dev/null
+++ b/sys-libs/newlib/files/newlib-1.20.0-cris-install.patch
@@ -0,0 +1,13 @@
+sent upstream already
+
+--- libgloss/cris/Makefile.in
++++ libgloss/cris/Makefile.in
+@@ -228,7 +228,7 @@ install-lin:
+ *) \
+ set -e; \
+ for x in ${LIN_BSP} ${LIN_SCRIPTS} ${LIN_EXTRA}; do \
+- ${INSTALL_DATA} $$x ${tooldir}/lib${MULTISUBDIR}/$$x; \
++ ${INSTALL_DATA} $$x $(DESTDIR)${tooldir}/lib${MULTISUBDIR}/$$x; \
+ done;; \
+ esac
+
diff --git a/sys-libs/newlib/files/newlib-2.1.0-msp430-destdir.patch b/sys-libs/newlib/files/newlib-2.1.0-msp430-destdir.patch
new file mode 100644
index 000000000000..38fa2643dce3
--- /dev/null
+++ b/sys-libs/newlib/files/newlib-2.1.0-msp430-destdir.patch
@@ -0,0 +1,41 @@
+From 0a7009c61811b4451ff6cccda24f42ab07142603 Mon Sep 17 00:00:00 2001
+From: DJ Delorie <dj@redhat.com>
+Date: Thu, 23 Oct 2014 01:49:45 +0000
+Subject: [PATCH] 2014-10-22 Tim Harder <radhermit@gmail.com> *
+ msp430/Makefile.in: respect DESTDIR during install
+
+---
+ libgloss/ChangeLog | 4 ++++
+ libgloss/msp430/Makefile.in | 6 ++++--
+ 2 files changed, 8 insertions(+), 2 deletions(-)
+
+2014-10-22 Tim Harder <radhermit@gmail.com>
+
+ * msp430/Makefile.in: respect DESTDIR during install
+
+diff --git a/libgloss/msp430/Makefile.in b/libgloss/msp430/Makefile.in
+index d72051d..b9f5a6a 100644
+--- a/libgloss/msp430/Makefile.in
++++ b/libgloss/msp430/Makefile.in
+@@ -12,6 +12,7 @@
+
+ # Makefile for libgloss/msp430.
+
++DESTDIR =
+ VPATH = @srcdir@
+ srcdir = @srcdir@
+ objdir = .
+@@ -138,11 +139,11 @@
+
+ install: $(CRT) $(SIM_BSP) $(LIBNOSYS) $(LIB_CRT) $(SCRIPTS)
+ for c in $(CRT) $(SIM_BSP) $(LIBNOSYS) $(LIB_CRT); do \
+- $(INSTALL_DATA) $$c $(tooldir)/lib${MULTISUBDIR}/$$c ;\
++ $(INSTALL_DATA) $$c $(DESTDIR)$(tooldir)/lib${MULTISUBDIR}/$$c ;\
+ done
+ for c in $(SCRIPTS); do \
+ b=`basename $$c`; \
+- $(INSTALL_DATA) $$c $(tooldir)/lib${MULTISUBDIR}/$$b ;\
++ $(INSTALL_DATA) $$c $(DESTDIR)$(tooldir)/lib${MULTISUBDIR}/$$b ;\
+ done
+
+ clean mostlyclean:
diff --git a/sys-libs/newlib/metadata.xml b/sys-libs/newlib/metadata.xml
new file mode 100644
index 000000000000..c30294285aee
--- /dev/null
+++ b/sys-libs/newlib/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>toolchain</herd>
+<maintainer>
+<email>lu_zero@gentoo.org</email>
+</maintainer>
+</pkgmetadata>
diff --git a/sys-libs/newlib/newlib-1.18.0.ebuild b/sys-libs/newlib/newlib-1.18.0.ebuild
new file mode 100644
index 000000000000..d68e30774120
--- /dev/null
+++ b/sys-libs/newlib/newlib-1.18.0.ebuild
@@ -0,0 +1,72 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils flag-o-matic toolchain-funcs
+
+export CBUILD=${CBUILD:-${CHOST}}
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+
+DESCRIPTION="Newlib is a C library intended for use on embedded systems"
+HOMEPAGE="http://sourceware.org/newlib/"
+SRC_URI="ftp://sourceware.org/pub/newlib/${P}.tar.gz"
+
+LICENSE="NEWLIB LIBGLOSS GPL-2"
+[[ ${CTARGET} != ${CHOST} ]] \
+ && SLOT="${CTARGET}" \
+ || SLOT="0"
+KEYWORDS="-* ~arm ~hppa ~m68k ~mips ~ppc ~ppc64 ~sh ~sparc ~x86"
+IUSE="nls threads unicode crosscompile_opts_headers-only"
+RESTRICT="strip"
+
+NEWLIBBUILD="${WORKDIR}/build"
+
+pkg_setup() {
+ # Reject newlib-on-glibc type installs
+ if [[ ${CTARGET} == ${CHOST} ]] ; then
+ case ${CHOST} in
+ *-newlib|*-elf) ;;
+ *) die "Use sys-devel/crossdev to build a newlib toolchain" ;;
+ esac
+ fi
+}
+
+src_unpack() {
+ unpack ${A}
+ mkdir -p "${NEWLIBBUILD}"
+}
+
+src_compile() {
+ # we should fix this ...
+ unset LDFLAGS
+ CHOST=${CTARGET} strip-unsupported-flags
+
+ local myconf=""
+ [[ ${CTARGET} == "spu" ]] \
+ && myconf="${myconf} --disable-newlib-multithread" \
+ || myconf="${myconf} $(use_enable threads newlib-multithread)"
+
+ cd "${NEWLIBBUILD}"
+
+ ECONF_SOURCE=${S} \
+ econf \
+ $(use_enable unicode newlib-mb) \
+ $(use_enable nls) \
+ ${myconf} \
+ || die "econf failed"
+ emake || die "emake failed"
+}
+
+src_install() {
+ cd "${NEWLIBBUILD}"
+ emake -j1 DESTDIR="${D}" install || die
+# env -uRESTRICT CHOST=${CTARGET} prepallstrip
+ # minor hack to keep things clean
+ rm -fR "${D}"/usr/share/info
+ rm -fR "${D}"/usr/info
+}
diff --git a/sys-libs/newlib/newlib-1.19.0.ebuild b/sys-libs/newlib/newlib-1.19.0.ebuild
new file mode 100644
index 000000000000..d68e30774120
--- /dev/null
+++ b/sys-libs/newlib/newlib-1.19.0.ebuild
@@ -0,0 +1,72 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils flag-o-matic toolchain-funcs
+
+export CBUILD=${CBUILD:-${CHOST}}
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+
+DESCRIPTION="Newlib is a C library intended for use on embedded systems"
+HOMEPAGE="http://sourceware.org/newlib/"
+SRC_URI="ftp://sourceware.org/pub/newlib/${P}.tar.gz"
+
+LICENSE="NEWLIB LIBGLOSS GPL-2"
+[[ ${CTARGET} != ${CHOST} ]] \
+ && SLOT="${CTARGET}" \
+ || SLOT="0"
+KEYWORDS="-* ~arm ~hppa ~m68k ~mips ~ppc ~ppc64 ~sh ~sparc ~x86"
+IUSE="nls threads unicode crosscompile_opts_headers-only"
+RESTRICT="strip"
+
+NEWLIBBUILD="${WORKDIR}/build"
+
+pkg_setup() {
+ # Reject newlib-on-glibc type installs
+ if [[ ${CTARGET} == ${CHOST} ]] ; then
+ case ${CHOST} in
+ *-newlib|*-elf) ;;
+ *) die "Use sys-devel/crossdev to build a newlib toolchain" ;;
+ esac
+ fi
+}
+
+src_unpack() {
+ unpack ${A}
+ mkdir -p "${NEWLIBBUILD}"
+}
+
+src_compile() {
+ # we should fix this ...
+ unset LDFLAGS
+ CHOST=${CTARGET} strip-unsupported-flags
+
+ local myconf=""
+ [[ ${CTARGET} == "spu" ]] \
+ && myconf="${myconf} --disable-newlib-multithread" \
+ || myconf="${myconf} $(use_enable threads newlib-multithread)"
+
+ cd "${NEWLIBBUILD}"
+
+ ECONF_SOURCE=${S} \
+ econf \
+ $(use_enable unicode newlib-mb) \
+ $(use_enable nls) \
+ ${myconf} \
+ || die "econf failed"
+ emake || die "emake failed"
+}
+
+src_install() {
+ cd "${NEWLIBBUILD}"
+ emake -j1 DESTDIR="${D}" install || die
+# env -uRESTRICT CHOST=${CTARGET} prepallstrip
+ # minor hack to keep things clean
+ rm -fR "${D}"/usr/share/info
+ rm -fR "${D}"/usr/info
+}
diff --git a/sys-libs/newlib/newlib-1.20.0.ebuild b/sys-libs/newlib/newlib-1.20.0.ebuild
new file mode 100644
index 000000000000..767ce602672c
--- /dev/null
+++ b/sys-libs/newlib/newlib-1.20.0.ebuild
@@ -0,0 +1,77 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit eutils flag-o-matic toolchain-funcs
+
+export CBUILD=${CBUILD:-${CHOST}}
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+
+DESCRIPTION="Newlib is a C library intended for use on embedded systems"
+HOMEPAGE="http://sourceware.org/newlib/"
+SRC_URI="ftp://sourceware.org/pub/newlib/${P}.tar.gz"
+
+LICENSE="NEWLIB LIBGLOSS GPL-2"
+[[ ${CTARGET} != ${CHOST} ]] \
+ && SLOT="${CTARGET}" \
+ || SLOT="0"
+KEYWORDS="-* ~arm ~hppa ~m68k ~mips ~ppc ~ppc64 ~sh ~sparc ~x86"
+IUSE="nls threads unicode crosscompile_opts_headers-only"
+RESTRICT="strip"
+
+NEWLIBBUILD="${WORKDIR}/build"
+
+pkg_setup() {
+ # Reject newlib-on-glibc type installs
+ if [[ ${CTARGET} == ${CHOST} ]] ; then
+ case ${CHOST} in
+ *-newlib|*-elf) ;;
+ *) die "Use sys-devel/crossdev to build a newlib toolchain" ;;
+ esac
+ fi
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-cris-install.patch
+ epatch "${FILESDIR}"/${P}-arm-targets.patch #413547
+}
+
+src_configure() {
+ # we should fix this ...
+ unset LDFLAGS
+ CHOST=${CTARGET} strip-unsupported-flags
+
+ local myconf=""
+ [[ ${CTARGET} == "spu" ]] \
+ && myconf="${myconf} --disable-newlib-multithread" \
+ || myconf="${myconf} $(use_enable threads newlib-multithread)"
+
+ mkdir -p "${NEWLIBBUILD}"
+ cd "${NEWLIBBUILD}"
+
+ ECONF_SOURCE=${S} \
+ econf \
+ $(use_enable unicode newlib-mb) \
+ $(use_enable nls) \
+ ${myconf}
+}
+
+src_compile() {
+ emake -C "${NEWLIBBUILD}"
+}
+
+src_install() {
+ cd "${NEWLIBBUILD}"
+ emake -j1 DESTDIR="${D}" install
+# env -uRESTRICT CHOST=${CTARGET} prepallstrip
+ # minor hack to keep things clean
+ rm -fR "${D}"/usr/share/info
+ rm -fR "${D}"/usr/info
+}
diff --git a/sys-libs/newlib/newlib-2.0.0.ebuild b/sys-libs/newlib/newlib-2.0.0.ebuild
new file mode 100644
index 000000000000..24db8d219ced
--- /dev/null
+++ b/sys-libs/newlib/newlib-2.0.0.ebuild
@@ -0,0 +1,70 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit flag-o-matic toolchain-funcs
+
+export CBUILD=${CBUILD:-${CHOST}}
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+
+DESCRIPTION="Newlib is a C library intended for use on embedded systems"
+HOMEPAGE="http://sourceware.org/newlib/"
+SRC_URI="ftp://sourceware.org/pub/newlib/${P}.tar.gz"
+
+LICENSE="NEWLIB LIBGLOSS GPL-2"
+SLOT="0"
+KEYWORDS="-* arm hppa m68k ~mips ppc ppc64 sh sparc x86"
+IUSE="nls threads unicode crosscompile_opts_headers-only"
+RESTRICT="strip"
+
+NEWLIBBUILD="${WORKDIR}/build"
+
+pkg_setup() {
+ # Reject newlib-on-glibc type installs
+ if [[ ${CTARGET} == ${CHOST} ]] ; then
+ case ${CHOST} in
+ *-newlib|*-elf) ;;
+ *) die "Use sys-devel/crossdev to build a newlib toolchain" ;;
+ esac
+ fi
+}
+
+src_configure() {
+ # we should fix this ...
+ unset LDFLAGS
+ CHOST=${CTARGET} strip-unsupported-flags
+
+ local myconf=""
+ [[ ${CTARGET} == "spu" ]] \
+ && myconf="${myconf} --disable-newlib-multithread" \
+ || myconf="${myconf} $(use_enable threads newlib-multithread)"
+
+ mkdir -p "${NEWLIBBUILD}"
+ cd "${NEWLIBBUILD}"
+
+ ECONF_SOURCE=${S} \
+ econf \
+ $(use_enable unicode newlib-mb) \
+ $(use_enable nls) \
+ ${myconf}
+}
+
+src_compile() {
+ emake -C "${NEWLIBBUILD}"
+}
+
+src_install() {
+ cd "${NEWLIBBUILD}"
+ emake -j1 DESTDIR="${D}" install
+# env -uRESTRICT CHOST=${CTARGET} prepallstrip
+ # minor hack to keep things clean
+ rm -fR "${D}"/usr/share/info
+ rm -fR "${D}"/usr/info
+}
diff --git a/sys-libs/newlib/newlib-2.1.0.ebuild b/sys-libs/newlib/newlib-2.1.0.ebuild
new file mode 100644
index 000000000000..7f50e9877f0c
--- /dev/null
+++ b/sys-libs/newlib/newlib-2.1.0.ebuild
@@ -0,0 +1,75 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit flag-o-matic toolchain-funcs eutils
+
+export CBUILD=${CBUILD:-${CHOST}}
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+
+DESCRIPTION="Newlib is a C library intended for use on embedded systems"
+HOMEPAGE="http://sourceware.org/newlib/"
+SRC_URI="ftp://sourceware.org/pub/newlib/${P}.tar.gz"
+
+LICENSE="NEWLIB LIBGLOSS GPL-2"
+SLOT="0"
+KEYWORDS="-* ~arm ~hppa ~m68k ~mips ~ppc ~ppc64 ~sh ~sparc ~x86"
+IUSE="nls threads unicode crosscompile_opts_headers-only"
+RESTRICT="strip"
+
+NEWLIBBUILD="${WORKDIR}/build"
+
+pkg_setup() {
+ # Reject newlib-on-glibc type installs
+ if [[ ${CTARGET} == ${CHOST} ]] ; then
+ case ${CHOST} in
+ *-newlib|*-elf) ;;
+ *) die "Use sys-devel/crossdev to build a newlib toolchain" ;;
+ esac
+ fi
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-msp430-destdir.patch
+ epatch_user
+}
+
+src_configure() {
+ # we should fix this ...
+ unset LDFLAGS
+ CHOST=${CTARGET} strip-unsupported-flags
+
+ local myconf=""
+ [[ ${CTARGET} == "spu" ]] \
+ && myconf="${myconf} --disable-newlib-multithread" \
+ || myconf="${myconf} $(use_enable threads newlib-multithread)"
+
+ mkdir -p "${NEWLIBBUILD}"
+ cd "${NEWLIBBUILD}"
+
+ ECONF_SOURCE=${S} \
+ econf \
+ $(use_enable unicode newlib-mb) \
+ $(use_enable nls) \
+ ${myconf}
+}
+
+src_compile() {
+ emake -C "${NEWLIBBUILD}"
+}
+
+src_install() {
+ cd "${NEWLIBBUILD}"
+ emake -j1 DESTDIR="${D}" install
+# env -uRESTRICT CHOST=${CTARGET} prepallstrip
+ # minor hack to keep things clean
+ rm -fR "${D}"/usr/share/info
+ rm -fR "${D}"/usr/info
+}
diff --git a/sys-libs/newlib/newlib-2.2.0.20150423.ebuild b/sys-libs/newlib/newlib-2.2.0.20150423.ebuild
new file mode 100644
index 000000000000..710990d1c8c9
--- /dev/null
+++ b/sys-libs/newlib/newlib-2.2.0.20150423.ebuild
@@ -0,0 +1,82 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit flag-o-matic toolchain-funcs eutils
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://sourceware.org/git/newlib.git"
+ inherit git-r3
+else
+ SRC_URI="ftp://sourceware.org/pub/newlib/${P}.tar.gz"
+ if [[ ${PV} != *.201[5-9]???? ]] ; then
+ KEYWORDS="-* ~arm ~hppa ~m68k ~mips ~ppc ~ppc64 ~sh ~sparc ~x86"
+ fi
+fi
+
+export CBUILD=${CBUILD:-${CHOST}}
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+
+DESCRIPTION="Newlib is a C library intended for use on embedded systems"
+HOMEPAGE="http://sourceware.org/newlib/"
+
+LICENSE="NEWLIB LIBGLOSS GPL-2"
+SLOT="0"
+IUSE="nls threads unicode crosscompile_opts_headers-only"
+RESTRICT="strip"
+
+NEWLIBBUILD="${WORKDIR}/build"
+
+pkg_setup() {
+ # Reject newlib-on-glibc type installs
+ if [[ ${CTARGET} == ${CHOST} ]] ; then
+ case ${CHOST} in
+ *-newlib|*-elf) ;;
+ *) die "Use sys-devel/crossdev to build a newlib toolchain" ;;
+ esac
+ fi
+}
+
+src_prepare() {
+ epatch_user
+}
+
+src_configure() {
+ # we should fix this ...
+ unset LDFLAGS
+ CHOST=${CTARGET} strip-unsupported-flags
+
+ local myconf=""
+ [[ ${CTARGET} == "spu" ]] \
+ && myconf="${myconf} --disable-newlib-multithread" \
+ || myconf="${myconf} $(use_enable threads newlib-multithread)"
+
+ mkdir -p "${NEWLIBBUILD}"
+ cd "${NEWLIBBUILD}"
+
+ ECONF_SOURCE=${S} \
+ econf \
+ $(use_enable unicode newlib-mb) \
+ $(use_enable nls) \
+ ${myconf}
+}
+
+src_compile() {
+ emake -C "${NEWLIBBUILD}"
+}
+
+src_install() {
+ cd "${NEWLIBBUILD}"
+ emake -j1 DESTDIR="${D}" install
+# env -uRESTRICT CHOST=${CTARGET} prepallstrip
+ # minor hack to keep things clean
+ rm -fR "${D}"/usr/share/info
+ rm -fR "${D}"/usr/info
+}
diff --git a/sys-libs/newlib/newlib-2.2.0.ebuild b/sys-libs/newlib/newlib-2.2.0.ebuild
new file mode 100644
index 000000000000..f009c8d68ea7
--- /dev/null
+++ b/sys-libs/newlib/newlib-2.2.0.ebuild
@@ -0,0 +1,83 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit flag-o-matic toolchain-funcs eutils
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://sourceware.org/git/newlib.git"
+ inherit git-r3
+else
+ SRC_URI="ftp://sourceware.org/pub/newlib/${P}.tar.gz"
+ KEYWORDS="-* arm hppa m68k ~mips ppc ppc64 sh sparc x86"
+fi
+
+export CBUILD=${CBUILD:-${CHOST}}
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+
+DESCRIPTION="Newlib is a C library intended for use on embedded systems"
+HOMEPAGE="http://sourceware.org/newlib/"
+
+LICENSE="NEWLIB LIBGLOSS GPL-2"
+SLOT="0"
+IUSE="nls threads unicode crosscompile_opts_headers-only"
+RESTRICT="strip"
+
+# Handle the SLOT changes. #497344
+RDEPEND="!<${CATEGORY}/${PN}-2.1.0"
+
+NEWLIBBUILD="${WORKDIR}/build"
+
+pkg_setup() {
+ # Reject newlib-on-glibc type installs
+ if [[ ${CTARGET} == ${CHOST} ]] ; then
+ case ${CHOST} in
+ *-newlib|*-elf) ;;
+ *) die "Use sys-devel/crossdev to build a newlib toolchain" ;;
+ esac
+ fi
+}
+
+src_prepare() {
+ epatch_user
+}
+
+src_configure() {
+ # we should fix this ...
+ unset LDFLAGS
+ CHOST=${CTARGET} strip-unsupported-flags
+
+ local myconf=""
+ [[ ${CTARGET} == "spu" ]] \
+ && myconf="${myconf} --disable-newlib-multithread" \
+ || myconf="${myconf} $(use_enable threads newlib-multithread)"
+
+ mkdir -p "${NEWLIBBUILD}"
+ cd "${NEWLIBBUILD}"
+
+ ECONF_SOURCE=${S} \
+ econf \
+ $(use_enable unicode newlib-mb) \
+ $(use_enable nls) \
+ ${myconf}
+}
+
+src_compile() {
+ emake -C "${NEWLIBBUILD}"
+}
+
+src_install() {
+ cd "${NEWLIBBUILD}"
+ emake -j1 DESTDIR="${D}" install
+# env -uRESTRICT CHOST=${CTARGET} prepallstrip
+ # minor hack to keep things clean
+ rm -fR "${D}"/usr/share/info
+ rm -fR "${D}"/usr/info
+}
diff --git a/sys-libs/newlib/newlib-9999.ebuild b/sys-libs/newlib/newlib-9999.ebuild
new file mode 100644
index 000000000000..710990d1c8c9
--- /dev/null
+++ b/sys-libs/newlib/newlib-9999.ebuild
@@ -0,0 +1,82 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+inherit flag-o-matic toolchain-funcs eutils
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="git://sourceware.org/git/newlib.git"
+ inherit git-r3
+else
+ SRC_URI="ftp://sourceware.org/pub/newlib/${P}.tar.gz"
+ if [[ ${PV} != *.201[5-9]???? ]] ; then
+ KEYWORDS="-* ~arm ~hppa ~m68k ~mips ~ppc ~ppc64 ~sh ~sparc ~x86"
+ fi
+fi
+
+export CBUILD=${CBUILD:-${CHOST}}
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+
+DESCRIPTION="Newlib is a C library intended for use on embedded systems"
+HOMEPAGE="http://sourceware.org/newlib/"
+
+LICENSE="NEWLIB LIBGLOSS GPL-2"
+SLOT="0"
+IUSE="nls threads unicode crosscompile_opts_headers-only"
+RESTRICT="strip"
+
+NEWLIBBUILD="${WORKDIR}/build"
+
+pkg_setup() {
+ # Reject newlib-on-glibc type installs
+ if [[ ${CTARGET} == ${CHOST} ]] ; then
+ case ${CHOST} in
+ *-newlib|*-elf) ;;
+ *) die "Use sys-devel/crossdev to build a newlib toolchain" ;;
+ esac
+ fi
+}
+
+src_prepare() {
+ epatch_user
+}
+
+src_configure() {
+ # we should fix this ...
+ unset LDFLAGS
+ CHOST=${CTARGET} strip-unsupported-flags
+
+ local myconf=""
+ [[ ${CTARGET} == "spu" ]] \
+ && myconf="${myconf} --disable-newlib-multithread" \
+ || myconf="${myconf} $(use_enable threads newlib-multithread)"
+
+ mkdir -p "${NEWLIBBUILD}"
+ cd "${NEWLIBBUILD}"
+
+ ECONF_SOURCE=${S} \
+ econf \
+ $(use_enable unicode newlib-mb) \
+ $(use_enable nls) \
+ ${myconf}
+}
+
+src_compile() {
+ emake -C "${NEWLIBBUILD}"
+}
+
+src_install() {
+ cd "${NEWLIBBUILD}"
+ emake -j1 DESTDIR="${D}" install
+# env -uRESTRICT CHOST=${CTARGET} prepallstrip
+ # minor hack to keep things clean
+ rm -fR "${D}"/usr/share/info
+ rm -fR "${D}"/usr/info
+}