evcc: 0.131.4 -> 0.131.5
[NixPkgs.git] / pkgs / by-name / vl / vlc-bin / package.nix
blob9e496883ccb8c30facfa4e66e5ce496e4a3c97b6
1 { lib
2 , fetchurl
3 , makeWrapper
4 , stdenv
5 , undmg
6 , variant ?
7   if (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64)
8   then "arm64"
9   else if (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64)
10   then "intel64"
11   else "universal" # not reachable by normal means
14 assert builtins.elem variant [ "arm64" "intel64" "universal" ];
15 stdenv.mkDerivation (finalAttrs: {
16   pname = "vlc-bin-${variant}";
17   version = "3.0.21";
19   src = fetchurl {
20     url = "http://get.videolan.org/vlc/${finalAttrs.version}/macosx/vlc-${finalAttrs.version}-${variant}.dmg";
21     hash = {
22       "arm64" = "sha256-Fd1lv2SJ2p7Gpn9VhcdMQKWJk6z/QagpWKkW3XQXgEQ=";
23       "intel64" = "sha256-1DH9BRw9x68CvTE8bQXZDPYEtw7T7Fu6b9TEnvPmONk=";
24       "universal" = "sha256-UDgOVvgdYw41MUJqJlq/iz3ubAgiu3yeMLUyx9aaZcA=";
25     }.${variant};
26   };
28   sourceRoot = ".";
30   nativeBuildInputs = [
31     makeWrapper
32     undmg
33   ];
35   installPhase = ''
36     runHook preInstall
38     mkdir -p $out/Applications $out/bin
39     cp -r "VLC.app" $out/Applications
40     makeWrapper "$out/Applications/VLC.app/Contents/MacOS/VLC" "$out/bin/vlc"
42     runHook postInstall
43   '';
45   meta = {
46     description = "Cross-platform media player and streaming server; precompiled binary for MacOS, repacked from official website";
47     homepage = "https://www.videolan.org/vlc/";
48     downloadPage = "https://www.videolan.org/vlc/download-macosx.html";
49     license = lib.licenses.lgpl21Plus;
50     mainProgram = "vlc";
51     maintainers = with lib.maintainers; [ pcasaretto ];
52     platforms = lib.systems.inspect.patternLogicalAnd
53       (lib.systems.inspect.patterns.isDarwin)
54       (({
55         "arm64" = lib.systems.inspect.patterns.isAarch64;
56         "intel64" = lib.systems.inspect.patterns.isx86_64;
57         "universal" = lib.systems.inspect.patterns.isDarwin;
58       }).${variant});
59     sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
60   };