Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{
2 busybox,
3 cmake,
4 coreutils,
5 dbus,
6 fetchFromGitHub,
7 gettext,
8 graphviz,
9 json_c,
10 lib,
11 libarchive,
12 libusb1,
13 libxml2,
14 makeWrapper,
15 ncurses,
16 ninja,
17 openssl,
18 picocom,
19 pkg-config,
20 qemu,
21 socat,
22 sqlite,
23 stdenv,
24 systemd,
25 tigervnc,
26}:
27
28stdenv.mkDerivation (finalAttrs: {
29 pname = "nemu";
30 version = "3.3.1";
31
32 src = fetchFromGitHub {
33 owner = "nemuTUI";
34 repo = "nemu";
35 rev = "v${finalAttrs.version}";
36 hash = "sha256-6WzqBkspKKs1e8kg1i71ntZHa78s5pJ1u02mXvzpiEc=";
37 };
38
39 cmakeFlags = [
40 "-DNM_WITH_DBUS=ON"
41 "-DNM_WITH_NETWORK_MAP=ON"
42 "-DNM_WITH_REMOTE=ON"
43 "-DNM_WITH_USB=ON"
44 ];
45
46 nativeBuildInputs = [
47 cmake
48 ninja
49 pkg-config
50 makeWrapper
51 ];
52
53 buildInputs = [
54 coreutils
55 dbus
56 gettext
57 graphviz
58 json_c
59 libarchive
60 libusb1
61 libxml2
62 ncurses
63 openssl
64 picocom
65 qemu
66 socat
67 sqlite
68 systemd # for libudev
69 tigervnc
70 ];
71
72 runtimeDependencies = [
73 busybox
74 picocom
75 qemu
76 socat
77 tigervnc
78 ];
79
80 postPatch = ''
81 substituteInPlace nemu.cfg.sample \
82 --replace-fail /usr/bin/vncviewer ${tigervnc}/bin/vncviewer \
83 --replace-fail "qemu_bin_path = /usr/bin" "qemu_bin_path = ${qemu}/bin"
84
85 substituteInPlace sh/ntty \
86 --replace-fail /usr/bin/socat ${socat}/bin/socat \
87 --replace-fail /usr/bin/picocom ${picocom}/bin/picocom \
88 --replace-fail start-stop-daemon ${busybox}/bin/start-stop-daemon
89
90 substituteInPlace sh/setup_nemu_nonroot.sh \
91 --replace-fail /usr/bin/nemu $out/bin/nemu
92 '';
93
94 postInstall = ''
95 wrapProgram $out/share/nemu/scripts/upgrade_db.sh \
96 --prefix PATH : "${sqlite}/bin"
97 '';
98
99 meta = {
100 changelog = "https://github.com/nemuTUI/nemu/releases/tag/v${finalAttrs.version}";
101 description = "Ncurses UI for QEMU";
102 homepage = "https://github.com/nemuTUI/nemu";
103 license = lib.licenses.bsd2;
104 mainProgram = "nemu";
105 maintainers = with lib.maintainers; [ msanft ];
106 platforms = lib.platforms.unix;
107 };
108})