1 { lib, stdenv, fetchurl }:
3 # libhdhomerun requires UDP port 65001 to be open in order to detect and communicate with tuners.
4 # If your firewall is enabled, make sure to have something like:
5 # networking.firewall.allowedUDPPorts = [ 65001 ];
7 stdenv.mkDerivation rec {
8 pname = "libhdhomerun";
12 url = "https://download.silicondust.com/hdhomerun/libhdhomerun_${version}.tgz";
13 sha256 = "sha256-HlT/78LUiTkRUB2jHmYrnQY+bBiv4stcZlMyUnelSpc=";
16 patchPhase = lib.optionalString stdenv.isDarwin ''
17 substituteInPlace Makefile --replace "gcc" "cc"
18 substituteInPlace Makefile --replace "-arch i386" ""
22 mkdir -p $out/{bin,lib,include/hdhomerun}
23 install -Dm444 libhdhomerun${stdenv.hostPlatform.extensions.sharedLibrary} $out/lib
24 install -Dm555 hdhomerun_config $out/bin
25 cp *.h $out/include/hdhomerun
29 description = "Implements the libhdhomerun protocol for use with Silicondust HDHomeRun TV tuners";
30 homepage = "https://www.silicondust.com/support/linux";
31 license = licenses.lgpl21Only;
32 platforms = platforms.unix;
33 maintainers = [ maintainers.titanous ];