Merge pull request #221539 from Stunkymonkey/ariang-init-1.3.3
This commit is contained in:
commit
6b9fecdb2d
5 changed files with 10614 additions and 0 deletions
61
pkgs/servers/ariang/default.nix
Normal file
61
pkgs/servers/ariang/default.nix
Normal file
|
@ -0,0 +1,61 @@
|
||||||
|
{ lib
|
||||||
|
, stdenv
|
||||||
|
, pkgs
|
||||||
|
, fetchFromGitHub
|
||||||
|
, nodejs ? pkgs.nodejs-14_x
|
||||||
|
}:
|
||||||
|
|
||||||
|
stdenv.mkDerivation rec {
|
||||||
|
pname = "ariang";
|
||||||
|
version = "1.3.3";
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "mayswind";
|
||||||
|
repo = "AriaNg";
|
||||||
|
rev = version;
|
||||||
|
hash = "sha256-kh2XdsrZhR0i+vUhTrzXu5z5Ahv9otNEEjqlCUnVmqE=";
|
||||||
|
};
|
||||||
|
|
||||||
|
buildPhase =
|
||||||
|
let
|
||||||
|
nodePackages = import ./node-composition.nix {
|
||||||
|
inherit pkgs nodejs;
|
||||||
|
inherit (stdenv.hostPlatform) system;
|
||||||
|
};
|
||||||
|
nodeDependencies = (nodePackages.shell.override (old: {
|
||||||
|
# access to path '/nix/store/...-source' is forbidden in restricted mode
|
||||||
|
src = src;
|
||||||
|
# Error: Cannot find module '/nix/store/...-node-dependencies
|
||||||
|
dontNpmInstall = true;
|
||||||
|
})).nodeDependencies;
|
||||||
|
in
|
||||||
|
''
|
||||||
|
runHook preBuild
|
||||||
|
|
||||||
|
ln -s ${nodeDependencies}/lib/node_modules ./node_modules
|
||||||
|
${nodeDependencies}/bin/gulp clean build
|
||||||
|
|
||||||
|
runHook postBuild
|
||||||
|
'';
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
runHook preInstall
|
||||||
|
|
||||||
|
mkdir -p $out/share
|
||||||
|
cp -r dist $out/share/ariang
|
||||||
|
|
||||||
|
runHook postInstall
|
||||||
|
'';
|
||||||
|
|
||||||
|
passthru.updateScript = ./update.sh;
|
||||||
|
|
||||||
|
meta = with lib; {
|
||||||
|
description = "a modern web frontend making aria2 easier to use";
|
||||||
|
homepage = "http://ariang.mayswind.net/";
|
||||||
|
license = licenses.mit;
|
||||||
|
maintainers = with maintainers; [ stunkymonkey ];
|
||||||
|
platforms = platforms.unix;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
17
pkgs/servers/ariang/node-composition.nix
Normal file
17
pkgs/servers/ariang/node-composition.nix
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
# 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_x"}:
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
10503
pkgs/servers/ariang/node-deps.nix
Normal file
10503
pkgs/servers/ariang/node-deps.nix
Normal file
File diff suppressed because it is too large
Load diff
31
pkgs/servers/ariang/update.sh
Executable file
31
pkgs/servers/ariang/update.sh
Executable file
|
@ -0,0 +1,31 @@
|
||||||
|
#!/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/mayswind/ariang/releases?per_page=1" | jq -r ".[0].tag_name" | sed 's/^v//')"
|
||||||
|
currentVersion=$(nix-instantiate --eval -E "with import ./. {}; ariang.version or (lib.getVersion ariang)" | tr -d '"')
|
||||||
|
|
||||||
|
if [[ "$currentVersion" == "$latestVersion" ]]; then
|
||||||
|
echo "ariang is up-to-date: $currentVersion"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
update-source-version ariang 0 0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
update-source-version ariang "$latestVersion"
|
||||||
|
|
||||||
|
# use patched source
|
||||||
|
store_src="$(nix-build . -A ariang.src --no-out-link)"
|
||||||
|
echo $store_src
|
||||||
|
|
||||||
|
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 \
|
||||||
|
;
|
|
@ -246,6 +246,8 @@ with pkgs;
|
||||||
python3 = python39;
|
python3 = python39;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
ariang = callPackage ../servers/ariang { };
|
||||||
|
|
||||||
mov-cli = callPackage ../applications/video/mov-cli { };
|
mov-cli = callPackage ../applications/video/mov-cli { };
|
||||||
|
|
||||||
ani-cli = callPackage ../applications/video/ani-cli { };
|
ani-cli = callPackage ../applications/video/ani-cli { };
|
||||||
|
|
Loading…
Reference in a new issue