2022-06-16 17:23:12 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, fetchpatch, cmake, makeWrapper, pkg-config
|
2022-01-19 23:45:15 +00:00
|
|
|
, avahi, dbus, gettext, git, gnutar, gzip, bzip2, ffmpeg_4, libiconv, openssl, python2
|
2020-08-20 17:08:02 +00:00
|
|
|
, v4l-utils, which, zlib }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
version = "4.2.8";
|
|
|
|
|
2020-08-20 17:08:02 +00:00
|
|
|
dtv-scan-tables = stdenv.mkDerivation {
|
|
|
|
pname = "dtv-scan-tables";
|
|
|
|
version = "2020-05-18";
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "tvheadend";
|
|
|
|
repo = "dtv-scan-tables";
|
|
|
|
rev = "e3138a506a064f6dfd0639d69f383e8e576609da";
|
|
|
|
sha256 = "19ac9ds3rfc2xrqcywsbd1iwcpv7vmql7gp01iikxkzcgm2g2b6w";
|
|
|
|
};
|
|
|
|
nativeBuildInputs = [ v4l-utils ];
|
|
|
|
installFlags = [ "DATADIR=$(out)" ];
|
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
in stdenv.mkDerivation {
|
|
|
|
pname = "tvheadend";
|
|
|
|
inherit version;
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "tvheadend";
|
|
|
|
repo = "tvheadend";
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "1xq059r2bplaa0nd0wkhw80jfwd962x0h5hgd7fz2yp6largw34m";
|
|
|
|
};
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
patches = [
|
|
|
|
# Pull upstream fix for -fno-common toolchain
|
|
|
|
# https://github.com/tvheadend/tvheadend/pull/1342
|
|
|
|
# TODO: can be removed with 4.3 release.
|
|
|
|
(fetchpatch {
|
|
|
|
name = "fno-common.patch";
|
|
|
|
url = "https://github.com/tvheadend/tvheadend/commit/bd92f1389f1aacdd08e913b0383a0ca9dc223153.patch";
|
|
|
|
sha256 = "17bsx6mnv4pjiayvx1d57dphva0kvlppvnmmaym06dh4524pnly1";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [
|
2022-01-19 23:45:15 +00:00
|
|
|
avahi dbus gettext git gnutar gzip bzip2 ffmpeg_4 libiconv openssl python2
|
2020-04-24 23:36:52 +00:00
|
|
|
which zlib
|
|
|
|
];
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ cmake makeWrapper pkg-config ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
NIX_CFLAGS_COMPILE = [ "-Wno-error=format-truncation" "-Wno-error=stringop-truncation" ];
|
|
|
|
|
|
|
|
# disable dvbscan, as having it enabled causes a network download which
|
2020-08-20 17:08:02 +00:00
|
|
|
# cannot happen during build. We now include the dtv-scan-tables ourselves
|
2020-04-24 23:36:52 +00:00
|
|
|
configureFlags = [
|
|
|
|
"--disable-dvbscan"
|
|
|
|
"--disable-bintray_cache"
|
|
|
|
"--disable-ffmpeg_static"
|
|
|
|
"--disable-hdhomerun_client"
|
|
|
|
"--disable-hdhomerun_static"
|
|
|
|
];
|
|
|
|
|
|
|
|
dontUseCmakeConfigure = true;
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
patchShebangs ./configure
|
|
|
|
|
|
|
|
substituteInPlace src/config.c \
|
|
|
|
--replace /usr/bin/tar ${gnutar}/bin/tar
|
|
|
|
|
2020-08-20 17:08:02 +00:00
|
|
|
substituteInPlace src/input/mpegts/scanfile.c \
|
|
|
|
--replace /usr/share/dvb ${dtv-scan-tables}/dvbv5
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
# the version detection script `support/version` reads this file if it
|
|
|
|
# exists, so let's just use that
|
|
|
|
echo ${version} > rpm/version
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
wrapProgram $out/bin/tvheadend \
|
2021-01-15 22:18:51 +00:00
|
|
|
--prefix PATH : ${lib.makeBinPath [ bzip2 ]}
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "TV streaming server";
|
|
|
|
longDescription = ''
|
2021-01-15 22:18:51 +00:00
|
|
|
Tvheadend is a TV streaming server and recorder for Linux, FreeBSD and Android
|
2020-04-24 23:36:52 +00:00
|
|
|
supporting DVB-S, DVB-S2, DVB-C, DVB-T, ATSC, IPTV, SAT>IP and HDHomeRun as input sources.
|
2021-01-15 22:18:51 +00:00
|
|
|
Tvheadend offers the HTTP (VLC, MPlayer), HTSP (Kodi, Movian) and SAT>IP streaming.'';
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://tvheadend.org";
|
|
|
|
license = licenses.gpl3;
|
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = with maintainers; [ simonvandel ];
|
|
|
|
};
|
|
|
|
}
|