nixpkgs/pkgs/tools/networking/nbd/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

40 lines
1.1 KiB
Nix
Raw Normal View History

2022-07-20 04:20:00 +00:00
{ lib, stdenv, fetchurl, pkg-config, glib, which, bison, nixosTests, linuxHeaders, gnutls }:
2014-03-20 17:07:15 +00:00
stdenv.mkDerivation rec {
pname = "nbd";
version = "3.24";
src = fetchurl {
url = "mirror://sourceforge/nbd/nbd-${version}.tar.xz";
sha256 = "sha256-aHcVbSOnsz917uidL1wskcVCr8PNy2Nt6lqIU5pY0Qw=";
};
2022-07-20 04:20:00 +00:00
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}/"
'';
2022-07-20 04:20:00 +00:00
doCheck = !stdenv.isDarwin;
passthru.tests = {
test = nixosTests.nbd;
};
# Glib calls `clock_gettime', which is in librt. Linking that library
# here ensures that a proper rpath is added to the executable so that
# it can be loaded at run-time.
2021-01-15 09:19:50 +00:00
NIX_LDFLAGS = lib.optionalString stdenv.isLinux "-lrt -lpthread";
meta = {
2022-07-20 04:20:00 +00:00
homepage = "https://nbd.sourceforge.io/";
description = "Map arbitrary files as block devices over the network";
2021-01-15 09:19:50 +00:00
license = lib.licenses.gpl2;
2022-07-20 04:20:00 +00:00
platforms = lib.platforms.unix;
};
}