Skip to content

Commit

Permalink
tvheadend: fix version detection and wrap bzip2 to support backups
Browse files Browse the repository at this point in the history
  • Loading branch information
peterhoeg committed Nov 1, 2017
1 parent 06d7e54 commit af0c3fc
Showing 1 changed file with 31 additions and 21 deletions.
52 changes: 31 additions & 21 deletions pkgs/servers/tvheadend/default.nix
@@ -1,20 +1,26 @@
{avahi, cmake, dbus, fetchurl, gettext, git, gnutar, gzip, bzip2, ffmpeg, libiconv, openssl, pkgconfig, python
, stdenv, which, zlib}:
{ stdenv, fetchFromGitHub, cmake, makeWrapper, pkgconfig
, avahi, dbus, gettext, git, gnutar, gzip, bzip2, ffmpeg, libiconv, openssl, python
, which, zlib }:

with stdenv.lib;
let
version = "4.2.1";

let version = "4.2.1";
pkgName = "tvheadend";
in stdenv.mkDerivation rec {
name = "tvheadend-${version}";

in
src = fetchFromGitHub {
owner = "tvheadend";
repo = "tvheadend";
rev = "v${version}";
sha256 = "1lhk8psvifmn4kjwyfxjj21z0apyr59zizzsfd4j22v7bk66rrl9";
};

stdenv.mkDerivation rec {
name = "${pkgName}-${version}";
buildInputs = [
avahi dbus gettext git gnutar gzip bzip2 ffmpeg libiconv openssl python
which zlib
];

src = fetchurl {
url = "https://github.com/tvheadend/tvheadend/archive/v${version}.tar.gz";
sha256 = "1wrj3w595c1hfl2vmfdmp5qncy5samqi7iisyq76jf3nlzgw6dvn";
};
nativeBuildInputs = [ cmake makeWrapper pkgconfig ];

enableParallelBuilding = true;

Expand All @@ -28,28 +34,32 @@ stdenv.mkDerivation rec {
"--disable-hdhomerun_static"
];

buildPhase = "make";

dontUseCmakeConfigure = true;

nativeBuildInputs = [ pkgconfig ];
buildInputs = [ avahi dbus cmake gettext git gnutar gzip bzip2 ffmpeg libiconv openssl python
which zlib ];

preConfigure = ''
patchShebangs ./configure
substituteInPlace src/config.c --replace /usr/bin/tar ${gnutar}/bin/tar
# 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 \
--prefix PATH : ${stdenv.lib.makeBinPath [ bzip2 ]}
'';

meta = {
meta = with stdenv.lib; {
description = "TV streaming server";
longDescription = ''
Tvheadend is a TV streaming server and recorder for Linux, FreeBSD and Android
Tvheadend is a TV streaming server and recorder for Linux, FreeBSD and Android
supporting DVB-S, DVB-S2, DVB-C, DVB-T, ATSC, IPTV, SAT>IP and HDHomeRun as input sources.
Tvheadend offers the HTTP (VLC, MPlayer), HTSP (Kodi, Movian) and SAT>IP streaming.'';
homepage = https://tvheadend.org;
license = licenses.gpl3;
platforms = platforms.unix;
maintainers = [ maintainers.simonvandel ];
maintainers = with maintainers; [ simonvandel ];
};
}

0 comments on commit af0c3fc

Please sign in to comment.