-
Notifications
You must be signed in to change notification settings - Fork 310
/
Copy pathnodejs-18.yaml
91 lines (79 loc) · 2.36 KB
/
nodejs-18.yaml
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
package:
name: nodejs-18
version: 18.18.1 # When bumping this, also bump the provides below!
epoch: 1
description: "JavaScript runtime built on V8 engine - LTS version"
copyright:
- license: MIT
dependencies:
runtime:
- npm
provides:
- nodejs=18.18.999
- nodejs-lts=18
environment:
contents:
packages:
- brotli-dev
- c-ares-dev
- icu-dev
- linux-headers
- nghttp2-dev
- openssl-dev
- python3
- py3-jinja2
- samurai
- zlib-dev
- wolfi-base
- busybox
- ca-certificates-bundle
- build-base
pipeline:
- uses: fetch
with:
uri: https://nodejs.org/dist/v${{package.version}}/node-v${{package.version}}.tar.gz
expected-sha256: f882080b1a5ee2fd5078521ec3016cb8472740d671d19465d377207d671af372
- uses: patch
with:
patches: nghttp2.patch
- name: Configure and build
runs: |
# Add defines recommended in libuv readme.
common_flags="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
# Compiling with O2 instead of Os increases binary size by ~10%
# (53.1 MiB -> 58.6 MiB), but also increases performance by ~20%
# according to v8/web-tooling-benchmark. Node.js is quite huge anyway;
# there are better options for size constrained environments.
export CFLAGS="${CFLAGS/-Os/-O2} $common_flags"
export CXXFLAGS="${CXXFLAGS/-Os/-O2} $common_flags"
export CPPFLAGS="${CPPFLAGS/-Os/-O2} $common_flags"
python3 configure.py --prefix=/usr \
--shared-brotli \
--shared-zlib \
--shared-openssl \
--shared-cares \
--shared-nghttp2 \
--ninja \
--openssl-use-def-ca-store \
--with-icu-default-data-dir=$(icu-config --icudatadir) \
--with-intl=system-icu \
--openssl-conf-name=openssl_conf \
--without-corepack
make BUILDTYPE=Release -j$(nproc)
- uses: autoconf/make
- uses: autoconf/make-install
- runs: |
make DESTDIR="$${{targets.destdir}}" install
- uses: strip
# Get rid of the bundled npm, we don't need it.
- runs: |
rm -rf "${{targets.destdir}}"/usr/lib/node_modules
rm "${{targets.destdir}}"/usr/bin/npm
rm "${{targets.destdir}}"/usr/bin/npx
update:
enabled: true
github:
identifier: nodejs/node
strip-prefix: v
use-tag: true
tag-filter: v18.