aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBart Ribbers <bribbers@disroot.org>2020-06-16 15:14:33 +0200
committerAriadne Conill <ariadne@dereferenced.org>2020-06-17 08:48:26 +0000
commit6c6c4382f752310cbfb87bede48b2e2462531a52 (patch)
treea04560934465150317e346cfb559ecf4c2bd8450
parent11a9d3906009b88aeab5bd3a256061c4421daf87 (diff)
downloadaports-6c6c4382f752310cbfb87bede48b2e2462531a52.tar.gz
aports-6c6c4382f752310cbfb87bede48b2e2462531a52.tar.bz2
aports-6c6c4382f752310cbfb87bede48b2e2462531a52.tar.xz
testing/newlib: add or1k support
-rw-r--r--testing/newlib/APKBUILD57
1 files changed, 31 insertions, 26 deletions
diff --git a/testing/newlib/APKBUILD b/testing/newlib/APKBUILD
index 58ab8fa769..552cf54557 100644
--- a/testing/newlib/APKBUILD
+++ b/testing/newlib/APKBUILD
@@ -1,31 +1,32 @@
# Maintainer: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
-_pkgbase=newlib
_targets="
+ arm-none-eabi
mips-mti-elf
msp430-elf
- arm-none-eabi
"
-pkgname="$_pkgbase"
+# or1k-elf fails to build on 32-bit architectures
+case "$CARCH" in
+ x86_64|aarch64|ppc64le|mips64) _targets="$targets or1k-elf"
+esac
+pkgname=newlib
pkgver="3.0.0.20180831"
-pkgrel=1
+pkgrel=2
pkgdesc="A C standard library implementation intended for use on embedded systems"
url="http://www.sourceware.org/newlib/"
makedepends="texinfo"
-arch="all !mips !mips64"
-license="BSD"
-source="
- ftp://sourceware.org/pub/${_pkgbase}/${_pkgbase}-${pkgver}.tar.gz
- "
+arch="all !s390x !mips !mips64" # Blocked by gcc-cross-embedded
+license="BSD-3-Clause"
+source="ftp://sourceware.org/pub/newlib/newlib-$pkgver.tar.gz"
options="!check"
for target in $_targets; do
targetnorm="${target//-/_}"
- subpackages="${_pkgbase}-${target}:${targetnorm} ${subpackages}"
- makedepends="binutils-${target} gcc-${target} ${makedepends}"
+ subpackages="newlib-$target:$targetnorm $subpackages"
+ makedepends="binutils-$target gcc-$target $makedepends"
done
-builddir="$srcdir/$_pkgbase-$pkgver"
+builddir="$srcdir/newlib-$pkgver"
# This package installes two version of the newlib library to remain compatible
# with projects expecting the GNU ARM Embedded Toolchain [1]. The nano version
@@ -36,9 +37,9 @@ builddir="$srcdir/$_pkgbase-$pkgver"
build() {
for target in $_targets; do
- mkdir "${builddir}/build-$target" "${builddir}/build-$target-nano"
+ mkdir "$builddir/build-$target" "$builddir/build-$target-nano"
# nano version
- cd "${builddir}/build-$target-nano"
+ cd "$builddir/build-$target-nano"
"$builddir"/configure \
--target=$target \
--prefix=/usr/ \
@@ -71,7 +72,7 @@ build() {
make
# regular version
- cd "${builddir}/build-$target"
+ cd "$builddir/build-$target"
"$builddir"/configure \
--host=$CHOST \
--target=$target \
@@ -101,32 +102,32 @@ build() {
package() {
for target in $_targets; do
- depends="$depends $_pkgbase-$target"
+ depends="$depends newlib-$target"
done
mkdir -p "$pkgdir"
}
_install_subpkg() {
- pkgdesc="A C standard library implementation intended for ${target}"
- target="${subpkgname#$_pkgbase-}"
- depends="binutils-${target} gcc-${target} ${depends}"
+ pkgdesc="A C standard library implementation intended for $target"
+ target="${subpkgname#newlib-}"
+ depends="binutils-$target gcc-$target $depends"
mkdir -p "$subpkgdir"
# install nano version
- cd "${builddir}/build-${target}-nano"
+ cd "$builddir/build-$target-nano"
make -j1 DESTDIR="$subpkgdir" install
# rename nano version libs
- cd "${subpkgdir}/usr/$target/lib"
+ cd "$subpkgdir/usr/$target/lib"
for file in $(find . -regex ".*\(c\|g\|rdimon\)\.a"); do
mv "$file" "${file%.a}_nano.a"
done
- mkdir -p "${subpkgdir}/usr/$target/include/nano"
- mv "${subpkgdir}/usr/$target/include/newlib.h" \
- "${subpkgdir}/usr/$target/include/nano/"
+ mkdir -p "$subpkgdir/usr/$target/include/nano"
+ mv "$subpkgdir/usr/$target/include/newlib.h" \
+ "$subpkgdir/usr/$target/include/nano/"
# install regular version
- cd "${builddir}/build-${target}"
+ cd "$builddir/build-$target"
make -j1 DESTDIR="$subpkgdir" install
- rm -rf "${subpkgdir}/deleteme"
+ rm -rf "$subpkgdir/deleteme"
}
arm_none_eabi() {
@@ -141,4 +142,8 @@ msp430_elf() {
_install_subpkg
}
+or1k_elf() {
+ _install_subpkg
+}
+
sha512sums="c195111ac61458fccbd700345cd8ed7806776b3d16557e9a86fbcdf0ff5f544bff7eb701e84defb3f6b4d6fc00674163fa89aead1b171ed3281470a4f6306d1f newlib-3.0.0.20180831.tar.gz"