commit: 90ccf7f8b5e9bc5990f68152124c600bec8d8195 Author: Haelwenn (lanodan) Monnier <contact <AT> hacktivis <DOT> me> AuthorDate: Fri Feb 20 22:41:18 2026 +0000 Commit: Haelwenn Monnier <contact <AT> hacktivis <DOT> me> CommitDate: Fri Feb 20 22:42:47 2026 +0000 URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=90ccf7f8
dev-lang/quickjs: add 2025.09.13.2 Signed-off-by: Haelwenn (lanodan) Monnier <contact <AT> hacktivis.me> dev-lang/quickjs/Manifest | 1 + .../files/quickjs-2025-09-13-quickjs-pc.patch | 25 +++++++++ .../files/quickjs-2025-09-13-respect-flags.patch | 62 ++++++++++++++++++++++ dev-lang/quickjs/metadata.xml | 4 ++ dev-lang/quickjs/quickjs-2025.09.13.2.ebuild | 55 +++++++++++++++++++ 5 files changed, 147 insertions(+) diff --git a/dev-lang/quickjs/Manifest b/dev-lang/quickjs/Manifest index 3b12e69454..2636097c6f 100644 --- a/dev-lang/quickjs/Manifest +++ b/dev-lang/quickjs/Manifest @@ -1 +1,2 @@ DIST quickjs-2024-01-13.tar.xz 765800 BLAKE2B 6d65d9ae19ef816a7e4784821d138d2be9965bbbea42c11f13adc0560dc6d67db9cd75c367680a5caec34182a320819127fc0d0c95c10fcf441161ca7880d5aa SHA512 9f426404e4dc1e2a41fcc235b72e58708041aed24eadd5fb9e82f62435501003d3a6b04831f307b04852551d2fd265b94cd400b3293ec0810465f52de8a6c057 +DIST quickjs-2025-09-13-2.tar.xz 596244 BLAKE2B da4bdb04e87a3f6086287e352e878e9f5b78034feda5687f7e191a549a4e2e7a0aa54ce89dd25b99eb685ff83db5898021a314f05ca20830c99f59379c413c3e SHA512 ea20d9ce8b6e09e58f1c3dc51086cd23c1ca18de7b5711bbd88e86dbbba2589b950acd22003e33fbed94dd4ec3e1828e6af5342ea9c62024cce7ca11eca1029c diff --git a/dev-lang/quickjs/files/quickjs-2025-09-13-quickjs-pc.patch b/dev-lang/quickjs/files/quickjs-2025-09-13-quickjs-pc.patch new file mode 100644 index 0000000000..5347b9a46c --- /dev/null +++ b/dev-lang/quickjs/files/quickjs-2025-09-13-quickjs-pc.patch @@ -0,0 +1,25 @@ +diff --git a/Makefile b/Makefile +index dcbbf7e..04c67f1 100644 +--- a/Makefile ++++ b/Makefile +@@ -379,6 +379,8 @@ ifdef CONFIG_LTO + endif + mkdir -p "$(DESTDIR)$(PREFIX)/include/quickjs" + install -m644 quickjs.h quickjs-libc.h "$(DESTDIR)$(PREFIX)/include/quickjs" ++ mkdir -p "$(DESTDIR)$(PREFIX)/lib/pkgconfig" ++ sed -e "s,@VERSION@,$(shell cat VERSION)," -e "s,@INCDIR@,$(PREFIX)/include/quickjs," -e "s,@LIBDIR@,$(PREFIX)/lib/quickjs," quickjs.pc.in > "$(DESTDIR)$(PREFIX)/lib/pkgconfig/quickjs.pc" + + ############################################################################### + # examples +diff --git a/quickjs.pc.in b/quickjs.pc.in +new file mode 100644 +index 0000000..9c79525 +--- /dev/null ++++ b/quickjs.pc.in +@@ -0,0 +1,6 @@ ++Name: quickjs ++Description: Small and embeddable Javascript engine ++URL: https://bellard.org/quickjs/ ++Version: @VERSION@ ++Cflags: -I@INCDIR@ ++Libs: -L@LIBDIR@ -lquickjs diff --git a/dev-lang/quickjs/files/quickjs-2025-09-13-respect-flags.patch b/dev-lang/quickjs/files/quickjs-2025-09-13-respect-flags.patch new file mode 100644 index 0000000000..70676b202e --- /dev/null +++ b/dev-lang/quickjs/files/quickjs-2025-09-13-respect-flags.patch @@ -0,0 +1,62 @@ +From 95fcacedc0d84a8d10f8189ebe932d6774e2367c Mon Sep 17 00:00:00 2001 +From: "Haelwenn (lanodan) Monnier" <[email protected]> +Date: Fri, 20 Feb 2026 23:28:22 +0100 +Subject: [PATCH] Makefile: respect CFLAGS/LDFLAGS + +--- + Makefile | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +diff --git a/Makefile b/Makefile +index dcbbf7e..7d41f8a 100644 +--- a/Makefile ++++ b/Makefile +@@ -101,7 +101,7 @@ endif + ifdef CONFIG_CLANG + HOST_CC=clang + CC=$(CROSS_PREFIX)clang +- CFLAGS+=-g -Wall -MMD -MF $(OBJDIR)/$(@F).d ++ CFLAGS+=-Wall -MMD -MF $(OBJDIR)/$(@F).d + CFLAGS += -Wextra + CFLAGS += -Wno-sign-compare + CFLAGS += -Wno-missing-field-initializers +@@ -125,13 +125,13 @@ else ifdef CONFIG_COSMO + HOST_CC=gcc + CC=cosmocc + # cosmocc does not correct support -MF +- CFLAGS=-g -Wall #-MMD -MF $(OBJDIR)/$(@F).d ++ CFLAGS=-Wall #-MMD -MF $(OBJDIR)/$(@F).d + CFLAGS += -Wno-array-bounds -Wno-format-truncation + AR=cosmoar + else + HOST_CC=gcc + CC=$(CROSS_PREFIX)gcc +- CFLAGS+=-g -Wall -MMD -MF $(OBJDIR)/$(@F).d ++ CFLAGS+=-Wall -MMD -MF $(OBJDIR)/$(@F).d + CFLAGS += -Wno-array-bounds -Wno-format-truncation -Wno-infinite-recursion + ifdef CONFIG_LTO + AR=$(CROSS_PREFIX)gcc-ar +@@ -162,14 +162,14 @@ endif + endif + + CFLAGS+=$(DEFINES) +-CFLAGS_DEBUG=$(CFLAGS) -O0 +-CFLAGS_SMALL=$(CFLAGS) -Os +-CFLAGS_OPT=$(CFLAGS) -O2 ++CFLAGS_DEBUG=$(CFLAGS) ++CFLAGS_SMALL=$(CFLAGS) ++CFLAGS_OPT=$(CFLAGS) + CFLAGS_NOLTO:=$(CFLAGS_OPT) + ifdef CONFIG_COSMO + LDFLAGS+=-s # better to strip by default + else +-LDFLAGS+=-g ++LDFLAGS+= + endif + ifdef CONFIG_LTO + CFLAGS_SMALL+=-flto + +base-commit: f1139494d18a2053630c5ed3384a42bb70db3c53 +-- +2.52.0 + diff --git a/dev-lang/quickjs/metadata.xml b/dev-lang/quickjs/metadata.xml index 356813a285..15b3d8d405 100644 --- a/dev-lang/quickjs/metadata.xml +++ b/dev-lang/quickjs/metadata.xml @@ -6,6 +6,10 @@ <name>Denis Reva</name> <description>rarogcmex</description> </maintainer> + <maintainer type="person"> + <email>[email protected]</email> + <name>Haelwenn (lanodan) Monnier</name> + </maintainer> <use> <flag name="lto">Enable Link Time Optimizations (improves performance and decreases size of executables)</flag> </use> diff --git a/dev-lang/quickjs/quickjs-2025.09.13.2.ebuild b/dev-lang/quickjs/quickjs-2025.09.13.2.ebuild new file mode 100644 index 0000000000..c8c49dd09a --- /dev/null +++ b/dev-lang/quickjs/quickjs-2025.09.13.2.ebuild @@ -0,0 +1,55 @@ +# Copyright 2021-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit toolchain-funcs + +MY_P="${PN}-${PV//./-}" + +DESCRIPTION="Small embeddable Javascript engine" +HOMEPAGE="https://bellard.org/quickjs/" +SRC_URI="https://bellard.org/quickjs/${MY_P}.tar.xz" +S="${WORKDIR}/${MY_P%-2}" +LICENSE="MIT" +SLOT="0" +KEYWORDS="~amd64" +IUSE="lto static-libs" + +# "${FILESDIR}/quickjs-2020.11.08_Remove-TTY-check-in-test.patch" +PATCHES=( + "${FILESDIR}/quickjs-2024-01-13-sharedlib.patch" + "${FILESDIR}/quickjs-2025-09-13-respect-flags.patch" + "${FILESDIR}/quickjs-2025-09-13-quickjs-pc.patch" +) + +src_prepare() { + # Changed in master + sed -i '/^CONFIG_LTO=/s;^;#;' Makefile || die + + default + + sed -i '/$(STRIP) .*/d' Makefile || die "Failed removing STRIP call" + + sed -Ei '/^\s*(CC|AR)=/d' Makefile \ + || die "Failed to remove hard-coded tools." + + sed -i 's;$(PREFIX)/lib;$(LIBDIR);' Makefile || die "Failed fixing libdir" + + if ! use static-libs; then + sed -i '/install -m644 libquickjs.a "$(DESTDIR)$(LIBDIR)\/quickjs"/d' Makefile || die "Failed fixing static-libs" + fi +} + +src_configure() { + export CC="$(tc-getCC)" + export AR="$(tc-getAR)" + + export PREFIX=/usr + export LIBDIR="/usr/$(get_libdir)" + + export CONFIG_LTO=$(use lto) + if ! use static-libs; then + export CONFIG_SHARED=y + fi +}
