mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-19 20:21:14 +00:00
Merge pull request #230944 from Stunkymonkey/ariang-1.3.5
ariang: 1.3.4 -> 1.3.5
This commit is contained in:
commit
326bad7af5
|
@ -1,42 +1,24 @@
|
|||
{ lib ? pkgs.lib
|
||||
{ lib
|
||||
, stdenv
|
||||
, pkgs
|
||||
, fetchFromGitHub
|
||||
, nodejs ? pkgs.nodejs_18
|
||||
, buildNpmPackage
|
||||
, nix-update-script
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
buildNpmPackage rec {
|
||||
pname = "ariang";
|
||||
version = "1.3.4";
|
||||
version = "1.3.5";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "mayswind";
|
||||
repo = "AriaNg";
|
||||
rev = version;
|
||||
hash = "sha256-jprx1JIh+Q0Cv2NkLj9dMnGr+nR/0T08N02gXGknC1Q=";
|
||||
hash = "sha256-Ki9W66ITdunxU+HQWVf2pG+BROlYFYUJSAySC8wsJRo=";
|
||||
};
|
||||
|
||||
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
|
||||
npmDepsHash = "sha256-FyIQinOQDJ+k612z/qkl3KW0z85sswRhQCbF6N63z8Y=";
|
||||
|
||||
ln -s ${nodeDependencies}/lib/node_modules ./node_modules
|
||||
${nodeDependencies}/bin/gulp clean build
|
||||
|
||||
runHook postBuild
|
||||
'';
|
||||
makeCacheWritable = true;
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
@ -47,7 +29,7 @@ stdenv.mkDerivation rec {
|
|||
runHook postInstall
|
||||
'';
|
||||
|
||||
passthru.updateScript = ./update.sh;
|
||||
passthru.updateScript = nix-update-script {};
|
||||
|
||||
meta = with lib; {
|
||||
description = "a modern web frontend making aria2 easier to use";
|
||||
|
|
|
@ -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-18_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;
|
||||
}
|
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/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 sha256-0000000000000000000000000000000000000000000=
|
||||
update-source-version ariang "$latestVersion"
|
||||
|
||||
# use patched source
|
||||
store_src="$(nix-build . -A ariang.src --no-out-link)"
|
||||
|
||||
cd "$(dirname "${BASH_SOURCE[0]}")"
|
||||
|
||||
node2nix \
|
||||
--nodejs-18 \
|
||||
--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
|
Loading…
Reference in a new issue