Unverified Commit 4db0f100 authored by Gaétan Lepage's avatar Gaétan Lepage Committed by GitHub
Browse files

svp: 4.6.263 -> 4.7.305 (#455327)

parents 25bb08de 62f5b273
Loading
Loading
Loading
Loading
+28 −30
Original line number Diff line number Diff line
{
  stdenv,
  lib,
  buildFHSEnv,
  writeShellScriptBin,
  fetchurl,
  callPackage,
  makeDesktopItem,
  copyDesktopItems,
  ffmpeg,
  glibc,
  socat,
  jq,
  lib,
  kdePackages,
  ffmpeg,
  libmediainfo,
  libsForQt5,
  libusb1,
  ocl-icd,
  p7zip,
  patchelf,
  socat,
  vapoursynth,
  xdg-utils,
  xorg,
  zenity,
  systemdLibs,
  openssl,
  p7zip,
}:
let
  mpvForSVP = callPackage ./mpv.nix { };
@@ -39,49 +36,50 @@ let
    done
  '';

  # SVP expects findmnt to return path to storage device for software protection.
  # Workaround for tmp-as-root and encrypted root use cases, by returning first storage device on system.
  fakeFindmnt = writeShellScriptBin "findmnt" ''
    find /dev/ -name 'nvme*n*p*' -or -name 'sd*' -or -name 'vd*' 2>/dev/null | sort | head -n1
  '';

  libraries = [
    mpvForSVP
    fakeLsof
    fakeFindmnt
    (lib.getLib stdenv.cc.cc)
    kdePackages.qtbase
    kdePackages.qtdeclarative
    ffmpeg.bin
    glibc
    zenity
    libmediainfo
    libsForQt5.qtbase
    libsForQt5.qtwayland
    libsForQt5.qtdeclarative
    libsForQt5.qtscript
    libsForQt5.qtsvg
    libusb1
    mpvForSVP
    ocl-icd
    (lib.getLib stdenv.cc.cc)
    vapoursynth
    xdg-utils
    xorg.libX11
    systemdLibs
    openssl
  ];

  svp-dist = stdenv.mkDerivation rec {
  svp-dist = stdenv.mkDerivation (finalAttrs: {
    pname = "svp-dist";
    version = "4.6.263";
    version = "4.7.305";
    src = fetchurl {
      url = "https://www.svp-team.com/files/svp4-linux.${version}.tar.bz2";
      sha256 = "sha256-HyRDVFHVmTan/Si3QjGQpC3za30way10d0Hk79oXG98=";
      url = "https://www.svp-team.com/files/svp4-linux.${finalAttrs.version}.tar.bz2";
      hash = "sha256-PWAcm/hIA4JH2QtJPP+gSJdJLRdfdbZXIVdWELazbxQ=";
    };

    nativeBuildInputs = [
      p7zip
      patchelf
    ];
    dontFixup = true;

    unpackPhase = ''
      tar xf ${src}
      tar xf ${finalAttrs.src}
    '';

    buildPhase = ''
      mkdir installer
      LANG=C grep --only-matching --byte-offset --binary --text  $'7z\xBC\xAF\x27\x1C' "svp4-linux-64.run" |
      LANG=C grep --only-matching --byte-offset --binary --text  $'7z\xBC\xAF\x27\x1C' "svp4-linux.run" |
        cut -f1 -d: |
        while read ofs; do dd if="svp4-linux-64.run" bs=1M iflag=skip_bytes status=none skip=$ofs of="installer/bin-$ofs.7z"; done
        while read ofs; do dd if="svp4-linux.run" bs=1M iflag=skip_bytes status=none skip=$ofs of="installer/bin-$ofs.7z"; done
    '';

    installPhase = ''
@@ -96,7 +94,7 @@ let
      done
      rm -f $out/opt/{add,remove}-menuitem.sh
    '';
  };
  });

  fhs = buildFHSEnv {
    pname = "SVPManager";