FreeBSD Bugzilla – Attachment 246209 Details for
Bug 274948
[NEW PORT] emulators/wasmtime, devel/libwasmtime: add wasmtime CLI support
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
move wasmtime cli into emulators
patch-devel_wasmtime.diff (text/plain), 3.59 KB, created by
Eric Camachat
on 2023-11-09 03:26:11 UTC
(
hide
)
Description:
move wasmtime cli into emulators
Filename:
MIME Type:
Creator:
Eric Camachat
Created:
2023-11-09 03:26:11 UTC
Size:
3.59 KB
patch
obsolete
>diff --git devel/libwasmtime/Makefile devel/libwasmtime/Makefile >index 068693594e..bc015801a7 100644 >--- devel/libwasmtime/Makefile >+++ devel/libwasmtime/Makefile >@@ -1,7 +1,8 @@ >-PORTNAME= lib${GH_PROJECT} >+PORTNAME= ${GH_PROJECT} > PORTVERSION= 14.0.4 > DISTVERSIONPREFIX= v >-CATEGORIES= devel >+PKGNAMEPREFIX?= lib >+CATEGORIES?= devel > > MAINTAINER= osa@FreeBSD.org > COMMENT= Library for fast and secure runtime for WebAssembly >@@ -22,7 +23,8 @@ USE_GITHUB= yes > GH_ACCOUNT= bytecodealliance > GH_PROJECT= wasmtime > >-CARGO_CARGOTOML= ${WRKSRC}/crates/c-api/Cargo.toml >+WASMTIME_SLAVE?= no >+CARGO_CARGOTOML?= ${WRKSRC}/crates/c-api/Cargo.toml > > CARGO_CRATES= addr2line-0.21.0 \ > adler-1.0.2 \ >@@ -354,7 +356,7 @@ GH_TUPLE= WebAssembly:wasm-c-api:c9d3128:wasm_c_api/crates/c-api/wasm-c-api \ > WebAssembly:wasi-testsuite:09517e5:wasi_testsuite/tests/wasi_testsuite/wasi-common \ > WebAssembly:wasi-threads:e1893c0:wasi_threads/tests/wasi_testsuite/wasi-threads > >-PLIST_FILES= include/doc-wasm.h \ >+PLIST_FILES?= include/doc-wasm.h \ > include/wasi.h \ > include/wasm.h \ > include/wasmtime.h \ >@@ -376,11 +378,13 @@ PLIST_FILES= include/doc-wasm.h \ > lib/libwasmtime.a \ > lib/libwasmtime.so > >+.if ${WASMTIME_SLAVE} == no > do-install: > ${MKDIR} ${STAGEDIR}${PREFIX}/include/wasmtime > ${INSTALL_DATA} ${WRKSRC}/crates/c-api/wasm-c-api/include/wasm.h ${STAGEDIR}${PREFIX}/include > (cd ${WRKSRC}/crates/c-api/include && ${COPYTREE_SHARE} . ${STAGEDIR}${PREFIX}/include) > ${INSTALL_LIB} ${WRKDIR}/target/*-unknown-freebsd/release/libwasmtime.a ${STAGEDIR}${PREFIX}/lib > ${INSTALL_LIB} ${WRKDIR}/target/*-unknown-freebsd/release/libwasmtime.so ${STAGEDIR}${PREFIX}/lib >+.endif > > .include <bsd.port.mk> >diff --git emulators/Makefile emulators/Makefile >index 5854d0feb7..d3924dae75 100644 >--- emulators/Makefile >+++ emulators/Makefile >@@ -166,6 +166,7 @@ > SUBDIR += vmw > SUBDIR += vt100 > SUBDIR += vxtools >+ SUBDIR += wasmtime > SUBDIR += wine > SUBDIR += wine-devel > SUBDIR += wine-gecko >diff --git emulators/wasmtime/Makefile emulators/wasmtime/Makefile >new file mode 100644 >index 0000000000..02106125a2 >--- /dev/null >+++ emulators/wasmtime/Makefile >@@ -0,0 +1,13 @@ >+MASTERDIR= ${.CURDIR:H:H}/devel/libwasmtime >+CATEGORIES= emulators >+ >+PKGNAMEPREFIX= >+WASMTIME_SLAVE= cli >+CARGO_CARGOTOML= ${WRKSRC}/Cargo.toml >+PLIST_FILES= bin/wasmtime >+ >+FILESDIR= ${.CURDIR}/files >+SUB_LIST= NAME=wasmtime >+USE_RC_SUBR= wasmtime >+ >+.include "${MASTERDIR}/Makefile" >diff --git emulators/wasmtime/files/wasmtime.in emulators/wasmtime/files/wasmtime.in >new file mode 100644 >index 0000000000..db94982751 >--- /dev/null >+++ emulators/wasmtime/files/wasmtime.in >@@ -0,0 +1,49 @@ >+#!/bin/sh >+ >+# PROVIDE: %%NAME%% >+# REQUIRE: LOGIN >+# KEYWORD: shutdown >+ >+# Add the following lines to /etc/rc.conf to enable `%%NAME%%': >+# >+# %%NAME%%_enable="YES" >+# >+ >+. /etc/rc.subr >+ >+name=%%NAME%% >+rcvar=%%NAME%%_enable >+ >+# read configuration and set defaults >+load_rc_config "$name" >+ >+: ${%%NAME%%_enable:="NO"} >+ >+BINMISCCTL=/usr/sbin/binmiscctl >+WASMTIME=%%PREFIX%%/bin/wasmtime >+ >+start_cmd=%%NAME%%_start >+stop_cmd=%%NAME%%_stop >+extra_commands=list >+list_cmd="${BINMISCCTL} list" >+ >+%%NAME%%_start() >+{ >+# # register wasm32-wasi interpreter styled 'wasm1' >+ interpreter=${WASMTIME} >+ if [ -x "${interpreter}" ]; then >+ ${BINMISCCTL} add wasm1 --interpreter "${interpreter}" \ >+ --magic "\x00\x61\x73\x6d\x01\x00\x00\x00" \ >+ --mask "\xff\xff\xff\xff\xff\xff\xff\xff" \ >+ --size 8 --set-enabled >+ else >+ echo "$0: interpreter ${interpreter} not found, cannot register." >+ fi >+} >+ >+%%NAME%%_stop() >+{ >+ ${BINMISCCTL} remove wasm1 >+} >+ >+run_rc_command "$1"
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
eric
:
maintainer-approval?
Actions:
View
|
Diff
Attachments on
bug 274948
:
246171
| 246209