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 postPatch = lib.optionalString stdenv.isDarwin ''
17 substituteInPlace Makefile \
18 --replace "-arch x86_64" "-arch ${stdenv.hostPlatform.darwinArch}"
22 "CC=${stdenv.cc.targetPrefix}cc"
26 mkdir -p $out/{bin,lib,include/hdhomerun}
27 install -Dm444 libhdhomerun${stdenv.hostPlatform.extensions.sharedLibrary} $out/lib
28 install -Dm555 hdhomerun_config $out/bin
29 cp *.h $out/include/hdhomerun
33 description = "Implements the libhdhomerun protocol for use with Silicondust HDHomeRun TV tuners";
34 homepage = "https://www.silicondust.com/support/linux";
35 license = licenses.lgpl21Only;
36 platforms = platforms.unix;
37 maintainers = [ maintainers.titanous ];