29 in stdenv.mkDerivation {
33 src = fetchFromGitHub {
37 sha256 = "1xq059r2bplaa0nd0wkhw80jfwd962x0h5hgd7fz2yp6largw34m";
46 # Pull upstream fix for -fno-common toolchain
47 # https://github.com/tvheadend/tvheadend/pull/1342
48 # TODO: can be removed with 4.3 release.
50 name = "fno-common.patch";
51 url = "https://github.com/tvheadend/tvheadend/commit/bd92f1389f1aacdd08e913b0383a0ca9dc223153.patch";
52 sha256 = "17bsx6mnv4pjiayvx1d57dphva0kvlppvnmmaym06dh4524pnly1";
67 ffmpeg_4 # depends on libav
76 enableParallelBuilding = true;
78 env.NIX_CFLAGS_COMPILE = toString ([
79 "-Wno-error=format-truncation"
80 "-Wno-error=stringop-truncation"
81 ] ++ lib.optionals (stdenv.cc.isGNU && lib.versionAtLeast stdenv.cc.version "12") [
82 # Needed with GCC 12 but unrecognized with GCC 9
83 "-Wno-error=use-after-free"
87 # disable dvbscan, as having it enabled causes a network download which
88 # cannot happen during build. We now include the dtv-scan-tables ourselves
90 "--disable-bintray_cache"
91 "--disable-ffmpeg_static"
92 # incompatible with our libhdhomerun version
93 "--disable-hdhomerun_client"
94 "--disable-hdhomerun_static"
95 "--disable-libx264_static"
96 "--disable-libx265_static"
97 "--disable-libvpx_static"
98 "--disable-libtheora_static"
99 "--disable-libvorbis_static"
100 "--disable-libfdkaac_static"
101 "--disable-libmfx_static"
105 substituteInPlace src/config.c \
106 --replace /usr/bin/tar ${gnutar}/bin/tar
108 substituteInPlace src/input/mpegts/scanfile.c \
109 --replace /usr/share/dvb ${dtv-scan-tables}/share/dvbv5
111 # the version detection script `support/version` reads this file if it
112 # exists, so let's just use that
113 echo ${version} > rpm/version
117 wrapProgram $out/bin/tvheadend \
118 --prefix PATH : ${lib.makeBinPath [ bzip2 ]}
122 description = "TV streaming server and digital video recorder";
124 Tvheadend is a TV streaming server for Linux supporting DVB-S,
125 DVB-S2, DVB-C, DVB-T, ATSC, IPTV,SAT>IP and other formats
126 through the unix pipe as input sources.
128 homepage = "https://tvheadend.org";
129 license = licenses.gpl3Only;
130 platforms = platforms.unix;
131 maintainers = with maintainers; [ simonvandel ];
132 mainProgram = "tvheadend";