dev-lang/quickjs: from ::guru, add 2021.03.27

Signed-off-by: liuyujielol <2073201758GD@gmail.com>
This commit is contained in:
liuyujielol 2023-11-03 00:16:36 +08:00 committed by 梁永祥
parent bc8723e3e2
commit e01d88a054
5 changed files with 131 additions and 0 deletions

View File

@ -0,0 +1 @@
DIST quickjs-2021-03-27.tar.xz 753556 BLAKE2B a959da95ca4861b5675359ac81598b50a80170ec4f4d819c44d666dd4ecb5a2e11d63230f98b611d5109941f5b21f5c8f791d56d153b818408ec1c59350d5e1d SHA512 eeb810083484df213bc658a8703ca3ef094b7789c2b49eed86cb4068c9f9da401ad0300261d61a163c6ea82306f3ef50bf8e29a64920f704fd8958ef08a7286c

View File

@ -0,0 +1,25 @@
From aa3c213319f6df61f727a604798e8c120b7c37f4 Mon Sep 17 00:00:00 2001
From: tastytea <tastytea@tastytea.de>
Date: Fri, 30 Apr 2021 00:03:42 +0200
Subject: [PATCH] Remove TTY check in test.
---
tests/test_std.js | 2 --
1 file changed, 2 deletions(-)
diff --git a/tests/test_std.js b/tests/test_std.js
index 3ea6e34..a12cb81 100644
--- a/tests/test_std.js
+++ b/tests/test_std.js
@@ -143,8 +143,6 @@ function test_os()
{
var fd, fpath, fname, fdir, buf, buf2, i, files, err, fdate, st, link_path;
- assert(os.isatty(0));
-
fdir = "test_tmp_dir";
fname = "tmp_file.txt";
fpath = fdir + "/" + fname;
--
2.26.3

View File

@ -0,0 +1,47 @@
diff --git a/Makefile b/Makefile
index 8fc7e55..03cec93 100644
--- a/Makefile
+++ b/Makefile
@@ -28,7 +28,7 @@ endif
# Windows cross compilation from Linux
#CONFIG_WIN32=y
# use link time optimization (smaller and faster executables but slower build)
-CONFIG_LTO=y
+#CONFIG_LTO=y
# consider warnings as errors (for development)
#CONFIG_WERROR=y
# force 32 bit build for some utilities
@@ -65,7 +65,7 @@ else
endif
ifdef CONFIG_CLANG
HOST_CC=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
@@ -82,7 +82,7 @@ ifdef CONFIG_CLANG
endif
else
HOST_CC=gcc
- CFLAGS+=-g -Wall -MMD -MF $(OBJDIR)/$(@F).d
+ CFLAGS+=-Wall -MMD -MF $(OBJDIR)/$(@F).d
CFLAGS += -Wno-array-bounds -Wno-format-truncation
ifdef CONFIG_LTO
else
@@ -101,11 +101,11 @@ DEFINES+=-D__USE_MINGW_ANSI_STDIO # for standard snprintf behavior
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)
-LDFLAGS+=-g
+#LDFLAGS+=
ifdef CONFIG_LTO
CFLAGS_SMALL+=-flto
CFLAGS_OPT+=-flto

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<!--maintainer-needed-->
<use>
<flag name="lto">Enable Link Time Optimizations (improves performance and decreases size of executables)</flag>
</use>
</pkgmetadata>

View File

@ -0,0 +1,50 @@
# Copyright 2023 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"
LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64"
IUSE="lto"
S="${WORKDIR}/${MY_P}"
PATCHES=(
"${FILESDIR}/${PN}-2020.11.08_Remove-TTY-check-in-test.patch"
"${FILESDIR}/${PN}-2021-03-27-respect-env.patch"
)
src_prepare() {
sed -i \
-e 's;prefix=/usr/local;prefix=/usr;' \
-e '/$(STRIP) .*/d' \
Makefile || die "Failed setting prefix"
sed -Ei '/^\s*(CC|AR)=/d' Makefile \
|| die "Failed to remove hard-coded tools."
sed -Ei 's/(^\s*(C|LD)FLAGS)=/\1\+=/' Makefile \
|| die "Failed to change build flag assignment into addition."
export CC="$(tc-getCC)"
export AR="$(tc-getAR)"
default
}
src_compile() {
if use lto; then
CONFIG_LTO=$(use lto) emake
else
emake
fi
}