btrbk: add mainProgram (#356350)
[NixPkgs.git] / pkgs / by-name / je / jellyfin-web / package.nix
blob6cfa106b603c1ebf9a4528f4b4e9d11eee69ef91
2   lib,
3   stdenv,
4   fetchFromGitHub,
5   buildNpmPackage,
6   nix-update-script,
7   pkg-config,
8   xcbuild,
9   pango,
10   giflib,
11   apple-sdk_11,
12   darwinMinVersionHook,
13   jellyfin,
15 buildNpmPackage rec {
16   pname = "jellyfin-web";
17   version = "10.10.1";
19   src =
20     assert version == jellyfin.version;
21     fetchFromGitHub {
22       owner = "jellyfin";
23       repo = "jellyfin-web";
24       rev = "v${version}";
25       hash = "sha256-+f+chR00eDCVZvAGNDB61c0htsVvqFK62oZorW3Qdsg=";
26     };
28   postPatch = ''
29     substituteInPlace webpack.common.js \
30       --replace-fail "git describe --always --dirty" "echo ${src.rev}" \
31   '';
33   npmDepsHash = "sha256-kL57KmBHmBwJEhsUciPaj826qdoSQxZXxtFNGkddGZk=";
35   preBuild = ''
36     # using sass-embedded fails at executing node_modules/sass-embedded-linux-x64/dart-sass/src/dart
37     rm -r node_modules/sass-embedded*
38   '';
40   npmBuildScript = [ "build:production" ];
42   nativeBuildInputs = [ pkg-config ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ xcbuild ];
44   buildInputs =
45     [ pango ]
46     ++ lib.optionals stdenv.hostPlatform.isDarwin [
47       giflib
48       apple-sdk_11
49       # node-canvas builds code that requires aligned_alloc,
50       # which on Darwin requires at least the 10.15 SDK
51       (darwinMinVersionHook "10.15")
52     ];
54   installPhase = ''
55     runHook preInstall
57     mkdir -p $out/share
58     cp -a dist $out/share/jellyfin-web
60     runHook postInstall
61   '';
63   passthru.updateScript = nix-update-script { };
65   meta = with lib; {
66     description = "Web Client for Jellyfin";
67     homepage = "https://jellyfin.org/";
68     license = licenses.gpl2Plus;
69     maintainers = with maintainers; [
70       nyanloutre
71       minijackson
72       purcell
73       jojosch
74     ];
75   };