From 691596086f8c082f25cc6e3cbd793db1578b12a0 Mon Sep 17 00:00:00 2001 From: Luke Adams Date: Sun, 3 Jun 2018 16:12:34 -0500 Subject: [PATCH] rtl-sdr: fix linking errors on Darwin --- pkgs/applications/misc/rtl-sdr/default.nix | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/misc/rtl-sdr/default.nix b/pkgs/applications/misc/rtl-sdr/default.nix index 92e96a7fb5ee..bedfc563b1c0 100644 --- a/pkgs/applications/misc/rtl-sdr/default.nix +++ b/pkgs/applications/misc/rtl-sdr/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchgit, cmake, pkgconfig, libusb1 }: +{ stdenv, lib, fetchpatch, fetchgit, cmake, pkgconfig, libusb1 }: stdenv.mkDerivation rec { name = "rtl-sdr-${version}"; @@ -26,7 +26,13 @@ stdenv.mkDerivation rec { grep -q "Requires:" "$pcfile" && { echo "Upstream has added 'Requires:' in $(basename "$pcfile"); update nix expression."; exit 1; } echo "Requires: libusb-1.0" >> "$pcfile" ''; - + patches = lib.optionals stdenv.isDarwin [ + (fetchpatch { + name = "linker-fix.patch"; + url = "https://github.com/lukeadams/rtl-sdr/commit/7a66dcf268305b5aa507d1756799942c74549b72.patch"; + sha256 = "0cn9fyf4ay4i3shvxj1ivgyxjvfm401irk560jdjl594nzadrcsl"; + }) + ]; meta = with stdenv.lib; { description = "Turns your Realtek RTL2832 based DVB dongle into a SDR receiver"; homepage = http://sdr.osmocom.org/trac/wiki/rtl-sdr;