pkgsrc-WIP-changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
wip/hawk-scheme: import hawk-0.9 as wip/hawk-scheme
Module Name: pkgsrc-wip
Committed By: Yorick Hardy <yorickhardy%gmail.com@localhost>
Pushed By: yhardy
Date: Fri Jul 24 20:57:39 2026 +0000
Changeset: e615c08a189d84ad182c9dec2eb09ffaedbfbf3f
Modified Files:
Makefile
Added Files:
hawk-scheme/DESCR
hawk-scheme/Makefile
hawk-scheme/PLIST
hawk-scheme/distinfo
hawk-scheme/patches/patch-CMakeLists.txt
hawk-scheme/patches/patch-jitdump.c
hawk-scheme/patches/patch-runtime.c
Log Message:
wip/hawk-scheme: import hawk-0.9 as wip/hawk-scheme
Hawk is a tracing JIT compiler for Scheme. It includes a bytecode
compiler, runtime, garbage collector, interpreter, trace recorder, and native
code emitters for x86-64 and aarch64.
To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=e615c08a189d84ad182c9dec2eb09ffaedbfbf3f
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
diffstat:
Makefile | 1 +
hawk-scheme/DESCR | 3 ++
hawk-scheme/Makefile | 32 ++++++++++++++++++++
hawk-scheme/PLIST | 6 ++++
hawk-scheme/distinfo | 8 +++++
hawk-scheme/patches/patch-CMakeLists.txt | 50 ++++++++++++++++++++++++++++++++
hawk-scheme/patches/patch-jitdump.c | 14 +++++++++
hawk-scheme/patches/patch-runtime.c | 17 +++++++++++
8 files changed, 131 insertions(+)
diffs:
diff --git a/Makefile b/Makefile
index 254ec666d0..a7cdad8e34 100644
--- a/Makefile
+++ b/Makefile
@@ -1541,6 +1541,7 @@ SUBDIR+= haserl
SUBDIR+= hashcat-utils
SUBDIR+= haskell-mode
SUBDIR+= hawk
+SUBDIR+= hawk-scheme
SUBDIR+= hawknl
SUBDIR+= haxe
SUBDIR+= haxima
diff --git a/hawk-scheme/DESCR b/hawk-scheme/DESCR
new file mode 100644
index 0000000000..8599e6a9fe
--- /dev/null
+++ b/hawk-scheme/DESCR
@@ -0,0 +1,3 @@
+Hawk is a tracing JIT compiler for Scheme. It includes a bytecode
+compiler, runtime, garbage collector, interpreter, trace recorder, and native
+code emitters for x86-64 and aarch64.
diff --git a/hawk-scheme/Makefile b/hawk-scheme/Makefile
new file mode 100644
index 0000000000..46eaaf5ff8
--- /dev/null
+++ b/hawk-scheme/Makefile
@@ -0,0 +1,32 @@
+# $NetBSD$
+
+DISTNAME= hawk-v0.9
+PKGNAME= ${DISTNAME:S,-v,-scheme-,}
+CATEGORIES= lang
+MASTER_SITES= ${MASTER_SITE_GITHUB:=djwatson/}
+GITHUB_PROJECT= hawk
+GITHUB_RELEASE= v0.9
+
+MAINTAINER= pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE= https://djwatson.github.io/hawk/
+COMMENT= Scheme jit that makes code fly!
+# not use about this, some third party files are "do as you please"
+# and some third party files have no explicit copyright
+LICENSE= mit AND modified-bsd
+
+# needs [[musttail]]
+#GCC_REQD= 15
+PKGSRC_COMPILER= clang
+
+USE_LANGUAGES+= c c++
+CMAKE_CONFIGURE_ARGS+= -DBOOTSTRAP=ON
+
+NOT_PAX_MPROTECT_SAFE+= bin/hawk
+
+.include "../../archivers/zstd/buildlink3.mk"
+.include "../../devel/capstone/buildlink3.mk"
+.include "../../devel/cmake/build.mk"
+BUILDLINK_DEPMETHOD.Gauche= build
+.include "../../lang/gauche/buildlink3.mk"
+.include "../../lang/clang/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/hawk-scheme/PLIST b/hawk-scheme/PLIST
new file mode 100644
index 0000000000..97ca13f4a3
--- /dev/null
+++ b/hawk-scheme/PLIST
@@ -0,0 +1,6 @@
+@comment $NetBSD$
+bin/hawk
+lib/libhawk_core.so
+man/man1/hawk.1
+share/hawk/srfi/1.sld
+share/hawk/srfi/69.sld
diff --git a/hawk-scheme/distinfo b/hawk-scheme/distinfo
new file mode 100644
index 0000000000..917ca01fc0
--- /dev/null
+++ b/hawk-scheme/distinfo
@@ -0,0 +1,8 @@
+$NetBSD$
+
+BLAKE2s (hawk-v0.9.tar.gz) = f4343e27f91cf99d63c7965e0280657c1f55d7a3c92319daaa08293660f2aa7b
+SHA512 (hawk-v0.9.tar.gz) = 5dae5ea680ceef361c0ba9afd07489d390fc06b9717450765aa9c31caf68540e9f58edfc0ea954426750494086f9ef630a46893e5bf6a68ee7ce7d7eb219cc29
+Size (hawk-v0.9.tar.gz) = 2789298 bytes
+SHA1 (patch-CMakeLists.txt) = ab59222e3ff2b9cffa2aabea122d05c25384f180
+SHA1 (patch-jitdump.c) = acac908df4817cba5acc51801aa2f0e8f4f81d7b
+SHA1 (patch-runtime.c) = fcfe2470936847406db3a4fd3e44ed549e4d3476
diff --git a/hawk-scheme/patches/patch-CMakeLists.txt b/hawk-scheme/patches/patch-CMakeLists.txt
new file mode 100644
index 0000000000..75ceb08c60
--- /dev/null
+++ b/hawk-scheme/patches/patch-CMakeLists.txt
@@ -0,0 +1,50 @@
+$NetBSD$
+
+Link the hawk_core object statically instead of dynamically for the
+bootstrap phase. This works around incorrect library paths for the
+bootstrap phase.
+
+The bootstrap JIT needs "paxctl +m", so run the command if paxctl
+is found.
+
+--- CMakeLists.txt.orig 2026-07-24 19:38:51.163002743 +0000
++++ CMakeLists.txt
+@@ -157,8 +157,17 @@ if(BOOTSTRAP)
+ add_library(hawk_image_bootstrap OBJECT hawk_image.c)
+ target_compile_definitions(hawk_image_bootstrap PRIVATE BOOTSTRAP=1)
+
+- add_executable(hawk_bootstrap $<TARGET_OBJECTS:hawk_image_bootstrap>)
+- add_dependencies(hawk_bootstrap hawk_core)
++ add_executable(hawk_bootstrap $<TARGET_OBJECTS:hawk_image_bootstrap> $<TARGET_OBJECTS:hawk_core>)
++ target_link_libraries(hawk_bootstrap PRIVATE m)
++ if(HAVE_ZSTD)
++ target_link_libraries(hawk_bootstrap PRIVATE ${ZSTD_LIBRARY})
++ endif()
++ if(HAVE_CAPSTONE)
++ target_link_libraries(hawk_bootstrap PRIVATE ${CAPSTONE_LIBRARY})
++ endif()
++ if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
++ target_link_libraries(hawk_bootstrap PRIVATE ${CMAKE_DL_LIBS})
++ endif()
+ endif()
+ # fold generator
+ set(gen_fold_target gen_fold)
+@@ -250,8 +259,17 @@ if(BOOTSTRAP)
+ target_link_libraries(hawk PRIVATE hawk_core)
+ target_link_options(hawk PRIVATE ${HAWK_EXE_EXPORT_FLAG})
+ if(BOOTSTRAP)
+- target_link_libraries(hawk_bootstrap PRIVATE hawk_core)
++# target_link_libraries(hawk_bootstrap PRIVATE hawk_core)
+ target_link_options(hawk_bootstrap PRIVATE ${HAWK_EXE_EXPORT_FLAG})
++ find_program(PAXCTL paxctl)
++ if(PAXCTL)
++ add_custom_command(
++ TARGET hawk_bootstrap
++ POST_BUILD
++ COMMAND ${PAXCTL} +m $<TARGET_FILE:hawk_bootstrap>
++ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
++ )
++ endif()
+ endif()
+
+ target_compile_definitions(
diff --git a/hawk-scheme/patches/patch-jitdump.c b/hawk-scheme/patches/patch-jitdump.c
new file mode 100644
index 0000000000..864b773785
--- /dev/null
+++ b/hawk-scheme/patches/patch-jitdump.c
@@ -0,0 +1,14 @@
+$NetBSD$
+
+Include <sys/stat.h> for S_IRUSR and S_IWUSR.
+
+--- jitdump.c.orig 2026-07-24 19:08:54.366963710 +0000
++++ jitdump.c
+@@ -12,6 +12,7 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <sys/mman.h>
++#include <sys/stat.h>
+ #if defined(__linux__)
+ #include <sys/syscall.h>
+ #endif
diff --git a/hawk-scheme/patches/patch-runtime.c b/hawk-scheme/patches/patch-runtime.c
new file mode 100644
index 0000000000..1476d8368d
--- /dev/null
+++ b/hawk-scheme/patches/patch-runtime.c
@@ -0,0 +1,17 @@
+$NetBSD$
+
+environ is not part of unistd.h on NetBSD (Is this a NetBSD bug?)
+
+--- runtime.c.orig 2026-07-24 05:01:51.872552840 +0000
++++ runtime.c
+@@ -1,6 +1,10 @@
+ #define _POSIX_C_SOURCE 200809L
+ #define _GNU_SOURCE
+
++#ifdef __NetBSD__
++extern char **environ;
++#endif
++
+ #include <assert.h>
+ #ifdef __APPLE__
+ #include <crt_externs.h>
Home |
Main Index |
Thread Index |
Old Index