summaryrefslogtreecommitdiff
path: root/pcr/riscv64-linux-gnu-glibc/PKGBUILD
blob: 95b36be1ccba1ea3b452e699fa927999c56a8fb4 (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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# Maintainer (Arch): Anatol Pomozov
# Contributor: Andreas Grapentin <andreas@grapentin.org>

# parabola changes and rationale:
#  - adapted from aarch64-linux-gnu-glibc

_target=riscv64-linux-gnu
pkgname=$_target-glibc
_snapshot=20171231
pkgver=2.26.v$_snapshot
pkgrel=1
pkgdesc="GNU C Library riscv64 target"
arch=('x86_64')
url='https://github.com/riscv/riscv-gnu-toolchain'
license=('GPL' 'LGPL')
depends=($_target-gcc $_target-linux-api-headers)
makedepends=(git)
options=(!buildflags !strip staticlibs)
source=("$_target::git+https://github.com/riscv/riscv-gnu-toolchain#tag=v$_snapshot")
sha256sums=('SKIP')

prepare() {
  mkdir -p glibc-build

  cd "$srcdir/$_target"

  # fix submodule repo paths
  sed -i 's#\.\.#git://github.com/riscv#' .gitmodules
  # update submodule
  git submodule update --init riscv-glibc
}

build() {
  cd glibc-build

  echo "slibdir=/lib" >> configparms
  echo "rtlddir=/lib" >> configparms
  echo "sbindir=/bin" >> configparms
  echo "rootsbindir=/bin" >> configparms

  unset LD_LIBRARY_PATH

  export BUILD_CC=gcc
  export CC=${_target}-gcc
  export CXX=${_target}-g++
  export AR=${_target}-ar
  export RANLIB=${_target}-ranlib

  ../$_target/riscv-glibc/configure \
      --prefix=/usr \
      --target=$_target \
      --host=$_target \
      --libdir=/usr/lib \
      --libexecdir=/usr/lib \
      --disable-werror \
      --enable-shared \
      --enable-obsolete-rpc \
      --with-headers=/usr/$_target/include \
      --disable-multilib \
      --enable-kernel=3.0.0

  make
}

package() {
  cd glibc-build

  make install_root=$pkgdir/usr/$_target install
}