mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2026-05-04 20:06:43 +02:00
testing/quickjs: new aport
QuickJS is a small and embeddable Javascript engine. https://bellard.org/quickjs/ closes !51
This commit is contained in:
parent
8eb69640b9
commit
28eeede513
72
testing/quickjs/00-makefile.patch
Normal file
72
testing/quickjs/00-makefile.patch
Normal file
@ -0,0 +1,72 @@
|
||||
Source: Chloe "SpaceToast" Kudryavtsev <toast@toast.cafe>
|
||||
Remove When: The default Makefile doesn't enforce 32 bit binaries and allows for static linking.
|
||||
|
||||
1. Make M32 mode conditional and not dependent on cross-compilation (off by default).
|
||||
2. Fix up LIBS.
|
||||
3. Allow for static linking.
|
||||
--- a/Makefile 2019-09-04 19:14:04.134679886 -0400
|
||||
+++ b/Makefile 2019-09-04 19:15:42.761338716 -0400
|
||||
@@ -32,9 +32,8 @@
|
||||
# consider warnings as errors (for development)
|
||||
#CONFIG_WERROR=y
|
||||
-
|
||||
-ifndef CONFIG_WIN32
|
||||
# force 32 bit build for some utilities
|
||||
-CONFIG_M32=y
|
||||
-endif
|
||||
+#CONFIG_M32=y
|
||||
+#CONFIG_STATIC=y
|
||||
+
|
||||
ifdef CONFIG_DARWIN
|
||||
# use clang instead of gcc
|
||||
@@ -100,4 +99,7 @@
|
||||
CFLAGS_NOLTO:=$(CFLAGS_OPT)
|
||||
LDFLAGS=-g
|
||||
+ifdef CONFIG_STATIC
|
||||
+LDFLAGS+=-static
|
||||
+endif
|
||||
ifdef CONFIG_LTO
|
||||
CFLAGS_SMALL+=-flto
|
||||
@@ -113,9 +115,9 @@
|
||||
LDFLAGS+=-fsanitize=address
|
||||
endif
|
||||
-ifdef CONFIG_WIN32
|
||||
-LDEXPORT=
|
||||
-else
|
||||
+ifndef CONFIG_WIN32
|
||||
+ifndef CONFIG_STATIC
|
||||
LDEXPORT=-rdynamic
|
||||
endif
|
||||
+endif
|
||||
|
||||
PROGS=qjs$(EXE) qjsbn$(EXE) qjsc qjsbnc run-test262 run-test262-bn
|
||||
@@ -149,5 +151,5 @@
|
||||
QJSBN_OBJS=$(OBJDIR)/qjs.bn.o $(OBJDIR)/repl-bn.bn.o $(OBJDIR)/qjscalc.bn.o $(QJSBN_LIB_OBJS)
|
||||
|
||||
-LIBS=-lm
|
||||
+LIBS=-lm -pthread
|
||||
ifndef CONFIG_WIN32
|
||||
LIBS+=-ldl
|
||||
@@ -235,17 +237,17 @@
|
||||
|
||||
run-test262: $(OBJDIR)/run-test262.o $(QJS_LIB_OBJS)
|
||||
- $(CC) $(LDFLAGS) -o $@ $^ $(LIBS) -lpthread
|
||||
+ $(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
|
||||
|
||||
run-test262-bn: $(OBJDIR)/run-test262.bn.o $(QJSBN_LIB_OBJS)
|
||||
- $(CC) $(LDFLAGS) -o $@ $^ $(LIBS) -lpthread
|
||||
+ $(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
|
||||
|
||||
run-test262-debug: $(patsubst %.o, %.debug.o, $(OBJDIR)/run-test262.o $(QJS_LIB_OBJS))
|
||||
- $(CC) $(LDFLAGS) -o $@ $^ $(LIBS) -lpthread
|
||||
+ $(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
|
||||
|
||||
run-test262-32: $(patsubst %.o, %.m32.o, $(OBJDIR)/run-test262.o $(QJS_LIB_OBJS))
|
||||
- $(CC) -m32 $(LDFLAGS) -o $@ $^ $(LIBS) -lpthread
|
||||
+ $(CC) -m32 $(LDFLAGS) -o $@ $^ $(LIBS)
|
||||
|
||||
run-test262-bn32: $(patsubst %.o, %.m32.o, $(OBJDIR)/run-test262.bn.o $(QJSBN_LIB_OBJS))
|
||||
- $(CC) -m32 $(LDFLAGS) -o $@ $^ $(LIBS) -lpthread
|
||||
+ $(CC) -m32 $(LDFLAGS) -o $@ $^ $(LIBS)
|
||||
|
||||
# object suffix order: bn, nolto, [m32|m32s]
|
||||
48
testing/quickjs/APKBUILD
Normal file
48
testing/quickjs/APKBUILD
Normal file
@ -0,0 +1,48 @@
|
||||
# Maintainer: Chloe Kudryavtsev <toast@toastin.space>
|
||||
pkgname="quickjs"
|
||||
_pkgver=2019-09-01
|
||||
pkgver=0.${pkgver//-}
|
||||
pkgrel=0
|
||||
pkgdesc="A small and embeddable Javascript engine"
|
||||
url="https://bellard.org/quickjs/"
|
||||
arch="all"
|
||||
license="MIT"
|
||||
subpackages="$pkgname-doc $pkgname-static"
|
||||
source="
|
||||
https://bellard.org/quickjs/quickjs-$_pkgver.tar.xz
|
||||
00-makefile.patch
|
||||
"
|
||||
builddir="$srcdir/$pkgname-$_pkgver"
|
||||
|
||||
build() {
|
||||
make CONFIG_STATIC=y
|
||||
for bin in qjs qjsc qjsbn qjsbnc; do
|
||||
cp $bin $bin.static
|
||||
done
|
||||
make clean
|
||||
|
||||
make
|
||||
}
|
||||
|
||||
check() {
|
||||
make test
|
||||
}
|
||||
|
||||
package() {
|
||||
make install prefix="$pkgdir"/usr
|
||||
for bin in qjs.static qjsc.static qjsbn.static qjsbnc.static; do
|
||||
install -Dm755 $bin "$pkgdir"/usr/bin/$bin
|
||||
done
|
||||
for doc in doc/*.html; do
|
||||
install -Dm644 $doc "$pkgdir"/usr/share/doc/quickjs/$doc
|
||||
done
|
||||
}
|
||||
|
||||
static() {
|
||||
pkgdesc="$pkgdesc - static binaries"
|
||||
mkdir -p "$subpkgdir"/usr/bin
|
||||
mv "$pkgdir"/usr/bin/*.static "$subpkgdir"/usr/bin/
|
||||
}
|
||||
|
||||
sha512sums="aaa2de18c36f4e49a81669d200e5b80decba05ebb3e4d08c3c602cdd57b7edfa682289c26b727a3533fbe783a884efba806e3a1be9f9d9fc5de9ff502634304c quickjs-2019-09-01.tar.xz
|
||||
7fb6e9fa9fdbe5967eaebd3530b4ea38bcea3d854746c52513d3ea8b4f01c25969e42e19e974b97da87f6d89d21aced3c548e34dfa7a809c2f8799c5d967fff6 00-makefile.patch"
|
||||
Loading…
x
Reference in New Issue
Block a user