11# Template file for 'nodejs'
22pkgname=nodejs
33version=22.15.0
4- revision=1
5- hostmakedepends="which pkg-config python3-setuptools"
6- _make_depends="zlib-devel \
7- $(vopt_if icu icu-devel) \
8- $(vopt_if ssl openssl-devel) \
9- $(vopt_if libuv libuv-devel) \
10- $(vopt_if nghttp2 nghttp2-devel) \
11- $(vopt_if cares c-ares-devel) \
4+ revision=2
5+ build_style=configure
6+ configure_args="
7+ --prefix=/usr
8+ --enable-lto
9+ --shared-zlib
10+ --shared-ada
11+ $(vopt_if icu --with-intl=system-icu)
12+ $(vopt_if ssl --shared-openssl)
13+ $(vopt_if libuv --shared-libuv)
14+ $(vopt_if nghttp2 --shared-nghttp2)
15+ $(vopt_if cares --shared-cares)
16+ $(vopt_if brotli --shared-brotli)"
17+ make_build_args="V=1 LD=$CXX"
18+ hostmakedepends="pkg-config python3-setuptools"
19+ _make_depends="
20+ zlib-devel
21+ ada-devel
22+ $(vopt_if icu icu-devel)
23+ $(vopt_if ssl openssl-devel)
24+ $(vopt_if libuv libuv-devel)
25+ $(vopt_if nghttp2 nghttp2-devel)
26+ $(vopt_if cares c-ares-devel)
1227 $(vopt_if brotli brotli-devel)"
1328makedepends="${_make_depends}"
1429checkdepends="procps-ng iana-etc"
5671CFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
5772CXXFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
5873
59- do_configure() {
60- local _args
74+ post_patch() {
75+ vsed -e 's/install: all/install:/' -i Makefile
76+ }
6177
78+ pre_configure() {
6279 export LD="$CXX"
6380 if [ "$CROSS_BUILD" ]; then
6481 case "$XBPS_TARGET_MACHINE" in
65- arm*) _args=" --dest-cpu=arm" ;;
66- aarch64*) _args=" --dest-cpu=arm64" ;;
67- ppc64*) _args=" --dest-cpu=ppc64" ;;
68- ppc*) _args=" --dest-cpu=ppc" ;;
69- mipsel*) _args=" --dest-cpu=mipsel" ;;
70- mips*) _args=" --dest-cpu=mips" ;;
71- i686*) _args=" --dest-cpu=x86" ;;
72- x86_64*) _args=" --dest-cpu=x86_64" ;;
73- riscv64*) _args=" --dest-cpu=riscv64" ;;
82+ arm*) configure_args+=" --dest-cpu=arm" ;;
83+ aarch64*) configure_args+=" --dest-cpu=arm64" ;;
84+ ppc64*) configure_args+=" --dest-cpu=ppc64" ;;
85+ ppc*) configure_args+=" --dest-cpu=ppc" ;;
86+ mipsel*) configure_args+=" --dest-cpu=mipsel" ;;
87+ mips*) configure_args+=" --dest-cpu=mips" ;;
88+ i686*) configure_args+=" --dest-cpu=x86" ;;
89+ x86_64*) configure_args+=" --dest-cpu=x86_64" ;;
90+ riscv64*) configure_args+=" --dest-cpu=riscv64" ;;
7491 *) msg_error "$pkgver: cannot be cross compiled for ${XBPS_TARGET_MACHINE}.\n" ;;
7592 esac
7693 # this is necessary - for example, normally compiling from ppc64le
@@ -79,23 +96,25 @@ do_configure() {
7996 #
8097 # that results in the toolset built for target only, and attempting
8198 # to execute it within the build system fails
82- _args+=" --cross-compiling"
99+ configure_args+=" --cross-compiling"
100+ fi
101+
102+ CFLAGS=${CFLAGS/-O2/}
103+ CXXFLAGS=${CXXFLAGS/-O2/}
104+ if [ "$XBPS_WORDSIZE" = 32 ]; then
105+ CFLAGS=${CFLAGS/-g /-g1 }
106+ CXXFLAGS=${CFLAGS/-g /-g1 }
83107 fi
84- ./configure --prefix=/usr --shared-zlib --enable-lto \
85- $(vopt_if icu --with-intl=system-icu) \
86- $(vopt_if ssl --shared-openssl) \
87- $(vopt_if libuv --shared-libuv) \
88- $(vopt_if nghttp2 --shared-nghttp2) \
89- $(vopt_if cares --shared-cares) \
90- $(vopt_if brotli --shared-brotli) ${_args}
91108}
92109
93- do_build() {
94- if [ "$CROSS_BUILD" ]; then
95- make LD="$CXX" LDFLAGS+=-ldl ${makejobs} PORTABLE=1 V=1
96- else
97- make LD="$CXX" LDFLAGS+=-ldl ${makejobs} V=1
110+ pre_build() {
111+ CFLAGS=${CFLAGS/-O2/}
112+ CXXFLAGS=${CXXFLAGS/-O2/}
113+ if [ "$XBPS_WORDSIZE" = 32 ]; then
114+ CFLAGS=${CFLAGS/-g /-g1 }
115+ CXXFLAGS=${CFLAGS/-g /-g1 }
98116 fi
117+ make_build_args+=" PORTABLE=1"
99118}
100119
101120do_check() {
@@ -148,9 +167,8 @@ test-tls-sni-server-client.js,\
148167 make CI_SKIP_TESTS="$CI_SKIP_TESTS" LD="$CXX" LDFLAGS+=-ldl ${makejobs} V=1 test-only
149168}
150169
151- do_install() {
152- make LD="$CXX" LDFLAGS+=-ldl DESTDIR="$DESTDIR" install
153- rm $DESTDIR/usr/include/node/openssl -rf
170+ post_install() {
171+ rm -rf $DESTDIR/usr/include/node/openssl
154172 vlicense LICENSE
155173}
156174
0 commit comments