git: 95d5bef07d00 - main - www/deno: Fix build on aarch64

From: Mikael Urankar <mikael_at_FreeBSD.org>
Date: Fri, 03 Jun 2022 13:56:04 UTC
The branch main has been updated by mikael:

URL: https://cgit.FreeBSD.org/ports/commit/?id=95d5bef07d00345908a610defeda46cbfd7a4c25

commit 95d5bef07d00345908a610defeda46cbfd7a4c25
Author:     Mikael Urankar <mikael@FreeBSD.org>
AuthorDate: 2022-06-03 13:40:26 +0000
Commit:     Mikael Urankar <mikael@FreeBSD.org>
CommitDate: 2022-06-03 13:56:02 +0000

    www/deno: Fix build on aarch64
    
      - Remove file-compilation-dir as it causes build failure on aarch64
    
    While here:
      - drop binutils dependency, we can use llvm-ar instead
      - bump python version to 3.7
---
 www/deno/Makefile                                             |  7 +++----
 .../patch-cargo-crates_v8_build_config_compiler_BUILD.gn      | 11 +++++++----
 .../patch-cargo-crates_v8_build_toolchain_gcc__toolchain.gni  |  2 +-
 3 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/www/deno/Makefile b/www/deno/Makefile
index d7147985c3e8..eb9182d5f892 100644
--- a/www/deno/Makefile
+++ b/www/deno/Makefile
@@ -1,6 +1,7 @@
 PORTNAME=	deno
 DISTVERSIONPREFIX=	v
 DISTVERSION=	1.22.1
+PORTREVIONS=	1
 CATEGORIES=	www
 
 MAINTAINER=	mikael@FreeBSD.org
@@ -11,11 +12,10 @@ LICENSE_FILE=	${WRKSRC}/LICENSE.md
 
 BROKEN_i386=	cargo:warning=c/freebsd.c:31:10: error: conflicting types for 'get_cpu_speed'
 
-BUILD_DEPENDS=	binutils>0:devel/binutils \
-		gn:devel/gn \
+BUILD_DEPENDS=	gn:devel/gn \
 		libunwind>0:devel/libunwind
 
-USES=		cargo cpe gmake gnome ninja:build pkgconfig:build python:3.6+,build
+USES=		cargo cpe gmake gnome ninja:build pkgconfig:build python:3.7+,build
 
 USE_GITHUB=	yes
 GH_ACCOUNT=	denoland
@@ -531,7 +531,6 @@ CARGO_ENV+=	RUSTC_BOOTSTRAP=1
 
 post-patch:
 	${REINPLACE_CMD} "s|%%LOCALBASE%%|${LOCALBASE}|" \
-		${WRKSRC}/cargo-crates/v8-${V8_VERS}/build/toolchain/gcc_toolchain.gni \
 		${WRKSRC}/cargo-crates/v8-${V8_VERS}/buildtools/third_party/libc++/BUILD.gn
 
 do-install:
diff --git a/www/deno/files/patch-cargo-crates_v8_build_config_compiler_BUILD.gn b/www/deno/files/patch-cargo-crates_v8_build_config_compiler_BUILD.gn
index 63790742d0cf..b5b40dfe4d36 100644
--- a/www/deno/files/patch-cargo-crates_v8_build_config_compiler_BUILD.gn
+++ b/www/deno/files/patch-cargo-crates_v8_build_config_compiler_BUILD.gn
@@ -1,5 +1,5 @@
---- cargo-crates/v8-0.43.1/build/config/compiler/BUILD.gn.orig	2021-02-25 20:45:34 UTC
-+++ cargo-crates/v8-0.43.1/build/config/compiler/BUILD.gn
+--- cargo-crates/v8-0.43.1/build/config/compiler/BUILD.gn.orig	1973-11-29 22:33:09.000000000 +0100
++++ cargo-crates/v8-0.43.1/build/config/compiler/BUILD.gn	2022-05-31 15:40:38.996239000 +0200
 @@ -137,7 +137,7 @@ declare_args() {
    #
    # TODO(crbug.com/1131993): Enabling this when 'is_android' is true breaks
@@ -45,9 +45,12 @@
          cflags += [ "--target=aarch64-linux-gnu" ]
          ldflags += [ "--target=aarch64-linux-gnu" ]
        }
-@@ -1265,7 +1265,7 @@ config("compiler_deterministic") {
+@@ -1263,9 +1263,9 @@ config("compiler_deterministic") {
+     } else {
+       # -ffile-compilation-dir is an alias for both -fdebug-compilation-dir=
        # and -fcoverage-compilation-dir=.
-       cflags += [ "-ffile-compilation-dir=." ]
+-      cflags += [ "-ffile-compilation-dir=." ]
++#      cflags += [ "-ffile-compilation-dir=." ]
      }
 -    if (!is_win) {
 +    if (!is_win && !is_bsd) {
diff --git a/www/deno/files/patch-cargo-crates_v8_build_toolchain_gcc__toolchain.gni b/www/deno/files/patch-cargo-crates_v8_build_toolchain_gcc__toolchain.gni
index a5841a6cbae7..540ba445509e 100644
--- a/www/deno/files/patch-cargo-crates_v8_build_toolchain_gcc__toolchain.gni
+++ b/www/deno/files/patch-cargo-crates_v8_build_toolchain_gcc__toolchain.gni
@@ -29,7 +29,7 @@
 +      cxx = "c++"
 +      ld = cxx
 +      readelf = "readelf"
-+      ar = "${prefix}/ar"
++      ar = "llvm-ar"
 +      nm = "${prefix}nm"
 +    } else {
 +      prefix = rebase_path("$clang_base_path/bin", root_build_dir)