forked from mirrors/nixpkgs
jellyfin-web: init at 10.7.2
This commit is contained in:
parent
bd9341ff39
commit
7ab48fedf6
17
pkgs/servers/jellyfin/node-composition.nix
Normal file
17
pkgs/servers/jellyfin/node-composition.nix
Normal file
|
@ -0,0 +1,17 @@
|
|||
# This file has been generated by node2nix 1.9.0. Do not edit!
|
||||
|
||||
{pkgs ? import <nixpkgs> {
|
||||
inherit system;
|
||||
}, system ? builtins.currentSystem, nodejs ? pkgs."nodejs-12_x"}:
|
||||
|
||||
let
|
||||
nodeEnv = import ../../development/node-packages/node-env.nix {
|
||||
inherit (pkgs) stdenv lib python2 runCommand writeTextFile;
|
||||
inherit pkgs nodejs;
|
||||
libtool = if pkgs.stdenv.isDarwin then pkgs.darwin.cctools else null;
|
||||
};
|
||||
in
|
||||
import ./node-deps.nix {
|
||||
inherit (pkgs) fetchurl nix-gitignore stdenv lib fetchgit;
|
||||
inherit nodeEnv;
|
||||
}
|
13609
pkgs/servers/jellyfin/node-deps.nix
Normal file
13609
pkgs/servers/jellyfin/node-deps.nix
Normal file
File diff suppressed because it is too large
Load diff
30
pkgs/servers/jellyfin/web-update.sh
Executable file
30
pkgs/servers/jellyfin/web-update.sh
Executable file
|
@ -0,0 +1,30 @@
|
|||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i bash -p curl common-updater-scripts nodePackages.node2nix gnused nix coreutils jq
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
latestVersion="$(curl -s "https://api.github.com/repos/jellyfin/jellyfin-web/releases?per_page=1" | jq -r ".[0].tag_name" | sed 's/^v//')"
|
||||
currentVersion=$(nix-instantiate --eval -E "with import ./. {}; jellyfin-web.version or (lib.getVersion jellyfin-web)" | tr -d '"')
|
||||
|
||||
if [[ "$currentVersion" == "$latestVersion" ]]; then
|
||||
echo "jellyfin-web is up-to-date: $currentVersion"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
update-source-version jellyfin-web 0 0000000000000000000000000000000000000000000000000000000000000000
|
||||
update-source-version jellyfin-web "$latestVersion"
|
||||
|
||||
# use patched source
|
||||
store_src="$(nix-build . -A jellyfin-web.src --no-out-link)"
|
||||
|
||||
cd "$(dirname "${BASH_SOURCE[0]}")"
|
||||
|
||||
# TODO: use package-lock.json on the next major release
|
||||
# https://github.com/jellyfin/jellyfin-web/commit/6efef9680d55a93f4333ef8bfb65a8a650c99a49
|
||||
node2nix \
|
||||
--nodejs-12 \
|
||||
--development \
|
||||
--node-env ../../development/node-packages/node-env.nix \
|
||||
--output ./node-deps.nix \
|
||||
--input "$store_src/package.json" \
|
||||
--composition ./node-composition.nix
|
81
pkgs/servers/jellyfin/web.nix
Normal file
81
pkgs/servers/jellyfin/web.nix
Normal file
|
@ -0,0 +1,81 @@
|
|||
{ lib
|
||||
, fetchFromGitHub
|
||||
, pkgs
|
||||
, stdenv
|
||||
, nodejs
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "jellyfin-web";
|
||||
version = "10.7.2";
|
||||
# TODO: on the next major release remove src.postFetch
|
||||
# and use the lock file in web-update.sh:
|
||||
# https://github.com/jellyfin/jellyfin-web/commit/6efef9680d55a93f4333ef8bfb65a8a650c99a49
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "jellyfin";
|
||||
repo = "jellyfin-web";
|
||||
rev = "v${version}";
|
||||
sha256 = "0LvHb+nX8Zrp5gWo0zFskVH8HjnaDKx3eSijXdqqaXk=";
|
||||
postFetch = ''
|
||||
mkdir -p $out
|
||||
cd $out
|
||||
tar -xzf $downloadedFile --strip-components=1
|
||||
|
||||
# replace unsupported dependency url
|
||||
# https://github.com/svanderburg/node2nix/issues/163
|
||||
substituteInPlace package.json \
|
||||
--replace \
|
||||
"https://github.com/jellyfin/JavascriptSubtitlesOctopus#4.0.0-jf-smarttv" \
|
||||
"https://github.com/jellyfin/JavascriptSubtitlesOctopus/archive/refs/tags/4.0.0-jf-smarttv.tar.gz"
|
||||
'';
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
nodejs
|
||||
];
|
||||
|
||||
buildPhase =
|
||||
let
|
||||
nodeDependencies = ((import ./node-composition.nix {
|
||||
inherit pkgs nodejs;
|
||||
inherit (stdenv.hostPlatform) system;
|
||||
}).nodeDependencies.override (old: {
|
||||
# access to path '/nix/store/...-source' is forbidden in restricted mode
|
||||
src = src;
|
||||
|
||||
# dont run the prepare script:
|
||||
# Error: Cannot find module '/nix/store/...-node-dependencies-jellyfin-web-.../jellyfin-web/scripts/prepare.js
|
||||
# npm run build:production runs the same command
|
||||
dontNpmInstall = true;
|
||||
}));
|
||||
in
|
||||
''
|
||||
runHook preBuild
|
||||
|
||||
ln -s ${nodeDependencies}/lib/node_modules ./node_modules
|
||||
export PATH="${nodeDependencies}/bin:$PATH"
|
||||
|
||||
npm run build:production
|
||||
|
||||
runHook postBuild
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
mkdir -p $out/share
|
||||
cp -a dist $out/share/jellyfin-web
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
passthru.updateScript = ./web-update.sh;
|
||||
|
||||
meta = with lib; {
|
||||
description = "Web Client for Jellyfin";
|
||||
homepage = "https://jellyfin.org/";
|
||||
license = licenses.gpl2Plus;
|
||||
maintainers = with maintainers; [ nyanloutre minijackson purcell jojosch ];
|
||||
};
|
||||
}
|
|
@ -2750,6 +2750,8 @@ in
|
|||
|
||||
jellyfin-mpv-shim = python3Packages.callPackage ../applications/video/jellyfin-mpv-shim { };
|
||||
|
||||
jellyfin-web = callPackage ../servers/jellyfin/web.nix { };
|
||||
|
||||
jiten = callPackage ../applications/misc/jiten { };
|
||||
|
||||
jotta-cli = callPackage ../applications/misc/jotta-cli { };
|
||||
|
|
Loading…
Reference in a new issue