2018-09-14 10:05:40 -07:00
|
|
|
{ stdenv, fetchurl, pkgconfig, glib, which }:
|
2009-09-24 19:09:43 -07:00
|
|
|
|
2014-03-20 10:07:15 -07:00
|
|
|
stdenv.mkDerivation rec {
|
2018-08-24 00:27:12 -07:00
|
|
|
name = "nbd-3.18";
|
2010-07-28 14:28:23 -07:00
|
|
|
|
2009-09-24 19:09:43 -07:00
|
|
|
src = fetchurl {
|
2014-01-29 09:31:36 -08:00
|
|
|
url = "mirror://sourceforge/nbd/${name}.tar.xz";
|
2018-08-24 00:27:12 -07:00
|
|
|
sha256 = "0cb0sjiv0j9sh9dk24nrjm7sa0axbrcp2av5hc91g1ryzk764dyq";
|
2009-09-24 19:09:43 -07:00
|
|
|
};
|
2010-07-28 14:28:23 -07:00
|
|
|
|
2018-09-14 10:05:40 -07:00
|
|
|
buildInputs = [ glib ]
|
2016-02-18 12:11:15 -08:00
|
|
|
++ stdenv.lib.optional (stdenv ? glibc) stdenv.glibc.linuxHeaders;
|
2011-05-13 11:30:36 -07:00
|
|
|
|
2018-09-14 10:05:40 -07:00
|
|
|
nativeBuildInputs = [ pkgconfig which ];
|
|
|
|
|
2012-02-21 07:07:39 -08:00
|
|
|
postInstall = ''
|
|
|
|
mkdir -p "$out/share/doc/${name}"
|
2014-01-29 09:31:36 -08:00
|
|
|
cp README.md "$out/share/doc/${name}/"
|
2012-02-21 07:07:39 -08:00
|
|
|
'';
|
2012-02-07 11:54:25 -08:00
|
|
|
|
2016-09-19 06:41:45 -07:00
|
|
|
doCheck = true;
|
2011-05-10 00:15:58 -07:00
|
|
|
|
2012-03-25 11:10:30 -07:00
|
|
|
# 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.
|
2012-03-25 12:40:04 -07:00
|
|
|
NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isLinux "-lrt -lpthread";
|
2012-03-25 11:10:30 -07:00
|
|
|
|
2010-07-28 14:28:23 -07:00
|
|
|
meta = {
|
2017-08-01 13:03:30 -07:00
|
|
|
homepage = http://nbd.sourceforge.net;
|
2016-06-20 03:53:46 -07:00
|
|
|
description = "Map arbitrary files as block devices over the network";
|
2014-06-18 21:19:00 -07:00
|
|
|
license = stdenv.lib.licenses.gpl2;
|
2016-05-16 13:30:20 -07:00
|
|
|
maintainers = [ stdenv.lib.maintainers.peti ];
|
2016-09-01 10:39:33 -07:00
|
|
|
platforms = stdenv.lib.platforms.linux;
|
2010-07-28 14:28:23 -07:00
|
|
|
};
|
2009-09-24 19:09:43 -07:00
|
|
|
}
|