jellyfin-web: use buildNpmPackage
This commit is contained in:
parent
c5973e7f6e
commit
8708d52e31
|
@ -1,17 +0,0 @@
|
||||||
# This file has been generated by node2nix 1.11.1. Do not edit!
|
|
||||||
|
|
||||||
{pkgs ? import <nixpkgs> {
|
|
||||||
inherit system;
|
|
||||||
}, system ? builtins.currentSystem, nodejs ? pkgs."nodejs_14"}:
|
|
||||||
|
|
||||||
let
|
|
||||||
nodeEnv = import ../../development/node-packages/node-env.nix {
|
|
||||||
inherit (pkgs) stdenv lib python2 runCommand writeTextFile writeShellScript;
|
|
||||||
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;
|
|
||||||
}
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,29 +0,0 @@
|
||||||
#!/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]}")"
|
|
||||||
|
|
||||||
node2nix \
|
|
||||||
--nodejs-14 \
|
|
||||||
--development \
|
|
||||||
--node-env ../../development/node-packages/node-env.nix \
|
|
||||||
--output ./node-deps.nix \
|
|
||||||
--input "$store_src/package.json" \
|
|
||||||
--lock "$store_src/package-lock.json" \
|
|
||||||
--composition ./node-composition.nix
|
|
|
@ -1,11 +1,11 @@
|
||||||
{ lib
|
{ lib
|
||||||
, fetchFromGitHub
|
, fetchFromGitHub
|
||||||
, pkgs
|
|
||||||
, stdenv
|
, stdenv
|
||||||
, nodejs
|
, buildNpmPackage
|
||||||
|
, nix-update-script
|
||||||
}:
|
}:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
buildNpmPackage rec {
|
||||||
pname = "jellyfin-web";
|
pname = "jellyfin-web";
|
||||||
version = "10.8.10";
|
version = "10.8.10";
|
||||||
|
|
||||||
|
@ -13,38 +13,12 @@ stdenv.mkDerivation rec {
|
||||||
owner = "jellyfin";
|
owner = "jellyfin";
|
||||||
repo = "jellyfin-web";
|
repo = "jellyfin-web";
|
||||||
rev = "v${version}";
|
rev = "v${version}";
|
||||||
sha256 = "fJmGiHLwhgd3Ac7ggCbkMu6llob3qN87EpHpCO4K29I=";
|
hash = "sha256-fJmGiHLwhgd3Ac7ggCbkMu6llob3qN87EpHpCO4K29I=";
|
||||||
};
|
};
|
||||||
|
|
||||||
nativeBuildInputs = [
|
npmDepsHash = "sha256-X8a/pmQGAhoGKhThJ86b50sf0nlsCXGgvLQaxRsmA5Q=";
|
||||||
nodejs
|
|
||||||
];
|
|
||||||
|
|
||||||
buildPhase =
|
npmBuildScript = [ "build:production" ];
|
||||||
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 = ''
|
installPhase = ''
|
||||||
runHook preInstall
|
runHook preInstall
|
||||||
|
@ -55,13 +29,12 @@ stdenv.mkDerivation rec {
|
||||||
runHook postInstall
|
runHook postInstall
|
||||||
'';
|
'';
|
||||||
|
|
||||||
passthru.updateScript = ./web-update.sh;
|
passthru.updateScript = nix-update-script {};
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
description = "Web Client for Jellyfin";
|
description = "Web Client for Jellyfin";
|
||||||
homepage = "https://jellyfin.org/";
|
homepage = "https://jellyfin.org/";
|
||||||
license = licenses.gpl2Plus;
|
license = licenses.gpl2Plus;
|
||||||
maintainers = with maintainers; [ nyanloutre minijackson purcell jojosch ];
|
maintainers = with maintainers; [ nyanloutre minijackson purcell jojosch ];
|
||||||
platforms = nodejs.meta.platforms;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue