about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/video/mediathekview/default.nix
blob: 6db16f1aec066bc144d6026c61a1b424dd17ed77 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
{ lib, stdenv, fetchurl, makeWrapper, libglvnd, libnotify, jre, zip }:

stdenv.mkDerivation rec {
  version = "14.0.0";
  pname = "mediathekview";
  src = fetchurl {
    url = "https://download.mediathekview.de/stabil/MediathekView-${version}-linux.tar.gz";
    sha256 = "sha256-vr0yqKVRodtXalHEIsm5gdEp9wPU9U5nnYhMk7IiPF4=";
  };


  nativeBuildInputs = [ makeWrapper zip ];

  installPhase =
  let
    libraryPath = lib.strings.makeLibraryPath [ libglvnd libnotify ];
  in
  ''
    runHook preInstall

    mkdir -p $out/{bin,lib}

    install -m644 MediathekView.jar $out/lib

    makeWrapper ${jre}/bin/java $out/bin/mediathek \
      --add-flags "-jar $out/lib/MediathekView.jar" \
      --suffix LD_LIBRARY_PATH : "${libraryPath}"

    makeWrapper ${jre}/bin/java $out/bin/MediathekView \
      --add-flags "-jar $out/lib/MediathekView.jar" \
      --suffix LD_LIBRARY_PATH : "${libraryPath}"

    makeWrapper ${jre}/bin/java $out/bin/MediathekView_ipv4 \
      --add-flags "-Djava.net.preferIPv4Stack=true -jar $out/lib/MediathekView.jar" \
      --suffix LD_LIBRARY_PATH : "${libraryPath}"

    runHook postInstall
  '';

  meta = with lib; {
    description = "Offers access to the Mediathek of different tv stations (ARD, ZDF, Arte, etc.)";
    homepage = "https://mediathekview.de/";
    sourceProvenance = with sourceTypes; [ binaryBytecode ];
    license = licenses.gpl3Plus;
    mainProgram = "mediathek";
    maintainers = with maintainers; [ moredread ];
    platforms = platforms.all;
  };
}