nixpkgs/pkgs/tools/networking/nbd/default.nix
Yarny0 2d3ca77855 nbd: 3.24 -> 3.25, switch to github
"First official release on github,
rather than sourceforge (as in the past)",
according to the github tag message in

https://github.com/NetworkBlockDevice/nbd/releases/tag/nbd-3.25

Note that the commit at hand also fixes the build after it
broke due to the update to GLib 2.75.3 ("Log limit exceeded") in

8e5ee715d1
2023-05-02 17:53:42 +02:00

35 lines
911 B
Nix

{ lib, stdenv, fetchurl, pkg-config, glib, which, bison, nixosTests, linuxHeaders, gnutls }:
stdenv.mkDerivation rec {
pname = "nbd";
version = "3.25";
src = fetchurl {
url = "https://github.com/NetworkBlockDevice/nbd/releases/download/nbd-${version}/nbd-${version}.tar.xz";
hash = "sha256-9cj9D8tXsckmWU0OV/NWQy7ghni+8dQNCI8IMPDL3Qo=";
};
buildInputs = [ glib gnutls ]
++ lib.optionals stdenv.isLinux [ linuxHeaders ];
nativeBuildInputs = [ pkg-config which bison ];
postInstall = ''
mkdir -p "$out/share/doc/nbd-${version}"
cp README.md "$out/share/doc/nbd-${version}/"
'';
doCheck = !stdenv.isDarwin;
passthru.tests = {
test = nixosTests.nbd;
};
meta = {
homepage = "https://nbd.sourceforge.io/";
description = "Map arbitrary files as block devices over the network";
license = lib.licenses.gpl2;
platforms = lib.platforms.unix;
};
}