From 27a8f649949c36bfc3e45854e08c48a8eb06e07c Mon Sep 17 00:00:00 2001
From: Celeste <20312-Celeste@users.gitlab.alpinelinux.org>
Date: Tue, 16 Jan 2024 15:50:27 +0000
Subject: [PATCH] community/quickjs: upgrade to 0.20240113

---
 community/quickjs/00-makefile.patch  | 23 ++++++++++++-----------
 community/quickjs/01-sharedlib.patch | 18 +++++++++---------
 community/quickjs/APKBUILD           | 14 +++++++-------
 3 files changed, 28 insertions(+), 27 deletions(-)

diff --git a/community/quickjs/00-makefile.patch b/community/quickjs/00-makefile.patch
index 7de6cad880ee..6a9fae7b73a7 100644
--- a/community/quickjs/00-makefile.patch
+++ b/community/quickjs/00-makefile.patch
@@ -10,19 +10,21 @@ diff --git a/Makefile b/Makefile
 index 49b1f6f..086371c 100644
 --- a/Makefile
 +++ b/Makefile
-@@ -33,6 +33,7 @@ CONFIG_LTO=y
+@@ -33,6 +33,7 @@
  #CONFIG_WERROR=y
  # force 32 bit build for some utilities
  #CONFIG_M32=y
 +#CONFIG_STATIC=y
+ # cosmopolitan build (see https://github.com/jart/cosmopolitan)
+ #CONFIG_COSMO=y
  
- ifdef CONFIG_DARWIN
- # use clang instead of gcc
-@@ -112,11 +113,13 @@ CFLAGS_DEBUG=$(CFLAGS) -O0
- CFLAGS_SMALL=$(CFLAGS) -Os
- CFLAGS_OPT=$(CFLAGS) -O2
+@@ -126,13 +127,14 @@
  CFLAGS_NOLTO:=$(CFLAGS_OPT)
--LDFLAGS=-g
+ ifdef CONFIG_COSMO
+ LDFLAGS+=-s # better to strip by default
+-else
+-LDFLAGS+=-g
+ endif
 +ifdef CONFIG_STATIC
 +LDFLAGS+=-static
 +endif
@@ -36,7 +38,7 @@ index 49b1f6f..086371c 100644
  endif
  ifdef CONFIG_PROFILE
  CFLAGS+=-p
-@@ -126,11 +129,11 @@ ifdef CONFIG_ASAN
+@@ -142,10 +144,10 @@
  CFLAGS+=-fsanitize=address -fno-omit-frame-pointer
  LDFLAGS+=-fsanitize=address -fno-omit-frame-pointer
  endif
@@ -46,8 +48,7 @@ index 49b1f6f..086371c 100644
 +ifndef CONFIG_WIN32
 +ifndef CONFIG_STATIC
  LDEXPORT=-rdynamic
- endif
 +endif
+ endif
  
- PROGS=qjs$(EXE) qjsc$(EXE) run-test262
- ifneq ($(CROSS_PREFIX),)
+ ifndef CONFIG_COSMO
diff --git a/community/quickjs/01-sharedlib.patch b/community/quickjs/01-sharedlib.patch
index 698bc5fa7c5e..7d0827408ae2 100644
--- a/community/quickjs/01-sharedlib.patch
+++ b/community/quickjs/01-sharedlib.patch
@@ -1,6 +1,6 @@
 --- a/Makefile
 +++ b/Makefile
-@@ -154,6 +154,9 @@
+@@ -175,6 +175,9 @@
  ifdef CONFIG_LTO
  PROGS+=libquickjs.lto.a
  endif
@@ -10,7 +10,7 @@
  
  # examples
  ifeq ($(CROSS_PREFIX),)
-@@ -237,6 +240,11 @@
+@@ -256,6 +259,11 @@
  	$(AR) rcs $@ $^
  endif # CONFIG_LTO
  
@@ -22,14 +22,14 @@
  repl.c: $(QJSC) repl.js
  	$(QJSC) -c -o $@ -m repl.js
  
-@@ -309,6 +317,10 @@
- 	install -m644 libquickjs.a "$(DESTDIR)$(prefix)/lib/quickjs"
+@@ -328,6 +336,10 @@
+ 	install -m644 libquickjs.a "$(DESTDIR)$(PREFIX)/lib/quickjs"
  ifdef CONFIG_LTO
- 	install -m644 libquickjs.lto.a "$(DESTDIR)$(prefix)/lib/quickjs"
+ 	install -m644 libquickjs.lto.a "$(DESTDIR)$(PREFIX)/lib/quickjs"
 +endif
 +ifndef CONFIG_STATIC
-+	install -Dm755 libquickjs.so.$(VERSION) -t "$(DESTDIR)$(prefix)/lib"
-+	ln -s libquickjs.so.$(VERSION) "$(DESTDIR)$(prefix)/lib/libquickjs.so"
++	install -Dm755 libquickjs.so.$(VERSION) -t "$(DESTDIR)$(PREFIX)/lib"
++	ln -s libquickjs.so.$(VERSION) "$(DESTDIR)$(PREFIX)/lib/libquickjs.so"
  endif
- 	mkdir -p "$(DESTDIR)$(prefix)/include/quickjs"
- 	install -m644 quickjs.h quickjs-libc.h "$(DESTDIR)$(prefix)/include/quickjs"
+ 	mkdir -p "$(DESTDIR)$(PREFIX)/include/quickjs"
+ 	install -m644 quickjs.h quickjs-libc.h "$(DESTDIR)$(PREFIX)/include/quickjs"
diff --git a/community/quickjs/APKBUILD b/community/quickjs/APKBUILD
index d2be43a1eda1..9632dcffe490 100644
--- a/community/quickjs/APKBUILD
+++ b/community/quickjs/APKBUILD
@@ -1,7 +1,7 @@
 # Contributor: Chloe Kudryavtsev <code@toast.bunkerlabs.net>
 # Maintainer: Patrycja Rosa <alpine@ptrcnull.me>
 pkgname=quickjs
-_pkgver=2023-12-09
+_pkgver=2024-01-13
 pkgver=0.${_pkgver//-}
 pkgrel=0
 pkgdesc="Small and embeddable Javascript engine"
@@ -23,12 +23,12 @@ builddir="$srcdir/$pkgname-$_pkgver"
 
 build() {
 	for bin in qjs qjsc ; do
-		CONFIG_STATIC=y make prefix=/usr $bin
+		CONFIG_STATIC=y make PREFIX=/usr $bin
 		cp $bin $bin.static
 	done
 	make clean
 
-	make prefix=/usr VERSION=$pkgver
+	make PREFIX=/usr VERSION=$pkgver
 }
 
 check() {
@@ -36,7 +36,7 @@ check() {
 }
 
 package() {
-	make install prefix="$pkgdir"/usr VERSION=$pkgver
+	make install DESTDIR="$pkgdir" PREFIX=/usr VERSION=$pkgver
 	for bin in qjs.static qjsc.static ; do
 		install -Dm755 $bin "$pkgdir"/usr/bin/$bin
 	done
@@ -51,7 +51,7 @@ static() {
 }
 
 sha512sums="
-c63cbff2c2e19512845e4fa2c1306eefcf03316f3e0f29187d6176aaddf840d0423d88429ec73d690da0297c78114092acff76b7f089cb8561214628c1e733c8  quickjs-2023-12-09.tar.xz
-256e18095c4c891b2f87ed473b04903a80b769f97f7ef4a60681d6496050f00c21a448f6bf1c858c8a3896dced18bfeec53d981c6f5bd1390d69a12bb91530ff  00-makefile.patch
-fb540e21a3cd6bd8119935e0f599bb329fea07a13754bb2d85d620c70d4eeb715ee264fb0c245b3ab5213d54cb106d09b2c9ca94648f1824c757971df4ee1265  01-sharedlib.patch
+9f426404e4dc1e2a41fcc235b72e58708041aed24eadd5fb9e82f62435501003d3a6b04831f307b04852551d2fd265b94cd400b3293ec0810465f52de8a6c057  quickjs-2024-01-13.tar.xz
+c69217ba9cd38e2c4a8fe6a55ea552dd1c1ece8ac77514e824cc90ff36c616c76e98c43f23397e8939412ad8303c7e0bb813762565f97075eee70017fdd27c82  00-makefile.patch
+0116e8562909e4867145b4b41a39c24600957ac57b048432ef068d18af007811f7eeab753d8902cd265d0327e64501c69160dfafee37ea840941e77514329514  01-sharedlib.patch
 "
-- 
GitLab