diff --git a/pkgs/applications/misc/rtl-sdr/default.nix b/pkgs/applications/misc/rtl-sdr/default.nix index e6e76249388..defe6eb2df1 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; {