summary refs log tree commit diff
path: root/pkgs/tools/networking/nbd/default.nix
diff options
context:
space:
mode:
authorPeter Simons <simons@cryp.to>2012-03-25 18:10:30 +0000
committerPeter Simons <simons@cryp.to>2012-03-25 18:10:30 +0000
commit41081c4eb05ada868938aa2f71cb14e45d017d70 (patch)
tree3661324c301b7e1c99e0914802f46efcb7cec3a6 /pkgs/tools/networking/nbd/default.nix
parentfa183b675b7b4f33926a194fd7343b144e31548c (diff)
downloadnixpkgs-41081c4eb05ada868938aa2f71cb14e45d017d70.tar
nixpkgs-41081c4eb05ada868938aa2f71cb14e45d017d70.tar.gz
nixpkgs-41081c4eb05ada868938aa2f71cb14e45d017d70.tar.bz2
nixpkgs-41081c4eb05ada868938aa2f71cb14e45d017d70.tar.lz
nixpkgs-41081c4eb05ada868938aa2f71cb14e45d017d70.tar.xz
nixpkgs-41081c4eb05ada868938aa2f71cb14e45d017d70.tar.zst
nixpkgs-41081c4eb05ada868938aa2f71cb14e45d017d70.zip
nbd: re-introduced linking with -lrt, and added an additional -lpthread on top of it
Linking these libraries makes sure that they can be found at run-time,
because a proper rpath into the Nix store is added to the generated
executable. Without that rpath, nbd-server will try to load the system's
libpthread.so.0, which may not be what we want.

svn path=/nixpkgs/trunk/; revision=33408
Diffstat (limited to 'pkgs/tools/networking/nbd/default.nix')
-rw-r--r--pkgs/tools/networking/nbd/default.nix5
1 files changed, 5 insertions, 0 deletions
diff --git a/pkgs/tools/networking/nbd/default.nix b/pkgs/tools/networking/nbd/default.nix
index 929db017152..a478fe9454c 100644
--- a/pkgs/tools/networking/nbd/default.nix
+++ b/pkgs/tools/networking/nbd/default.nix
@@ -21,6 +21,11 @@ stdenv.mkDerivation {
   # The test suite doesn't succeed on Hydra.
   doCheck = false;
 
+  # 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.
+  NIX_LDFLAGS = "-lrt -lpthread";
+
   meta = {
     homepage = "http://nbd.sourceforge.net";
     description = "map arbitrary files as block devices over the network";