nix/packages/netkit-rwho: init

This commit is contained in:
2026-07-21 05:17:55 +09:00
parent 91201d334d
commit a74421ca62
2 changed files with 55 additions and 0 deletions
+2
View File
@@ -114,6 +114,8 @@
filteredSource = pkgs.runCommandLocal "filtered-source" { } ''
ln -s ${src} $out
'';
netkit-rwho = pkgs.callPackage ./nix/packages/netkit-rwho.nix { };
});
checks = forAllSystems (system: pkgs: _: {
+53
View File
@@ -0,0 +1,53 @@
{
lib,
stdenv,
fetchurl,
fetchpatch,
cmake,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "netkit-rwho";
version = "0.17-14";
src = fetchurl {
url = "https://deb.debian.org/debian/pool/main/n/netkit-rwho/netkit-rwho_0.17.orig.tar.gz";
hash = "sha256-BAnizkv9strLLBk9D+38SbuXXLBXxcaw/8ymA6EYjac=";
};
patches = let
url = name: "https://sources.debian.org/data/main/n/netkit-rwho/${finalAttrs.version}/debian/patches/${name}.patch";
in [
(fetchpatch {
url = url "pre-0.17-13-changes";
hash = "sha256-t5WdtDgY1lX0vUE3JOB0eSZ75UsTppacNxSCeVYbzGg=";
})
(fetchpatch {
url = url "show_in_all_ifaces";
hash = "sha256-S9idU0A64SnQQ/QCtrLJ4qFxRGeKvAL/9hisbTGWi6M=";
})
(fetchpatch {
url = url "use-cmake-as-buildsystem";
hash = "sha256-pyDa9aObnwJ4qjDUskybYGhcJG3pZ6HHbJguerm2UpM=";
})
];
# FIXME: this is not working as intended,
# `strings $out/bin/* still shows a bunch of /var/spool/who dirs
postPatch = ''
for f in $(find . -type f); do
if grep -q "/var/spool/rwho" "$f"; then
substituteInPlace "$f" --replace "/var/spool/rwho" "/var/lib/rwho"
fi
done
'';
nativeBuildInputs = [ cmake ];
meta = {
license = lib.licenses.bsdOriginal;
mainProgram = "rwho";
maintainers = [ lib.maintainers.h7x4 ];
platforms = lib.platforms.linux;
};
})