summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 1fd69398c51f56084806af530e3b56904aa93bdf (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
# 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=22.4.0.r616.g88beb76e5c1
pkgrel=1
pkgdesc="JavaScript runtime built on Chrome's V8 JavaScript engine"
arch=('i686' 'x86_64')
url="https://nodejs.org/"
license=('MIT')
depends=('glibc' 'c-ares' 'brotli' 'icu' 'libnghttp2' 'libnghttp3' 'libngtcp2' 'libuv' 'openssl' 'sqlite' 'zlib')
makedepends=('git' 'procps-ng' 'python')
optdepends=('npm: nodejs package manager')
provides=("nodejs=$pkgver")
conflicts=('nodejs')
options=('!lto')
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-cares \
    --shared-libuv \
    --shared-nghttp2 \
    --shared-nghttp3 \
    --shared-ngtcp2 \
    --shared-openssl \
    --shared-sqlite \
    --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"
}