vdr: fix overrideAttrs (#59083)

The current vdr derivation can not be overritten. The attribute plugins
gets lost while overriding and that leads to problems when evaluating
vdrPlugins.

Moved vdr own plugins outside vdr derivation.
This commit is contained in:
Christian Kögler 2019-04-07 15:09:38 +02:00 committed by zimbatm
parent af44cf8bc5
commit 75060fab76
3 changed files with 55 additions and 61 deletions

View File

@ -1,78 +1,55 @@
{ stdenv, fetchurl, fontconfig, libjpeg, libcap, freetype, fribidi, pkgconfig { stdenv, fetchurl, fontconfig, libjpeg, libcap, freetype, fribidi, pkgconfig
, gettext, ncurses, systemd, perl , gettext, systemd, perl, lib
, enableSystemd ? true , enableSystemd ? true
, enableBidi ? true , enableBidi ? true
}: }: stdenv.mkDerivation rec {
let
version = "2.4.0";
name = "vdr-${version}"; name = "vdr-${version}";
version = "2.4.0";
mkPlugin = name: stdenv.mkDerivation { src = fetchurl {
name = "vdr-${name}-${version}"; url = "ftp://ftp.tvdr.de/vdr/${name}.tar.bz2";
inherit (vdr) src; sha256 = "1klcgy9kr7n6z8d2c77j63bl8hvhx5qnqppg73f77004hzz4kbwk";
buildInputs = [ vdr ];
preConfigure = "cd PLUGINS/src/${name}";
installFlags = [ "DESTDIR=$(out)" ];
}; };
vdr = stdenv.mkDerivation { enableParallelBuilding = true;
inherit name; postPatch = "substituteInPlace Makefile --replace libsystemd-daemon libsystemd";
src = fetchurl { buildInputs = [ fontconfig libjpeg libcap freetype ]
url = "ftp://ftp.tvdr.de/vdr/${name}.tar.bz2"; ++ lib.optional enableSystemd systemd
sha256 = "1klcgy9kr7n6z8d2c77j63bl8hvhx5qnqppg73f77004hzz4kbwk"; ++ lib.optional enableBidi fribidi;
};
enableParallelBuilding = true; buildFlags = [ "vdr" "i18n" ]
++ lib.optional enableSystemd "SDNOTIFY=1"
++ lib.optional enableBidi "BIDI=1";
postPatch = "substituteInPlace Makefile --replace libsystemd-daemon libsystemd"; nativeBuildInputs = [ perl ];
buildInputs = [ fontconfig libjpeg libcap freetype ] # plugins uses the same build environment as vdr
++ stdenv.lib.optional enableSystemd systemd propagatedNativeBuildInputs = [ pkgconfig gettext ];
++ stdenv.lib.optional enableBidi fribidi;
buildFlags = [ "vdr" "i18n" ] installFlags = [
++ stdenv.lib.optional enableSystemd "SDNOTIFY=1" "DESTDIR=$(out)"
++ stdenv.lib.optional enableBidi "BIDI=1"; "PREFIX=" # needs to be empty, otherwise plugins try to install at same prefix
];
nativeBuildInputs = [ perl ]; installTargets = [ "install-pc" "install-bin" "install-doc" "install-i18n"
"install-includes" ];
# plugins uses the same build environment as vdr postInstall = ''
propagatedNativeBuildInputs = [ pkgconfig gettext ]; mkdir -p $out/lib/vdr # only needed if vdr is started without any plugin
mkdir -p $out/share/vdr/conf
cp *.conf $out/share/vdr/conf
'';
installFlags = [ outputs = [ "out" "dev" "man" ];
"DESTDIR=$(out)"
"PREFIX=" # needs to be empty, otherwise plugins try to install at same prefix
];
installTargets = [ "install-pc" "install-bin" "install-doc" "install-i18n"
"install-includes" ];
postInstall = ''
mkdir -p $out/lib/vdr # only needed if vdr is started without any plugin
mkdir -p $out/share/vdr/conf
cp *.conf $out/share/vdr/conf
'';
outputs = [ "out" "dev" "man" ];
meta = with stdenv.lib; {
homepage = http://www.tvdr.de/;
description = "Video Disc Recorder";
maintainers = [ maintainers.ck3d ];
platforms = [ "i686-linux" "x86_64-linux" ];
license = licenses.gpl2;
};
meta = with lib; {
homepage = http://www.tvdr.de/;
description = "Video Disc Recorder";
maintainers = [ maintainers.ck3d ];
platforms = [ "i686-linux" "x86_64-linux" ];
license = licenses.gpl2;
}; };
in vdr // {
plugins = {
skincurses = (mkPlugin "skincurses").overrideAttrs(
oldAttr: { buildInputs = oldAttr.buildInputs ++ [ ncurses ]; });
} // (stdenv.lib.genAttrs [
"epgtableid0" "hello" "osddemo" "pictures" "servicedemo" "status" "svdrpdemo"
] mkPlugin);
} }

View File

@ -1,7 +1,24 @@
{ stdenv, fetchurl, fetchgit, vdr, ffmpeg_2, alsaLib, fetchFromGitHub { stdenv, fetchurl, fetchgit, vdr, ffmpeg_2, alsaLib, fetchFromGitHub
, libvdpau, libxcb, xcbutilwm, graphicsmagick, libav, pcre, xorgserver, ffmpeg , libvdpau, libxcb, xcbutilwm, graphicsmagick, libav, pcre, xorgserver, ffmpeg
, libiconv, boost, libgcrypt, perl, utillinux, groff, libva, xorg }: , libiconv, boost, libgcrypt, perl, utillinux, groff, libva, xorg, ncurses }:
{ let
mkPlugin = name: stdenv.mkDerivation {
name = "vdr-${vdr.version}-${name}";
inherit (vdr) src;
buildInputs = [ vdr ];
preConfigure = "cd PLUGINS/src/${name}";
installFlags = [ "DESTDIR=$(out)" ];
};
in {
skincurses = (mkPlugin "skincurses").overrideAttrs(oldAttr: {
buildInputs = oldAttr.buildInputs ++ [ ncurses ];
});
inherit (stdenv.lib.genAttrs [
"epgtableid0" "hello" "osddemo" "pictures" "servicedemo" "status" "svdrpdemo"
] mkPlugin);
femon = stdenv.mkDerivation rec { femon = stdenv.mkDerivation rec {
name = "vdr-femon-2.4.0"; name = "vdr-femon-2.4.0";

View File

@ -23547,7 +23547,7 @@ in
ghc-standalone-archive = callPackage ../os-specific/darwin/ghc-standalone-archive { inherit (darwin) cctools; }; ghc-standalone-archive = callPackage ../os-specific/darwin/ghc-standalone-archive { inherit (darwin) cctools; };
vdr = callPackage ../applications/video/vdr { }; vdr = callPackage ../applications/video/vdr { };
vdrPlugins = vdr.plugins // (recurseIntoAttrs (callPackages ../applications/video/vdr/plugins.nix { })); vdrPlugins = recurseIntoAttrs (callPackages ../applications/video/vdr/plugins.nix { });
wrapVdr = callPackage ../applications/video/vdr/wrapper.nix {}; wrapVdr = callPackage ../applications/video/vdr/wrapper.nix {};
chrome-gnome-shell = callPackage ../desktops/gnome-3/extensions/chrome-gnome-shell {}; chrome-gnome-shell = callPackage ../desktops/gnome-3/extensions/chrome-gnome-shell {};