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

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

68 lines
1.5 KiB
Nix
Raw Normal View History

2023-12-02 18:14:48 +01:00
{ lib
, stdenv
, fetchurl
, fetchpatch
2023-12-02 18:14:48 +01:00
, pkg-config
, glib
, which
, bison
, nixosTests
2023-12-02 18:23:15 +01:00
, libnl
2023-12-02 18:14:48 +01:00
, linuxHeaders
, gnutls
}:
2014-03-20 18:07:15 +01:00
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=";
};
patches = [
# fix port setting from nbdtab
# https://github.com/NetworkBlockDevice/nbd/pull/154
(fetchpatch {
url = "https://github.com/NetworkBlockDevice/nbd/commit/915444bc0b8a931d32dfb755542f4bd1d37f1449.patch";
hash = "sha256-6z+c2cXhY92WPDqRO6AJ5BBf1N38yTgOE1foduIr5Dg=";
})
];
2023-12-02 18:14:48 +01:00
nativeBuildInputs = [
pkg-config
which
bison
];
buildInputs = [
glib
gnutls
] ++ lib.optionals stdenv.isLinux [
2023-12-02 18:23:15 +01:00
libnl
2023-12-02 18:14:48 +01:00
linuxHeaders
];
2023-12-08 03:23:31 +01:00
configureFlags = [
"--sysconfdir=/etc"
];
2024-02-01 16:02:30 +01:00
# ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-error=implicit-function-declaration";
2022-07-20 06:20:00 +02:00
doCheck = !stdenv.isDarwin;
passthru.tests = {
test = nixosTests.nbd;
};
meta = {
2022-07-20 06:20:00 +02:00
homepage = "https://nbd.sourceforge.io/";
description = "Map arbitrary files as block devices over the network";
2021-01-15 10:19:50 +01:00
license = lib.licenses.gpl2;
2022-07-20 06:20:00 +02:00
platforms = lib.platforms.unix;
2023-12-02 18:20:09 +01:00
maintainers = with lib.maintainers; [ nickcao ];
};
}