fluffychat: 1.22.1 -> 1.23.0 (#364091)
[NixPkgs.git] / pkgs / by-name / nb / nbd / package.nix
blob9a3c6b02540a44adf0d29efa87c9b959b8f66d39
2   lib,
3   stdenv,
4   fetchurl,
5   fetchpatch,
6   pkg-config,
7   glib,
8   which,
9   bison,
10   nixosTests,
11   libnl,
12   linuxHeaders,
13   gnutls,
16 stdenv.mkDerivation rec {
17   pname = "nbd";
18   version = "3.25";
20   src = fetchurl {
21     url = "https://github.com/NetworkBlockDevice/nbd/releases/download/nbd-${version}/nbd-${version}.tar.xz";
22     hash = "sha256-9cj9D8tXsckmWU0OV/NWQy7ghni+8dQNCI8IMPDL3Qo=";
23   };
25   patches = [
26     # fix port setting from nbdtab
27     # https://github.com/NetworkBlockDevice/nbd/pull/154
28     (fetchpatch {
29       url = "https://github.com/NetworkBlockDevice/nbd/commit/915444bc0b8a931d32dfb755542f4bd1d37f1449.patch";
30       hash = "sha256-6z+c2cXhY92WPDqRO6AJ5BBf1N38yTgOE1foduIr5Dg=";
31     })
32   ];
34   nativeBuildInputs = [
35     pkg-config
36     which
37     bison
38   ];
40   buildInputs =
41     [
42       glib
43       gnutls
44     ]
45     ++ lib.optionals stdenv.hostPlatform.isLinux [
46       libnl
47       linuxHeaders
48     ];
50   configureFlags = [
51     "--sysconfdir=/etc"
52   ];
54   # ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
55   env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-error=implicit-function-declaration";
57   doCheck = !stdenv.hostPlatform.isDarwin;
59   passthru.tests = {
60     test = nixosTests.nbd;
61   };
63   meta = {
64     homepage = "https://nbd.sourceforge.io/";
65     description = "Map arbitrary files as block devices over the network";
66     license = lib.licenses.gpl2Only;
67     platforms = lib.platforms.unix;
68     maintainers = with lib.maintainers; [ nickcao ];
69   };