about summary refs log tree commit diff
path: root/pkgs/applications/misc
diff options
context:
space:
mode:
authorBjørn Forsman <bjorn.forsman@gmail.com>2014-10-30 08:26:19 +0100
committerBjørn Forsman <bjorn.forsman@gmail.com>2014-10-30 08:33:16 +0100
commit346f20305b92f6a67cd421bce5916432b1eaf698 (patch)
treec2700674bde297fa83f646ee4b1540132d7676b9 /pkgs/applications/misc
parent9d9fdb173a469fa8964c091c7289fb8aaf35ffdb (diff)
downloadnixlib-346f20305b92f6a67cd421bce5916432b1eaf698.tar
nixlib-346f20305b92f6a67cd421bce5916432b1eaf698.tar.gz
nixlib-346f20305b92f6a67cd421bce5916432b1eaf698.tar.bz2
nixlib-346f20305b92f6a67cd421bce5916432b1eaf698.tar.lz
nixlib-346f20305b92f6a67cd421bce5916432b1eaf698.tar.xz
nixlib-346f20305b92f6a67cd421bce5916432b1eaf698.tar.zst
nixlib-346f20305b92f6a67cd421bce5916432b1eaf698.zip
rtl-sdr: add "Require: libusb-1.0" to pkg-config file
So that building 3rd party code works out of the box. (E.g. building
dump1090[1] works now).

[1]: https://github.com/antirez/dump1090
Diffstat (limited to 'pkgs/applications/misc')
-rw-r--r--pkgs/applications/misc/rtl-sdr/default.nix12
1 files changed, 9 insertions, 3 deletions
diff --git a/pkgs/applications/misc/rtl-sdr/default.nix b/pkgs/applications/misc/rtl-sdr/default.nix
index e6e762493883..defe6eb2df1f 100644
--- a/pkgs/applications/misc/rtl-sdr/default.nix
+++ b/pkgs/applications/misc/rtl-sdr/default.nix
@@ -12,12 +12,18 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ cmake pkgconfig libusb1 ];
 
-  # Building with -DINSTALL_UDEV_RULES=ON tries to install udev rules to
-  # /etc/udev/rules.d/, and there is no option to install elsewhere. So install
-  # rules manually.
+  # TODO: get these fixes upstream:
+  # * Building with -DINSTALL_UDEV_RULES=ON tries to install udev rules to
+  #   /etc/udev/rules.d/, and there is no option to install elsewhere. So install
+  #   rules manually.
+  # * Propagate libusb-1.0 dependency in pkg-config file.
   postInstall = ''
     mkdir -p "$out/etc/udev/rules.d/"
     cp ../rtl-sdr.rules "$out/etc/udev/rules.d/99-rtl-sdr.rules"
+
+    pcfile="$out"/lib/pkgconfig/librtlsdr.pc
+    grep -q "Requires:" "$pcfile" && { echo "Upstream has added 'Requires:' in $(basename "$pcfile"); update nix expression."; exit 1; }
+    echo "Requires: libusb-1.0" >> "$pcfile"
   '';
 
   meta = with stdenv.lib; {