2022-12-21 15:51:42 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, fetchpatch
|
|
|
|
|
|
|
|
# buildtime
|
|
|
|
, makeWrapper
|
|
|
|
, pkg-config
|
|
|
|
, python3
|
|
|
|
, which
|
|
|
|
|
|
|
|
# runtime
|
|
|
|
, avahi
|
|
|
|
, bzip2
|
|
|
|
, dbus
|
2022-12-21 15:53:27 +00:00
|
|
|
, dtv-scan-tables
|
2023-03-03 18:41:10 +00:00
|
|
|
, ffmpeg_4
|
2022-12-21 15:51:42 +00:00
|
|
|
, gettext
|
|
|
|
, gnutar
|
|
|
|
, gzip
|
|
|
|
, libiconv
|
|
|
|
, openssl
|
|
|
|
, uriparser
|
|
|
|
, zlib
|
|
|
|
}:
|
2015-06-20 20:33:57 +00:00
|
|
|
|
2017-11-01 09:41:21 +00:00
|
|
|
let
|
2019-02-23 23:36:23 +00:00
|
|
|
version = "4.2.8";
|
2019-08-13 21:52:01 +00:00
|
|
|
in stdenv.mkDerivation {
|
2019-08-13 21:52:01 +00:00
|
|
|
pname = "tvheadend";
|
|
|
|
inherit version;
|
2015-10-21 07:01:42 +00:00
|
|
|
|
2017-11-01 09:41:21 +00:00
|
|
|
src = fetchFromGitHub {
|
2022-12-21 15:51:42 +00:00
|
|
|
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 20:33:57 +00:00
|
|
|
|
2022-12-21 15:51:42 +00:00
|
|
|
outputs = [
|
|
|
|
"out"
|
|
|
|
"man"
|
|
|
|
];
|
|
|
|
|
2022-06-09 22:06:06 +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";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2022-12-21 15:51:42 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
makeWrapper
|
|
|
|
pkg-config
|
|
|
|
python3
|
|
|
|
which
|
|
|
|
];
|
|
|
|
|
2017-11-01 09:41:21 +00:00
|
|
|
buildInputs = [
|
2022-12-21 15:51:42 +00:00
|
|
|
avahi
|
|
|
|
bzip2
|
|
|
|
dbus
|
2023-03-03 18:41:10 +00:00
|
|
|
ffmpeg_4 # depends on libav
|
2022-12-21 15:51:42 +00:00
|
|
|
gettext
|
|
|
|
gzip
|
|
|
|
libiconv
|
|
|
|
openssl
|
|
|
|
uriparser
|
|
|
|
zlib
|
2017-11-01 09:41:21 +00:00
|
|
|
];
|
2015-06-20 20:33:57 +00:00
|
|
|
|
2022-12-21 15:51:42 +00:00
|
|
|
enableParallelBuilding = true;
|
2015-06-20 20:33:57 +00:00
|
|
|
|
2023-02-20 15:17:34 +00:00
|
|
|
env.NIX_CFLAGS_COMPILE = toString ([
|
2022-12-21 15:51:42 +00:00
|
|
|
"-Wno-error=format-truncation"
|
|
|
|
"-Wno-error=stringop-truncation"
|
2023-02-12 11:57:11 +00:00
|
|
|
] ++ lib.optionals (stdenv.cc.isGNU && lib.versionAtLeast stdenv.cc.version "12") [
|
|
|
|
# Needed with GCC 12 but unrecognized with GCC 9
|
2022-12-23 16:57:29 +00:00
|
|
|
"-Wno-error=use-after-free"
|
2023-02-20 15:17:34 +00:00
|
|
|
]);
|
2019-09-13 01:11:56 +00:00
|
|
|
|
2017-04-22 19:10:52 +00:00
|
|
|
configureFlags = [
|
2022-12-21 15:51:42 +00:00
|
|
|
# disable dvbscan, as having it enabled causes a network download which
|
|
|
|
# cannot happen during build. We now include the dtv-scan-tables ourselves
|
2017-04-22 19:10:52 +00:00
|
|
|
"--disable-dvbscan"
|
|
|
|
"--disable-bintray_cache"
|
|
|
|
"--disable-ffmpeg_static"
|
2022-12-21 15:51:42 +00:00
|
|
|
# incompatible with our libhdhomerun version
|
2017-04-22 19:10:52 +00:00
|
|
|
"--disable-hdhomerun_client"
|
|
|
|
"--disable-hdhomerun_static"
|
2022-12-21 15:51:42 +00:00
|
|
|
"--disable-libx264_static"
|
|
|
|
"--disable-libx265_static"
|
|
|
|
"--disable-libvpx_static"
|
|
|
|
"--disable-libtheora_static"
|
|
|
|
"--disable-libvorbis_static"
|
|
|
|
"--disable-libfdkaac_static"
|
|
|
|
"--disable-libmfx_static"
|
2017-04-22 19:10:52 +00:00
|
|
|
];
|
2015-06-30 10:58:28 +00:00
|
|
|
|
2015-10-24 15:50:30 +00: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 06:32:56 +00:00
|
|
|
substituteInPlace src/input/mpegts/scanfile.c \
|
2023-01-14 11:44:04 +00:00
|
|
|
--replace /usr/share/dvb ${dtv-scan-tables}/share/dvbv5
|
2020-07-29 06:32:56 +00:00
|
|
|
|
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 15:50:30 +00:00
|
|
|
'';
|
2015-06-20 20:33:57 +00:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2022-12-21 15:51:42 +00:00
|
|
|
description = "TV streaming server and digital video recorder";
|
2015-06-20 20:33:57 +00:00
|
|
|
longDescription = ''
|
2022-12-21 15:51:42 +00:00
|
|
|
Tvheadend is a TV streaming server for Linux supporting DVB-S,
|
|
|
|
DVB-S2, DVB-C, DVB-T, ATSC, IPTV,SAT>IP and other formats
|
|
|
|
through the unix pipe as input sources.
|
|
|
|
'';
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://tvheadend.org";
|
2022-12-21 15:51:42 +00:00
|
|
|
license = licenses.gpl3Only;
|
2015-10-21 07:01:42 +00:00
|
|
|
platforms = platforms.unix;
|
2017-11-01 09:41:21 +00:00
|
|
|
maintainers = with maintainers; [ simonvandel ];
|
2015-06-20 20:33:57 +00:00
|
|
|
};
|
|
|
|
}
|