commit:     4206a9a4475366013d9accc7262cb07d74958a41
Author:     NHOrus <jy6x2b32pie9 <AT> yahoo <DOT> com>
AuthorDate: Thu Feb 12 20:53:05 2026 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Mar 11 15:55:56 2026 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4206a9a4

app-emulation/nemu: add 3.4.0

Patched out workaround for old, broken glibc that breaks build
with llvm.

Signed-off-by: NHOrus <jy6x2b32pie9 <AT> yahoo.com>
Part-of: https://github.com/gentoo/gentoo/pull/45789
Signed-off-by: Sam James <sam <AT> gentoo.org>

 app-emulation/nemu/Manifest                        |  1 +
 .../nemu/files/nemu-3.4.0-remove-workaround.patch  | 31 ++++++++
 app-emulation/nemu/metadata.xml                    |  3 +
 app-emulation/nemu/nemu-3.4.0.ebuild               | 83 ++++++++++++++++++++++
 4 files changed, 118 insertions(+)

diff --git a/app-emulation/nemu/Manifest b/app-emulation/nemu/Manifest
index dfdd49519565..78c130597ad8 100644
--- a/app-emulation/nemu/Manifest
+++ b/app-emulation/nemu/Manifest
@@ -1,2 +1,3 @@
 DIST nemu-3.1.0.tar.gz 164222 BLAKE2B 
32600bcdcf2a4f963612a13d89375df2cb4a49a376aec694ada01a86f6c27d6c4198250834cc924bb20e7b60b11ff8643e3bbd30aa883b437cf7828ab00509f2
 SHA512 
b764e94133e4ab4f052fca77d3dbc64dbbd6a52349828e8ccfe9892f1a9bb290b6578cd8afec7bac84ac339daf9ae11520fce28e842bfa649178fe471014fad1
 DIST nemu-3.3.0.tar.gz 174431 BLAKE2B 
62f69bb4789d8b1ce369bca5f82f11e4fc41813ae2732d61f6ae1819bc8e3e052420e6f1a2582c5460dfccd9dd3b98c350968c5a732aad654493f7b03bcacec2
 SHA512 
3b497d3edccb41ca9b34d6c51079caadc893effd2c026d9b199538574fad173d1c3fe5e5db36b60f07debc774473082b338553e269d1d462203470dee292e107
+DIST nemu-3.4.0.tar.gz 177146 BLAKE2B 
ac72c9d17b8085d83404e01f532fd2346f35b428f988b5aa1defe669f06be57edd733353996e5e1470c9c99e0d5564d09c5fa9d0df6d9c2d07b4daceb7e0bdb4
 SHA512 
a76092fa0aeca6a08830658588993f0b8c46f04afaf0b400741df79b2c15eac92e857571d2da2139e646d787611f3b3a2588fa701f943fe7a845e63fe17853bb

diff --git a/app-emulation/nemu/files/nemu-3.4.0-remove-workaround.patch 
b/app-emulation/nemu/files/nemu-3.4.0-remove-workaround.patch
new file mode 100644
index 000000000000..6356b3e5b16b
--- /dev/null
+++ b/app-emulation/nemu/files/nemu-3.4.0-remove-workaround.patch
@@ -0,0 +1,31 @@
+This workaroud turns on when compiled with LLVM and breaks compilation
+--- a/src/nm_network.c
++++ b/src/nm_network.c
+@@ -6,27 +6,8 @@
+ 
+ #if defined(NM_OS_LINUX)
+ 
+-#ifdef NM_NET_IF_FIX
+-/* Temporary work-around for broken glibc vs. linux kernel header definitions
+- * This is already fixed upstream, remove this when distributions have 
updated.
+- * net/if.h fuckup should be removed someday in future, when kernels <= 4.2
+- * will not be supported
+- * https://github.com/systemd/systemd/commit/ \
+- *   08ce521fb2546921f2642bef067d2cc02158b121
+- * https://github.com/systemd/systemd/commit/ \
+- *   6f270e6bd8b78aedf9f77534d6d11141ea0bf8ca
+- */
+-#define _NET_IF_H 1
+-#include <net/if.h>
+-#ifndef IFNAMSIZ
+-#define IFNAMSIZ 16
+-extern unsigned int if_nametoindex(const char *__ifname) __THROW;
+-#endif
+-#include <linux/if.h>
+-#else
+ #include <net/if.h>
+ #include <linux/if.h>
+-#endif
+ 
+ #include <time.h>
+ #include <sys/socket.h>

diff --git a/app-emulation/nemu/metadata.xml b/app-emulation/nemu/metadata.xml
index afc94e945d4a..73228881eca9 100644
--- a/app-emulation/nemu/metadata.xml
+++ b/app-emulation/nemu/metadata.xml
@@ -14,4 +14,7 @@
                <flag name="network-map">Adds possibility of exporting network 
map to SVG</flag>
                <flag name="remote-api">Adds API for remote control</flag>
        </use>
+       <upstream>
+               <remote-id type="github">nemuTUI/nemu</remote-id>
+       </upstream>
 </pkgmetadata>

diff --git a/app-emulation/nemu/nemu-3.4.0.ebuild 
b/app-emulation/nemu/nemu-3.4.0.ebuild
new file mode 100644
index 000000000000..9bd2363bf29d
--- /dev/null
+++ b/app-emulation/nemu/nemu-3.4.0.ebuild
@@ -0,0 +1,83 @@
+# Copyright 2019-2026 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake linux-info flag-o-matic
+
+MY_PV="${PV/_rc/-RC}"
+
+DESCRIPTION="Ncurses interface for QEMU"
+HOMEPAGE="https://github.com/nemuTUI/nemu";
+SRC_URI="https://github.com/nemuTUI/${PN}/archive/v${MY_PV}.tar.gz -> 
${P}.tar.gz"
+S="${WORKDIR}/${PN}-${MY_PV}/"
+
+LICENSE="BSD-2"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="dbus network-map +ovf remote-api +usb"
+
+RDEPEND="
+       >=app-emulation/qemu-6.0.0-r3[vnc,virtfs,spice]
+       dev-db/sqlite:3=
+       dev-libs/json-c
+       sys-libs/ncurses:=[unicode(+)]
+       usb? (
+               virtual/libusb:1
+               virtual/libudev:=
+       )
+       dbus? ( sys-apps/dbus )
+       network-map? ( media-gfx/graphviz[svg] )
+       ovf? (
+               dev-libs/libxml2:2=
+               app-arch/libarchive:=
+       )
+       remote-api? ( dev-libs/openssl )
+"
+DEPEND="${RDEPEND}"
+BDEPEND="sys-devel/gettext"
+
+PATCHES=( "${FILESDIR}/${P}-remove-workaround.patch" )
+
+pkg_pretend() {
+       if use kernel_linux; then
+               if ! linux_config_exists; then
+                       eerror "Unable to check your kernel"
+               else
+                       CONFIG_CHECK="~VETH ~MACVTAP"
+                       ERROR_VETH="You will need the Virtual ethernet pair 
device driver compiled"
+                       ERROR_VETH+=" into your kernel or loaded as a module to 
use the"
+                       ERROR_VETH+=" local network settings feature."
+                       ERROR_MACVTAP="You will also need support for MAC-VLAN 
based tap driver."
+                       check_extra_config
+               fi
+       fi
+}
+
+src_configure() {
+       append-cflags -std=gnu17
+       # -DNM_WITH_QEMU: Do not embbed qemu.
+       local mycmakeargs=(
+               -DNM_WITH_DBUS=$(usex dbus)
+               -DNM_WITH_NETWORK_MAP=$(usex network-map)
+               -DNM_WITH_REMOTE=$(usex remote-api)
+               -DNM_WITH_OVF_SUPPORT=$(usex ovf)
+               -DNM_WITH_QEMU=off
+               -DNM_WITH_USB=$(usex usb)
+       )
+       cmake_src_configure
+}
+
+src_install() {
+       cmake_src_install
+       docompress -x /usr/share/man/man1/nemu.1.gz
+}
+
+pkg_postinst() {
+       elog "For non-root usage execute script:"
+       elog "/usr/share/nemu/scripts/setup_nemu_nonroot.sh linux <username>"
+       elog "and add udev rule:"
+       elog "cp /usr/share/nemu/scripts/42-net-macvtap-perm.rules 
/etc/udev/rules.d"
+       elog "Afterwards reboot or reload udev with"
+       elog "udevadm control --reload-rules && udevadm trigger"
+}

Reply via email to