From af0c3fca1de900de881f19a1fae3806ea34427cc Mon Sep 17 00:00:00 2001 From: Peter Hoeg Date: Wed, 1 Nov 2017 17:41:21 +0800 Subject: tvheadend: fix version detection and wrap bzip2 to support backups --- pkgs/servers/tvheadend/default.nix | 52 +++++++++++++++++++++++--------------- 1 file changed, 31 insertions(+), 21 deletions(-) (limited to 'pkgs/servers') diff --git a/pkgs/servers/tvheadend/default.nix b/pkgs/servers/tvheadend/default.nix index 851149ad7f7..7ff0796811a 100644 --- a/pkgs/servers/tvheadend/default.nix +++ b/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; @@ -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 ]; }; } -- cgit 1.4.1