From nobody Tue Oct 24 00:35:08 2023 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SDtPS4RDPz4xCWt; Tue, 24 Oct 2023 00:35:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SDtPS3mQHz4LNj; Tue, 24 Oct 2023 00:35:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1698107708; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nNEcxzsnFWC4LmMxHCBNjZ6kxJxQ45CmlZYj0J6fgww=; b=PU+aopjB6nzxf0piA0EfaCTT4ozzu/redIDOmNdqTszPBE2A94MU/UskghRcbNHVFeI/0C JhhOWMhvkx5cCcm65Tq9+x5hEfNGuHq44I5DHmo3f5SuL+Urr1uaX3p0kRSkyY8n2UZ5Hk N1XcuPmNDQKi9z/afK8OwMXEoJGVcxeAopLwjXxtTssiLqjZHeULtT/iQEE24m67bkuECb s/akalx+7TfzgrMF+RY2BZY4t0qQiZTPrlXVyD5emc7wI8QSdgzpTWIQNfuXkL8GpZWDIf qGj5wAiQgJxqT35sUUUtz+eHEOg43eyIX3s19BhvcftEXZJUWbVxy/nqbo761w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1698107708; a=rsa-sha256; cv=none; b=KSQl0cOBRQCGviyboqowE9ldaGCL8K1nFWcSFl0D4b072BvJoE4D8ICX7rYctAwoWbp0hB lBvpnZ6aPkt2AazZBclb14jDhI3PIacieLYxCtfxphqveTJwu1BSA6ARdq6a8aOEUO43ex yLtNqVN4e9Hi8k2S2EPbjjnl5GQ/MjpppW7yPrTfumgQhT8cSS3vDowcmY95OAaQVbwufK AWHFyEh8aYbcEh9jv6qswyycVmRYXCOSkbDmLCOjTcOYcz7TPOE13BHLT+k1KkfRAfq4ts tJ2k9FKVXyCP+FYj4HqcIStQ3oNKz+iwMCqO4hqM54KN91kkI9PmWb2+OGo4Mw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1698107708; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nNEcxzsnFWC4LmMxHCBNjZ6kxJxQ45CmlZYj0J6fgww=; b=a345MGjlJhUwhd9iGh6Tr0QsCXKMs5Lh8WBgaqS1EVymol10eWK1lUFhJTbus0m8lxWFUX N7qEXXiI563+LIlouTgIEbARzHFuiwFVh09fqXavBqkEWlLIARqGZel0lUMud9F1VhCNWF 0uLHJ7lPD7gHaDblmpgKqBhrPf+hJcdRxNcWZBu4PDV4DXGz1OtmldGGBNlKRoe6Fd/Fag KMYJQHPE5TzxJ4igkPqS6PnIbD6cvbf5mlur4Fi4dSXlLLe4S3uw9oysVpCeR7X8vgcPQr sf4EmrlIxwSGQpnOn4dmb2rtguTtKK7sL417Os4/3PrJY1BHO4V9kNHVb/05Cg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SDtPS2pmHz124G; Tue, 24 Oct 2023 00:35:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 39O0Z8Ko087610; Tue, 24 Oct 2023 00:35:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 39O0Z8Jf087607; Tue, 24 Oct 2023 00:35:08 GMT (envelope-from git) Date: Tue, 24 Oct 2023 00:35:08 GMT Message-Id: <202310240035.39O0Z8Jf087607@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Yuri Victorovich Subject: git: f84718746122 - main - lang/quickjs: Build shared libraries List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: yuri X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f8471874612278840b3db3076f3982cf5e259cc3 Auto-Submitted: auto-generated The branch main has been updated by yuri: URL: https://cgit.FreeBSD.org/ports/commit/?id=f8471874612278840b3db3076f3982cf5e259cc3 commit f8471874612278840b3db3076f3982cf5e259cc3 Author: Yuri Victorovich AuthorDate: 2023-10-24 00:23:21 +0000 Commit: Yuri Victorovich CommitDate: 2023-10-24 00:34:53 +0000 lang/quickjs: Build shared libraries PR: 274681 Reported by: Robert Clausecker --- emulators/tic-80/Makefile | 5 +-- lang/quickjs/Makefile | 4 ++ lang/quickjs/files/patch-Makefile | 71 +++++++++++++++++++++++++++++++++++ lang/quickjs/files/patch-qjsc.c | 11 ++++++ lang/quickjs/pkg-plist | 2 +- www/edbrowse/Makefile | 4 +- www/edbrowse/files/patch-src_makefile | 2 +- 7 files changed, 92 insertions(+), 7 deletions(-) diff --git a/emulators/tic-80/Makefile b/emulators/tic-80/Makefile index 9bf65216ab11..a16e780407f1 100644 --- a/emulators/tic-80/Makefile +++ b/emulators/tic-80/Makefile @@ -1,6 +1,7 @@ PORTNAME= TIC-80 DISTVERSIONPREFIX= v DISTVERSION= 1.1.2736 +PORTREVISION= 1 CATEGORIES= emulators games MAINTAINER= fuz@FreeBSD.org @@ -10,9 +11,6 @@ WWW= https://tic80.com LICENSE= MIT LICENSE_FILE= ${WRKSRC}/LICENSE -# only available as a static library -# bump TIC-80 when quickjs is updated! -BUILD_DEPENDS= quickjs>0:lang/quickjs LIB_DEPENDS= libasound.so:audio/alsa-lib \ libcurl.so:ftp/curl \ libdbus-1.so:devel/dbus \ @@ -20,6 +18,7 @@ LIB_DEPENDS= libasound.so:audio/alsa-lib \ libinotify.so:devel/libinotify \ libjanet.so:lang/janet \ libpng16.so:graphics/png \ + libquickjs.so:lang/quickjs \ libsquirrel.so:lang/squirrel \ libunwind.so:devel/libunwind diff --git a/lang/quickjs/Makefile b/lang/quickjs/Makefile index 19a6a9630c59..1fbef10941d2 100644 --- a/lang/quickjs/Makefile +++ b/lang/quickjs/Makefile @@ -1,5 +1,6 @@ PORTNAME= quickjs DISTVERSION= 2021.03.27 +PORTREVISION= 1 CATEGORIES= lang devel MASTER_SITES= https://bellard.org/${PORTNAME}/ DISTNAME= ${PORTNAME}-${DISTVERSION:S/./-/g} @@ -25,4 +26,7 @@ post-patch: ${WRKSRC}/Makefile .endif +post-install: + ${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/libquickjs.so + .include diff --git a/lang/quickjs/files/patch-Makefile b/lang/quickjs/files/patch-Makefile new file mode 100644 index 000000000000..f7bd7b4b90a4 --- /dev/null +++ b/lang/quickjs/files/patch-Makefile @@ -0,0 +1,71 @@ +--- Makefile.orig 2023-10-23 23:26:12 UTC ++++ Makefile +@@ -76,6 +76,7 @@ ifdef CONFIG_CLANG + HOST_CC=clang + CC=$(CROSS_PREFIX)clang + CFLAGS=-g -Wall -MMD -MF $(OBJDIR)/$(@F).d ++ CFLAGS += -fPIC + CFLAGS += -Wextra + CFLAGS += -Wno-sign-compare + CFLAGS += -Wno-missing-field-initializers +@@ -156,9 +157,9 @@ endif + ifdef CONFIG_M32 + PROGS+=qjs32 qjs32_s + endif +-PROGS+=libquickjs.a ++PROGS+=libquickjs.so + ifdef CONFIG_LTO +-PROGS+=libquickjs.lto.a ++PROGS+=libquickjs.lto.so + endif + + # examples +@@ -235,12 +236,12 @@ else + LTOEXT= + endif + +-libquickjs$(LTOEXT).a: $(QJS_LIB_OBJS) +- $(AR) rcs $@ $^ ++libquickjs$(LTOEXT).so: $(QJS_LIB_OBJS) ++ $(CC) -shared $(LDFLAGS) -o $@ $^ + + ifdef CONFIG_LTO +-libquickjs.a: $(patsubst %.o, %.nolto.o, $(QJS_LIB_OBJS)) +- $(AR) rcs $@ $^ ++libquickjs.so: $(patsubst %.o, %.nolto.o, $(QJS_LIB_OBJS)) ++ $(CC) -shared $(LDFLAGS) -o $@ $^ + endif # CONFIG_LTO + + repl.c: $(QJSC) repl.js +@@ -311,10 +312,10 @@ install: all + $(STRIP) qjs qjsc + install -m755 qjs qjsc "$(DESTDIR)$(prefix)/bin" + ln -sf qjs "$(DESTDIR)$(prefix)/bin/qjscalc" +- mkdir -p "$(DESTDIR)$(prefix)/lib/quickjs" +- install -m644 libquickjs.a "$(DESTDIR)$(prefix)/lib/quickjs" ++ mkdir -p "$(DESTDIR)$(prefix)/lib" ++ install -m644 libquickjs.so "$(DESTDIR)$(prefix)/lib" + ifdef CONFIG_LTO +- install -m644 libquickjs.lto.a "$(DESTDIR)$(prefix)/lib/quickjs" ++ install -m644 libquickjs.lto.so "$(DESTDIR)$(prefix)/lib" + endif + mkdir -p "$(DESTDIR)$(prefix)/include/quickjs" + install -m644 quickjs.h quickjs-libc.h "$(DESTDIR)$(prefix)/include/quickjs" +@@ -347,7 +348,7 @@ HELLO_MODULE_SRCS=examples/hello_module.js + HELLO_MODULE_OPTS=-fno-string-normalize -fno-map -fno-promise -fno-typedarray \ + -fno-typedarray -fno-regexp -fno-json -fno-eval -fno-proxy \ + -fno-date -m +-examples/hello_module: $(QJSC) libquickjs$(LTOEXT).a $(HELLO_MODULE_SRCS) ++examples/hello_module: $(QJSC) libquickjs$(LTOEXT).so $(HELLO_MODULE_SRCS) + $(QJSC) $(HELLO_MODULE_OPTS) -o $@ $(HELLO_MODULE_SRCS) + + # use of an external C module (static compilation) +@@ -355,7 +356,7 @@ examples/hello_module: $(QJSC) libquickjs$(LTOEXT).a $ + test_fib.c: $(QJSC) examples/test_fib.js + $(QJSC) -e -M examples/fib.so,fib -m -o $@ examples/test_fib.js + +-examples/test_fib: $(OBJDIR)/test_fib.o $(OBJDIR)/examples/fib.o libquickjs$(LTOEXT).a ++examples/test_fib: $(OBJDIR)/test_fib.o $(OBJDIR)/examples/fib.o libquickjs$(LTOEXT).so + $(CC) $(LDFLAGS) -o $@ $^ $(LIBS) + + examples/fib.so: $(OBJDIR)/examples/fib.pic.o diff --git a/lang/quickjs/files/patch-qjsc.c b/lang/quickjs/files/patch-qjsc.c new file mode 100644 index 000000000000..292f0af889fd --- /dev/null +++ b/lang/quickjs/files/patch-qjsc.c @@ -0,0 +1,11 @@ +--- qjsc.c.orig 2023-10-23 23:25:39 UTC ++++ qjsc.c +@@ -446,7 +446,7 @@ static int output_executable(const char *out_filename, + if (dynamic_export) + *arg++ = "-rdynamic"; + *arg++ = cfilename; +- snprintf(libjsname, sizeof(libjsname), "%s/libquickjs%s%s.a", ++ snprintf(libjsname, sizeof(libjsname), "%s/libquickjs%s%s.so", + lib_dir, bn_suffix, lto_suffix); + *arg++ = libjsname; + *arg++ = "-lm"; diff --git a/lang/quickjs/pkg-plist b/lang/quickjs/pkg-plist index 1a1306ba137d..5a70bf083b2b 100644 --- a/lang/quickjs/pkg-plist +++ b/lang/quickjs/pkg-plist @@ -3,4 +3,4 @@ bin/qjsc bin/qjscalc include/quickjs/quickjs-libc.h include/quickjs/quickjs.h -lib/quickjs/libquickjs.a +lib/libquickjs.so diff --git a/www/edbrowse/Makefile b/www/edbrowse/Makefile index 78300980d355..c8274684bdb0 100644 --- a/www/edbrowse/Makefile +++ b/www/edbrowse/Makefile @@ -1,6 +1,7 @@ PORTNAME= edbrowse DISTVERSIONPREFIX= v DISTVERSION= 3.8.7 +PORTREVISION= 1 CATEGORIES= www editors MAINTAINER= alfix86@gmail.com @@ -10,9 +11,8 @@ WWW= https://edbrowse.org/ LICENSE= GPLv2 LICENSE_FILE= ${WRKSRC}/COPYING -BUILD_DEPENDS= ${LOCALBASE}/include/quickjs/quickjs.h:lang/quickjs \ - ${LOCALBASE}/lib/quickjs/libquickjs.a:lang/quickjs LIB_DEPENDS= libcurl.so:ftp/curl \ + libquickjs.so:lang/quickjs \ libodbc.so:databases/unixODBC \ libpcre2-8.so:devel/pcre2 diff --git a/www/edbrowse/files/patch-src_makefile b/www/edbrowse/files/patch-src_makefile index d891514900c6..1d08660a15dd 100644 --- a/www/edbrowse/files/patch-src_makefile +++ b/www/edbrowse/files/patch-src_makefile @@ -14,7 +14,7 @@ # LDFLAGS for quickjs loading. -QUICKJS_LDFLAGS = $(QUICKJS_DIR)/libquickjs.a -ldl -+QUICKJS_LDFLAGS = /usr/local/lib/quickjs/libquickjs.a -ldl ++QUICKJS_LDFLAGS = -lquickjs ifeq ($(shell uname),Linux) QUICKJS_LDFLAGS += -latomic endif