summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 989d7f6a8b9e17a452fb89730f3b22017f7c77fc (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
# Maintainer: Chocobo1 <chocobo1 AT archlinux DOT net>
# Contributor: Lex Black <autumn-wind at web dot de>
# Contributor: Bartłomiej Piotrowski <nospam@bpiotrowski.pl>

pkgname=nodejs-git
pkgver=19.9.0.r1361.g6dcbf8b6166
pkgrel=1
pkgdesc="JavaScript runtime built on Chrome's V8 JavaScript engine"
arch=('i686' 'x86_64')
url="https://nodejs.org/"
license=('MIT')
depends=('glibc' 'brotli' 'icu' 'libnghttp2' 'libuv' 'openssl' 'zlib')  # c-ares http-parser
makedepends=('git' 'procps-ng' 'python')
optdepends=('npm: nodejs package manager')
provides=("nodejs=$pkgver")
conflicts=('nodejs')
source=("git+https://github.com/nodejs/node.git")
sha256sums=('SKIP')


pkgver() {
  cd "node"

  _tag=$(git tag -l --sort -v:refname | head -n1)
  _rev=$(git rev-list --count $_tag..HEAD)
  _hash=$(git rev-parse --short HEAD)
  printf "%s.r%s.g%s" "$_tag" "$_rev" "$_hash" | sed 's/^v//;s/-/./g'
}

build() {
  cd "node"

  ./configure \
    --prefix="/usr" \
    --with-intl=system-icu \
    --without-npm \
    --shared-brotli \
    --shared-libuv \
    --shared-nghttp2 \
    --shared-openssl \
    --shared-zlib
  make
}

check() {
  cd "node"

  #make test
}

package() {
  cd "node"

  make DESTDIR="$pkgdir" install

  install -d "$pkgdir/usr/share/doc/nodejs"
  cp -r "doc/api" "$pkgdir/usr/share/doc/nodejs"

  install -Dm644 "LICENSE" -t "$pkgdir/usr/share/licenses/nodejs"
}