mirror of
https://github.com/gentoo-mirror/guru.git
synced 2026-07-10 07:33:19 -04:00
Closes: https://bugs.gentoo.org/961753 Signed-off-by: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
52 lines
1.2 KiB
Bash
52 lines
1.2 KiB
Bash
# Copyright 2021-2026 Gentoo Authors
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
|
|
EAPI=9
|
|
|
|
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"
|
|
|
|
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() {
|
|
default
|
|
|
|
sed -i '/$(STRIP) .*/d' Makefile || die "Failed removing STRIP call"
|
|
|
|
sed -Ei '/^\s*(CC|AR)=/d' Makefile \
|
|
|| die "Failed removing hard-coded tools"
|
|
|
|
sed -i 's;$(PREFIX)/lib;$(LIBDIR);g' 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
|
|
}
|