2021-01-19 06:50:56 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, cmake, makeWrapper, pkg-config
|
2021-08-25 12:42:21 +01:00
|
|
|
, avahi, dbus, gettext, git, gnutar, gzip, bzip2, ffmpeg_4, libiconv, openssl, python
|
2020-07-29 07:32:56 +01:00
|
|
|
, v4l-utils, which, zlib }:
|
2015-06-20 21:33:57 +01:00
|
|
|
|
2017-11-01 09:41:21 +00:00
|
|
|
let
|
2019-02-23 23:36:23 +00:00
|
|
|
version = "4.2.8";
|
2015-10-21 08:01:42 +01:00
|
|
|
|
2020-07-29 07:32:56 +01: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)" ];
|
|
|
|
};
|
2019-08-13 22:52:01 +01:00
|
|
|
in stdenv.mkDerivation {
|
2019-08-13 22:52:01 +01:00
|
|
|
pname = "tvheadend";
|
|
|
|
inherit version;
|
2015-10-21 08:01:42 +01:00
|
|
|
|
2017-11-01 09:41:21 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "tvheadend";
|
|
|
|
repo = "tvheadend";
|
|
|
|
rev = "v${version}";
|
2019-02-23 23:36:23 +00:00
|
|
|
sha256 = "1xq059r2bplaa0nd0wkhw80jfwd962x0h5hgd7fz2yp6largw34m";
|
2017-11-01 09:41:21 +00:00
|
|
|
};
|
2015-06-20 21:33:57 +01:00
|
|
|
|
2017-11-01 09:41:21 +00:00
|
|
|
buildInputs = [
|
2021-08-25 12:42:21 +01:00
|
|
|
avahi dbus gettext git gnutar gzip bzip2 ffmpeg_4 libiconv openssl python
|
2017-11-01 09:41:21 +00:00
|
|
|
which zlib
|
|
|
|
];
|
2015-06-20 21:33:57 +01:00
|
|
|
|
2021-01-19 06:50:56 +00:00
|
|
|
nativeBuildInputs = [ cmake makeWrapper pkg-config ];
|
2015-06-20 21:33:57 +01:00
|
|
|
|
2019-11-03 13:10:23 +00:00
|
|
|
NIX_CFLAGS_COMPILE = [ "-Wno-error=format-truncation" "-Wno-error=stringop-truncation" ];
|
2019-09-13 02:11:56 +01:00
|
|
|
|
2015-10-21 08:01:42 +01:00
|
|
|
# disable dvbscan, as having it enabled causes a network download which
|
2020-07-29 07:32:56 +01:00
|
|
|
# cannot happen during build. We now include the dtv-scan-tables ourselves
|
2017-04-22 20:10:52 +01:00
|
|
|
configureFlags = [
|
|
|
|
"--disable-dvbscan"
|
|
|
|
"--disable-bintray_cache"
|
|
|
|
"--disable-ffmpeg_static"
|
|
|
|
"--disable-hdhomerun_client"
|
|
|
|
"--disable-hdhomerun_static"
|
|
|
|
];
|
2015-06-30 11:58:28 +01:00
|
|
|
|
2017-04-22 20:10:52 +01:00
|
|
|
dontUseCmakeConfigure = true;
|
|
|
|
|
2015-10-24 16:50:30 +01:00
|
|
|
preConfigure = ''
|
|
|
|
patchShebangs ./configure
|
2017-11-01 09:41:21 +00:00
|
|
|
|
2017-11-17 10:04:52 +00:00
|
|
|
substituteInPlace src/config.c \
|
|
|
|
--replace /usr/bin/tar ${gnutar}/bin/tar
|
2017-11-01 09:41:21 +00:00
|
|
|
|
2020-07-29 07:32:56 +01:00
|
|
|
substituteInPlace src/input/mpegts/scanfile.c \
|
|
|
|
--replace /usr/share/dvb ${dtv-scan-tables}/dvbv5
|
|
|
|
|
2017-11-01 09:41:21 +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 07:07:56 +00:00
|
|
|
--prefix PATH : ${lib.makeBinPath [ bzip2 ]}
|
2015-10-24 16:50:30 +01:00
|
|
|
'';
|
2015-06-20 21:33:57 +01:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2017-03-17 17:28:48 +00:00
|
|
|
description = "TV streaming server";
|
2015-06-20 21:33:57 +01:00
|
|
|
longDescription = ''
|
2021-01-03 09:43:56 +00:00
|
|
|
Tvheadend is a TV streaming server and recorder for Linux, FreeBSD and Android
|
2015-06-20 21:33:57 +01:00
|
|
|
supporting DVB-S, DVB-S2, DVB-C, DVB-T, ATSC, IPTV, SAT>IP and HDHomeRun as input sources.
|
2021-01-03 09:43:56 +00:00
|
|
|
Tvheadend offers the HTTP (VLC, MPlayer), HTSP (Kodi, Movian) and SAT>IP streaming.'';
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://tvheadend.org";
|
2015-10-21 08:01:42 +01:00
|
|
|
license = licenses.gpl3;
|
|
|
|
platforms = platforms.unix;
|
2017-11-01 09:41:21 +00:00
|
|
|
maintainers = with maintainers; [ simonvandel ];
|
2015-06-20 21:33:57 +01:00
|
|
|
};
|
|
|
|
}
|