about summary refs log tree commit diff
path: root/pkgs/by-name/nw/nwjs-ffmpeg-prebuilt/package.nix
blob: e0d721fd352ec5ae43aa7adb62b967f73e7a7450 (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
50
51
52
53
54
{
  lib,
  stdenv,
  fetchurl,
  unzip,
}:

let
  bits = if stdenv.is64bit then "x64" else "ia32";
  version = "0.91.0";
in
stdenv.mkDerivation {
  pname = "nwjs-ffmpeg-prebuilt";
  inherit version;

  src =
    let
      hashes = {
        "x64" = "sha256-C6ZOY+oFyWYqLvpYmM9KnQ3B7y0JAXp4SbeNBYvcUe0=";
        "ia32" = "sha256-C6ZOY+oFyWYqLvpYmM9KnQ3B7y0JAXp4SbeNBYvcUe0=";
      };
    in
    fetchurl {
      url = "https://github.com/nwjs-ffmpeg-prebuilt/nwjs-ffmpeg-prebuilt/releases/download/${version}/${version}-linux-${bits}.zip";
      hash = hashes.${bits};
    };
  sourceRoot = ".";

  nativeBuildInputs = [ unzip ];

  installPhase = ''
    runHook preInstall

    mkdir -p $out/lib
    cp -R libffmpeg.so $out/lib/

    runHook postInstall
  '';

  meta = {
    description = "An app runtime based on Chromium and node.js";
    homepage = "https://nwjs.io/";
    platforms = [
      "i686-linux"
      "x86_64-linux"
    ];
    sourceProvenance = [ lib.sourceTypes.binaryNativeCode ];
    maintainers = with lib.maintainers; [
      ilya-epifanov
      mikaelfangel
    ];
    license = lib.licenses.gpl2Plus;
  };
}