16 version = "3.9.0-rc.4";
18 src = fetchFromGitHub {
22 sha256 = "sha256-Qg+wET5H9t3Mv2Hv0iT/C85/SEaQ+BHSBL3JjMQW5+Q=";
26 # NOTE: fixes for hardcoded paths and assumptions about filesystem
28 ./nix-filesystem.patch
31 npmDepsHash = "sha256-e7m7xb7p1SBzLAyQ82TTR/qLXv4lRm37x0JJPWYYGvI=";
33 nativeBuildInputs = [ installShellFiles makeWrapper ];
35 # workaround for https://github.com/webpack/webpack/issues/14532
36 NODE_OPTIONS = "--openssl-legacy-provider";
44 ] ++ lib.optionals stdenv.hostPlatform.isLinux [ v4l-utils ];
45 crc32Patch = substituteAll {
46 src = ./fix-musl-detection.patch;
47 isMusl = if stdenv.hostPlatform.isMusl then "true" else "false";
51 sed 's/@DESCRIPTION@/${meta.description}/g' ${./mirakurun.1} > mirakurun.1
52 installManPage mirakurun.1
54 wrapProgram $out/bin/mirakurun-epgdump \
55 --prefix PATH : ${lib.makeBinPath runtimeDeps}
57 # XXX: The original mirakurun command uses PM2 to manage the Mirakurun
58 # server. However, we invoke the server directly and let systemd
59 # manage it to avoid complication. This is okay since no features
60 # unique to PM2 is currently being used.
61 makeWrapper ${nodejs}/bin/npm $out/bin/mirakurun \
62 --chdir "$out/lib/node_modules/mirakurun" \
63 --prefix PATH : ${lib.makeBinPath runtimeDeps}
65 pushd $out/lib/node_modules/mirakurun/node_modules/@node-rs/crc32
66 patch -p3 < ${crc32Patch}
71 description = "Resource manager for TV tuners.";
72 license = licenses.asl20;
73 maintainers = with maintainers; [ midchildan ];