summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: d4b4cc6a048415c03db59690d35f219f8ca85a7c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# Maintainer: swiftgeek

_target=aarch64-linux-gnu
pkgname=$_target-picolibc
pkgver=1.8.6
pkgrel=1
pkgdesc='Fork of newlib with stdio bits from avrlibc'
arch=('i686' 'x86_64')
url='https://github.com/picolibc/picolibc'
license=('BSD')
makedepends=("$_target-gcc" 'meson')
source=("picolibc-$pkgver.tar.gz::$url/archive/$pkgver.tar.gz")
sha256sums=('42696b358c249cfd6e13db672438d6549873ad26816823236e7c9447dbd01db0')
options=(!strip !buildflags)

# Check crosstool-ng for reliable/recent meson options to use
# Do not set `system-libc` as glibc is already the default one!
# `lib64` path comes from `aarch64-linux-gnu-gcc -print-multi-os-directory`
build() {
  meson setup \
    --prefix="/usr/$_target"/picolibc/ \
    --cross-file "picolibc-$pkgver/scripts/cross-${_target}.txt" \
    -Dlibdir="lib64" -Dspecsdir="/usr/$_target/lib/" \
    -Dmultilib=false -Dio-c99-formats=true -Dio-long-long=false \
    -Dnewlib-register-fini=false -Dnewlib-nano-malloc=true \
    -Dnewlib-atexit-dynamic-alloc=false -Dnewlib-global-atexit=false \
    -Dlite-exit=true -Dnewlib-multithread=true \
    -Dnewlib-retargetable-locking=true -Dsystem-libc=false \
    "picolibc-$pkgver" build

  meson compile -C build
}

package() {
  DESTDIR="$pkgdir" meson install -C build
  install -Dm644 -t "$pkgdir/usr/share/licenses/$pkgname/" "$srcdir/picolibc-$pkgver/COPYING."{GPL2,NEWLIB,picolibc}
}

# vim: set ts=2 sw=2 et: