Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/extra/nodejs/PKGBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'extra/nodejs/PKGBUILD')
-rw-r--r--extra/nodejs/PKGBUILD35
1 files changed, 35 insertions, 0 deletions
diff --git a/extra/nodejs/PKGBUILD b/extra/nodejs/PKGBUILD
new file mode 100644
index 00000000..0a1713cb
--- /dev/null
+++ b/extra/nodejs/PKGBUILD
@@ -0,0 +1,35 @@
+# actually build a 32-bit version
+eval "$(
+ declare -f build | \
+ sed '
+ s|./configure|./configure --dest-cpu x86|g
+ '
+)"
+
+# linker runs out of memory on 32-bit
+eval "$(
+ declare -f build | \
+ sed '
+ 3 i LDFLAGS+=" -Wl,--no-keep-memory"
+ 3 i CFLAGS+=" -g1"
+ 3 i CXXFLAGS+=" -g1"
+ '
+)"
+
+# add -latomic where needed (i486)
+if [ "$CARCH" = 'i486' ]; then
+ source+=('node-17.1.0-atomic.patch')
+ sha512sums+=('a2acca076dc0f65e17ffb5ac0bbf4dc9b8be845a400b66b5f83f5efbfca16e01ecc675a307eb0c28527874dea6464699f3969c3ee9a94226af568fb18feca331')
+ eval "$(
+ declare -f prepare | \
+ sed '
+ $i patch -Np1 -i "../node-17.1.0-atomic.patch"
+ '
+ )"
+ eval "$(
+ declare -f build | \
+ sed '
+ 3 i LDFLAGS+=" -latomic"
+ '
+ )"
+fi