From owner-svn-ports-head@freebsd.org Fri Sep 11 08:04:16 2020 Return-Path: Delivered-To: svn-ports-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6109E3D18FA; Fri, 11 Sep 2020 08:04:16 +0000 (UTC) (envelope-from yuri@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnpDw1ypbz40hj; Fri, 11 Sep 2020 08:04:16 +0000 (UTC) (envelope-from yuri@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 26E21206FC; Fri, 11 Sep 2020 08:04:16 +0000 (UTC) (envelope-from yuri@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08B84Gv0065305; Fri, 11 Sep 2020 08:04:16 GMT (envelope-from yuri@FreeBSD.org) Received: (from yuri@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08B84Ecs065299; Fri, 11 Sep 2020 08:04:14 GMT (envelope-from yuri@FreeBSD.org) Message-Id: <202009110804.08B84Ecs065299@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yuri set sender to yuri@FreeBSD.org using -f From: Yuri Victorovich Date: Fri, 11 Sep 2020 08:04:14 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r548229 - in head/lang: . hermes hermes/files X-SVN-Group: ports-head X-SVN-Commit-Author: yuri X-SVN-Commit-Paths: in head/lang: . hermes hermes/files X-SVN-Commit-Revision: 548229 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Sep 2020 08:04:16 -0000 Author: yuri Date: Fri Sep 11 08:04:14 2020 New Revision: 548229 URL: https://svnweb.freebsd.org/changeset/ports/548229 Log: New port: lang/hermes: JavaScript engine Added: head/lang/hermes/ head/lang/hermes/Makefile (contents, props changed) head/lang/hermes/distinfo (contents, props changed) head/lang/hermes/files/ head/lang/hermes/files/patch-lib_Support_OSCompatPosix.cpp (contents, props changed) head/lang/hermes/files/patch-lib_VM_Instrumentation_ProcessStats.cpp (contents, props changed) head/lang/hermes/pkg-descr (contents, props changed) head/lang/hermes/pkg-plist (contents, props changed) Modified: head/lang/Makefile Modified: head/lang/Makefile ============================================================================== --- head/lang/Makefile Fri Sep 11 04:47:01 2020 (r548228) +++ head/lang/Makefile Fri Sep 11 08:04:14 2020 (r548229) @@ -126,6 +126,7 @@ SUBDIR += halide SUBDIR += harbour SUBDIR += haskell-mode.el + SUBDIR += hermes SUBDIR += hla SUBDIR += hs-brainfuck SUBDIR += hs-unlambda Added: head/lang/hermes/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lang/hermes/Makefile Fri Sep 11 08:04:14 2020 (r548229) @@ -0,0 +1,39 @@ +# $FreeBSD$ + +PORTNAME= hermes +DISTVERSIONPREFIX= v +DISTVERSION= 0.5.2-rc1 +CATEGORIES= lang +PKGNAMESUFFIX= -javascript-engine + +MAINTAINER= yuri@FreeBSD.org +COMMENT= JavaScript engine + +LICENSE= MIT +LICENSE_FILE= ${WRKSRC}/LICENSE + +LIB_DEPENDS= libicui18n.so:devel/icu +TEST_DEPENDS= zip:archivers/zip + +USES= cmake compiler:c++11-lang python:test +USE_GITHUB= yes +GH_ACCOUNT= facebook +USE_LDCONFIG= yes + +CMAKE_OFF= HERMES_ENABLE_TEST_SUITE + +BINARY_ALIAS= python=${PYTHON_CMD} python3=${PYTHON_CMD} + +.include + +.if ${OPSYS} == FreeBSD && ${OSVERSION} < 1201518 +BROKEN= missing pthread_getname_np +.endif + +do-test: # some tests are known to fail: https://github.com/facebook/hermes/issues/347 + @cd ${BUILD_WRKSRC} && \ + ${SETENV} ${CONFIGURE_ENV} ${CMAKE_BIN} ${CMAKE_ARGS} -DHERMES_ENABLE_TEST_SUITE:BOOL=ON ${CMAKE_SOURCE_PATH} && \ + ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_ARGS} ${ALL_TARGET} && \ + ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_ARGS} check-hermes + +.include Added: head/lang/hermes/distinfo ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lang/hermes/distinfo Fri Sep 11 08:04:14 2020 (r548229) @@ -0,0 +1,3 @@ +TIMESTAMP = 1599791135 +SHA256 (facebook-hermes-v0.5.2-rc1_GH0.tar.gz) = d384bcac5985f11b92ff03a14b1ea393c5b4f804d0236e7884e408b626495aed +SIZE (facebook-hermes-v0.5.2-rc1_GH0.tar.gz) = 6912229 Added: head/lang/hermes/files/patch-lib_Support_OSCompatPosix.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lang/hermes/files/patch-lib_Support_OSCompatPosix.cpp Fri Sep 11 08:04:14 2020 (r548229) @@ -0,0 +1,54 @@ +--- lib/Support/OSCompatPosix.cpp.orig 2020-08-03 19:19:06 UTC ++++ lib/Support/OSCompatPosix.cpp +@@ -23,6 +23,11 @@ + #endif + #endif // __linux__ + ++#if defined(__FreeBSD__) ++#include ++#include ++#endif ++ + #include + #include + +@@ -213,7 +218,7 @@ void vm_unused(void *p, size_t sz) { + /// the process's physical footprint. + #define MADV_UNUSED MADV_FREE + +-#elif defined(__linux__) ++#elif defined(__linux__) || defined(__FreeBSD__) + + /// On linux, telling the OS that we \p MADV_DONTNEED some pages will cause it + /// to immediately deduct their size from the process's resident set. +@@ -414,6 +419,12 @@ uint64_t thread_id() { + return syscall(__NR_gettid); + } + ++#elif defined(__FreeBSD__) ++ ++uint64_t thread_id() { ++ return reinterpret_cast(pthread_self()); ++} ++ + #else + #error "Thread ID not supported on this platform" + #endif +@@ -443,7 +454,7 @@ std::chrono::microseconds thread_cpu_time() { + return microseconds(total); + } + +-#elif defined(__linux__) // !(__APPLE__ && __MACH__) ++#elif defined(__linux__) || defined(__FreeBSD__) // !(__APPLE__ && __MACH__) + + std::chrono::microseconds thread_cpu_time() { + using namespace std::chrono; +@@ -480,7 +491,7 @@ bool thread_page_fault_count(int64_t *outMinorFaults, + return kr == KERN_SUCCESS; + } + +-#elif defined(__linux__) // !(__APPLE__ && __MACH__) ++#elif defined(__linux__) || defined(__FreeBSD__) // !(__APPLE__ && __MACH__) + + bool thread_page_fault_count(int64_t *outMinorFaults, int64_t *outMajorFaults) { + struct rusage stats = {}; Added: head/lang/hermes/files/patch-lib_VM_Instrumentation_ProcessStats.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lang/hermes/files/patch-lib_VM_Instrumentation_ProcessStats.cpp Fri Sep 11 08:04:14 2020 (r548229) @@ -0,0 +1,11 @@ +--- lib/VM/Instrumentation/ProcessStats.cpp.orig 2020-09-11 02:29:31 UTC ++++ lib/VM/Instrumentation/ProcessStats.cpp +@@ -69,6 +69,8 @@ ProcessStats::Info getProcessStatSnapshot() { + va *= PS / 1024; + #elif defined(__EMSCRIPTEN__) + rss = va = 0; ++#elif defined(__FreeBSD__) ++ rss = va = 0; // TODO implement getProcessStatSnapshot + #else + #error "Unsupported platform" + #endif Added: head/lang/hermes/pkg-descr ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lang/hermes/pkg-descr Fri Sep 11 08:04:14 2020 (r548229) @@ -0,0 +1,4 @@ +Hermes is a JavaScript engine optimized for fast start-up of React Native apps +on Android. It features ahead-of-time static optimization and compact bytecode. + +WWW: https://github.com/facebook/hermes Added: head/lang/hermes/pkg-plist ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lang/hermes/pkg-plist Fri Sep 11 08:04:14 2020 (r548229) @@ -0,0 +1,29 @@ +bin/hbcdump +bin/hdb +bin/hermes +bin/hermesc +bin/hvm +include/hermes/CompileJS.h +include/hermes/DebuggerAPI.h +include/hermes/Public/Buffer.h +include/hermes/Public/CrashManager.h +include/hermes/Public/CtorConfig.h +include/hermes/Public/DebuggerTypes.h +include/hermes/Public/GCConfig.h +include/hermes/Public/GCTripwireContext.h +include/hermes/Public/MemoryEventTracker.h +include/hermes/Public/RuntimeConfig.h +include/hermes/SynthTrace.h +include/hermes/SynthTraceParser.h +include/hermes/TraceInterpreter.h +include/hermes/TracingRuntime.h +include/hermes/hermes.h +include/hermes/hermes_tracing.h +include/jsi/JSIDynamic.h +include/jsi/decorator.h +include/jsi/instrumentation.h +include/jsi/jsi-inl.h +include/jsi/jsi.h +include/jsi/jsilib.h +include/jsi/threadsafe.h +lib/libhermes.so