···1213 buildInputs = [ cmake pkgconfig libusb1 ];
1415- # Building with -DINSTALL_UDEV_RULES=ON tries to install udev rules to
16- # /etc/udev/rules.d/, and there is no option to install elsewhere. So install
17- # rules manually.
0018 postInstall = ''
19 mkdir -p "$out/etc/udev/rules.d/"
20 cp ../rtl-sdr.rules "$out/etc/udev/rules.d/99-rtl-sdr.rules"
000021 '';
2223 meta = with stdenv.lib; {
···1213 buildInputs = [ cmake pkgconfig libusb1 ];
1415+ # TODO: get these fixes upstream:
16+ # * Building with -DINSTALL_UDEV_RULES=ON tries to install udev rules to
17+ # /etc/udev/rules.d/, and there is no option to install elsewhere. So install
18+ # rules manually.
19+ # * Propagate libusb-1.0 dependency in pkg-config file.
20 postInstall = ''
21 mkdir -p "$out/etc/udev/rules.d/"
22 cp ../rtl-sdr.rules "$out/etc/udev/rules.d/99-rtl-sdr.rules"
23+24+ pcfile="$out"/lib/pkgconfig/librtlsdr.pc
25+ grep -q "Requires:" "$pcfile" && { echo "Upstream has added 'Requires:' in $(basename "$pcfile"); update nix expression."; exit 1; }
26+ echo "Requires: libusb-1.0" >> "$pcfile"
27 '';
2829 meta = with stdenv.lib; {