upgpkg: wordpress 6.2.1-1
[ArchLinux/community.git] / or1k-elf-newlib / trunk / PKGBUILD
blobe86a96502725ac9d38bd95d62e2dad5c3f1b2a3e
1 # Maintainer: Filipe LaĆ­ns (FFY00) <lains@archlinux.org>
2 # Contributor: Anatol Pomozov <anatol.pomozov@gmail.com>
4 _target=or1k-elf
5 pkgname=$_target-newlib
6 pkgver=4.1.0
7 pkgrel=1
8 _upstream_ver=$pkgver
9 pkgdesc='A C standard library implementation intended for use on embedded systems (OpenRISC 1000 bare metal)'
10 arch=(any)
11 url='https://www.sourceware.org/newlib/'
12 license=(BSD)
13 makedepends=($_target-gcc)
14 options=(!emptydirs !strip)
15 source=(https://sourceware.org/pub/newlib/newlib-$_upstream_ver.tar.gz)
16 sha256sums=('f296e372f51324224d387cc116dc37a6bd397198756746f93a2b02e9a5d40154')
18 build() {
19   rm -rf build-{newlib,nano}
20   mkdir build-{newlib,nano}
22   export CFLAGS_FOR_TARGET='-g -O2 -ffunction-sections -fdata-sections'
23   cd "$srcdir"/build-newlib
24   ../newlib-$_upstream_ver/configure \
25     --target=$_target \
26     --prefix=/usr \
27     --enable-newlib-io-long-long \
28     --enable-newlib-io-c99-formats \
29     --enable-newlib-register-fini \
30     --enable-newlib-retargetable-locking \
31     --disable-newlib-supplied-syscalls \
32     --disable-nls
33   make
35   export CFLAGS_FOR_TARGET='-g -Os -ffunction-sections -fdata-sections'
36   cd "$srcdir"/build-nano
37   ../newlib-$_upstream_ver/configure \
38     --target=$_target \
39     --prefix=/usr \
40     --disable-newlib-supplied-syscalls \
41     --enable-newlib-reent-small \
42     --enable-newlib-retargetable-locking \
43     --disable-newlib-fvwrite-in-streamio \
44     --disable-newlib-fseek-optimization \
45     --disable-newlib-wide-orient \
46     --enable-newlib-nano-malloc \
47     --disable-newlib-unbuf-stream-opt \
48     --enable-lite-exit \
49     --enable-newlib-global-atexit \
50     --enable-newlib-nano-formatted-io \
51     --disable-nls
52   make
55 package() {
56   cd "$srcdir"/build-nano
57   make DESTDIR="$pkgdir" install -j1
58   find "$pkgdir" -regex ".*/lib\(c\|g\|rdimon\)\.a" -exec rename .a _nano.a '{}' \;
59   install -d "$pkgdir"/usr/$_target/include/newlib-nano
60   install -m644 -t "$pkgdir"/usr/$_target/include/newlib-nano "$pkgdir"/usr/$_target/include/newlib.h
62   cd "$srcdir"/build-newlib
63   make DESTDIR="$pkgdir" install -j1
65   find "$pkgdir"/usr/$_target/lib \( -name "*.a" -or -name "*.o" \) \
66        -exec $_target-objcopy -R .comment -R .note -R .debug_info -R .debug_aranges \
67        -R .debug_pubnames -R .debug_pubtypes -R .debug_abbrev -R .debug_line \
68        -R .debug_str -R .debug_ranges -R .debug_loc '{}' \;
70   install -d "$pkgdir"/usr/share/licenses/$pkgname/
71   install -m644 -t "$pkgdir"/usr/share/licenses/$pkgname/ "$srcdir"/newlib-$_upstream_ver/COPYING*