From c7b0175dc8bef0857efbbdc451dddfeb3c22bb99 Mon Sep 17 00:00:00 2001 From: Sasha Finkelstein Date: Wed, 16 Oct 2024 12:12:35 +0200 Subject: [PATCH] app-emulation/muvm: Add 0.1.2-r1 Signed-off-by: Sasha Finkelstein --- ...muvm-0.1.2-do-not-clobber-fex-config.patch | 15 ++ app-emulation/muvm/muvm-0.1.2-r1.ebuild | 147 ++++++++++++++++++ 2 files changed, 162 insertions(+) create mode 100644 app-emulation/muvm/files/muvm-0.1.2-do-not-clobber-fex-config.patch create mode 100644 app-emulation/muvm/muvm-0.1.2-r1.ebuild diff --git a/app-emulation/muvm/files/muvm-0.1.2-do-not-clobber-fex-config.patch b/app-emulation/muvm/files/muvm-0.1.2-do-not-clobber-fex-config.patch new file mode 100644 index 00000000..af3d326a --- /dev/null +++ b/app-emulation/muvm/files/muvm-0.1.2-do-not-clobber-fex-config.patch @@ -0,0 +1,15 @@ +diff --git a/crates/muvm/src/guest/mount.rs b/crates/muvm/src/guest/mount.rs +index adeb327..b4ffb58 100644 +--- a/crates/muvm/src/guest/mount.rs ++++ b/crates/muvm/src/guest/mount.rs +@@ -74,6 +74,10 @@ fn mount_fex_rootfs() -> Result<()> { + } else if images.len() == 1 { + // Just expose the one mount + symlink(&images[0], &dir_rootfs)?; ++ } else if images.is_empty() { ++ // If no images were passed, FEX is either managed by the host os ++ // or is not installed at all. Avoid clobbering the config in that case. ++ return Ok(()) + } + + // Now we need to tell FEX about this. One of the FEX share directories has an unmounted rootfs diff --git a/app-emulation/muvm/muvm-0.1.2-r1.ebuild b/app-emulation/muvm/muvm-0.1.2-r1.ebuild new file mode 100644 index 00000000..66932127 --- /dev/null +++ b/app-emulation/muvm/muvm-0.1.2-r1.ebuild @@ -0,0 +1,147 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +CRATES=" + addr2line@0.22.0 + adler@1.0.2 + aho-corasick@1.1.3 + anstream@0.6.14 + anstyle-parse@0.2.4 + anstyle-query@1.0.3 + anstyle-wincon@3.0.3 + anstyle@1.0.7 + anyhow@1.0.83 + backtrace@0.3.72 + bindgen@0.69.4 + bitflags@2.5.0 + bpaf@0.9.12 + byteorder@1.5.0 + bytes@1.6.0 + cc@1.0.99 + cexpr@0.6.0 + cfg-if@1.0.0 + cfg_aliases@0.1.1 + clang-sys@1.7.0 + colorchoice@1.0.1 + either@1.11.0 + env_filter@0.1.0 + env_logger@0.11.3 + errno@0.3.8 + fastrand@2.1.0 + futures-core@0.3.30 + futures-sink@0.3.30 + getrandom@0.2.15 + gimli@0.29.0 + glob@0.3.1 + hermit-abi@0.3.9 + humantime@2.1.0 + is_terminal_polyfill@1.70.0 + itertools@0.12.1 + itoa@1.0.11 + lazy_static@1.4.0 + lazycell@1.3.0 + libc@0.2.154 + linux-raw-sys@0.4.13 + log@0.4.21 + memchr@2.7.2 + minimal-lexical@0.2.1 + miniz_oxide@0.7.3 + mio@0.8.11 + nix@0.28.0 + nom@7.1.3 + num_cpus@1.16.0 + object@0.35.0 + pin-project-lite@0.2.14 + proc-macro2@1.0.82 + quote@1.0.36 + regex-automata@0.4.6 + regex-syntax@0.8.3 + regex@1.10.4 + rustc-demangle@0.1.24 + rustc-hash@1.1.0 + rustix@0.38.34 + ryu@1.0.18 + serde@1.0.203 + serde_derive@1.0.203 + serde_json@1.0.117 + shlex@1.3.0 + signal-hook-registry@1.4.2 + socket2@0.5.7 + syn@2.0.61 + tempfile@3.10.1 + tokio-macros@2.3.0 + tokio-stream@0.1.15 + tokio-util@0.7.11 + tokio@1.38.0 + unicode-ident@1.0.12 + utf8parse@0.2.1 + uuid@1.10.0 + wasi@0.11.0+wasi-snapshot-preview1 + windows-sys@0.48.0 + windows-sys@0.52.0 + windows-targets@0.48.5 + windows-targets@0.52.5 + windows_aarch64_gnullvm@0.48.5 + windows_aarch64_gnullvm@0.52.5 + windows_aarch64_msvc@0.48.5 + windows_aarch64_msvc@0.52.5 + windows_i686_gnu@0.48.5 + windows_i686_gnu@0.52.5 + windows_i686_gnullvm@0.52.5 + windows_i686_msvc@0.48.5 + windows_i686_msvc@0.52.5 + windows_x86_64_gnu@0.48.5 + windows_x86_64_gnu@0.52.5 + windows_x86_64_gnullvm@0.48.5 + windows_x86_64_gnullvm@0.52.5 + windows_x86_64_msvc@0.48.5 + windows_x86_64_msvc@0.52.5 +" + +inherit cargo + +DESCRIPTION="Run programs from your system in a microVM" +HOMEPAGE="https://github.com/AsahiLinux/muvm" + +SRC_URI=" + ${CARGO_CRATE_URIS} + https://github.com/AsahiLinux/muvm/archive/refs/tags/${P}.tar.gz -> ${P}.tar.gz +" + +S="${WORKDIR}/muvm-${P}" + +LICENSE="0BSD Apache-2.0 Apache-2.0-with-LLVM-exceptions BSD Boost-1.0 MIT Unicode-DFS-2016 Unlicense ZLIB" +SLOT="0" +KEYWORDS="~arm64" + +PATCHES=" + ${FILESDIR}/${P}-do-not-clobber-fex-config.patch +" + +DEPEND=" + dev-libs/libkrun +" +RDEPEND=" + ${DEPEND} + net-misc/passt + net-misc/socat + gui-wm/sommelier + games-util/hidpipe + || ( + net-misc/dhcpcd + net-misc/dhcp[client] + ) +" + +src_compile() { + cargo_src_compile --workspace +} + +src_install() { + local bin + for bin in muvm{,-guest,-server}; do + dobin "$(cargo_target_dir)/$bin" + done +}