mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-02 11:53:27 +00:00
open-stage-control: 1.18.3 -> 1.20.0
This commit is contained in:
parent
94191b60f1
commit
8819f6338b
@ -1,29 +1,26 @@
|
||||
{ pkgs, stdenv, lib, fetchFromGitHub, makeBinaryWrapper, makeDesktopItem, copyDesktopItems, nodejs, electron, python3, ... }:
|
||||
{ lib, buildNpmPackage, fetchFromGitHub, makeBinaryWrapper, makeDesktopItem, copyDesktopItems, electron, python3 }:
|
||||
|
||||
let
|
||||
nodeComposition = import ./node-composition.nix {
|
||||
inherit pkgs nodejs;
|
||||
inherit (stdenv.hostPlatform) system;
|
||||
};
|
||||
in
|
||||
|
||||
nodeComposition.package.override rec {
|
||||
buildNpmPackage rec {
|
||||
pname = "open-stage-control";
|
||||
version = "1.18.3";
|
||||
version = "1.20.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "jean-emmanuel";
|
||||
repo = "open-stage-control";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-AXdPxTauy2rMRMdfUjkfTjbNDgOKmoiGUeeLak0wu84=";
|
||||
hash = "sha256-XgwlRdwUSl4gIRKqk6BnMAKarVvp291zk8vmNkuRWKo=";
|
||||
};
|
||||
|
||||
strictDeps = true;
|
||||
patches = [
|
||||
# Use generated package-lock.json since upstream does not provide one in releases
|
||||
./package-lock.json.patch
|
||||
];
|
||||
|
||||
npmDepsHash = "sha256-UF3pZ+SlrgDLqntciXRNbWfpPMtQw1DXl41x9r37QN4=";
|
||||
|
||||
nativeBuildInputs = [
|
||||
copyDesktopItems
|
||||
makeBinaryWrapper
|
||||
nodejs
|
||||
python3
|
||||
];
|
||||
|
||||
@ -33,14 +30,19 @@ nodeComposition.package.override rec {
|
||||
|
||||
doInstallCheck = true;
|
||||
|
||||
preRebuild = ''
|
||||
# remove electron to prevent building since nixpkgs electron is used instead
|
||||
rm -r node_modules/electron
|
||||
'';
|
||||
makeCacheWritable = true;
|
||||
npmFlags = [ "--legacy-peer-deps" ];
|
||||
|
||||
postInstall = ''
|
||||
# build assets
|
||||
npm run build
|
||||
# Override installPhase so we can copy the only folders that matter (app and node_modules)
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
# prune unused deps
|
||||
npm prune --omit dev $npmFlags
|
||||
|
||||
# copy built app and node_modules directories
|
||||
mkdir -p $out/lib/node_modules/open-stage-control
|
||||
cp -r app node_modules $out/lib/node_modules/open-stage-control/
|
||||
|
||||
# copy icon
|
||||
install -Dm644 resources/images/logo.png $out/share/icons/hicolor/256x256/apps/open-stage-control.png
|
||||
@ -52,6 +54,8 @@ nodeComposition.package.override rec {
|
||||
--add-flags $out/lib/node_modules/open-stage-control/app \
|
||||
--prefix PYTHONPATH : "$PYTHONPATH" \
|
||||
--prefix PATH : '${lib.makeBinPath [ python3 ]}'
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
installCheckPhase = ''
|
||||
|
@ -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-16_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-packages.nix {
|
||||
inherit (pkgs) fetchurl nix-gitignore stdenv lib fetchgit;
|
||||
inherit nodeEnv;
|
||||
}
|
9220
pkgs/applications/audio/open-stage-control/node-packages.nix
generated
9220
pkgs/applications/audio/open-stage-control/node-packages.nix
generated
File diff suppressed because it is too large
Load Diff
18247
pkgs/applications/audio/open-stage-control/package-lock.json.patch
Normal file
18247
pkgs/applications/audio/open-stage-control/package-lock.json.patch
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,25 +1,63 @@
|
||||
#!/usr/bin/env nix-shell
|
||||
#! nix-shell -i bash -p common-updater-scripts jq nodePackages.node2nix
|
||||
#! nix-shell -i bash -p common-updater-scripts jq nodejs
|
||||
set -euo pipefail
|
||||
|
||||
# Find nixpkgs repo
|
||||
nixpkgs="$(git rev-parse --show-toplevel || (printf 'Could not find root of nixpkgs repo\nAre we running from within the nixpkgs git repo?\n' >&2; exit 1))"
|
||||
|
||||
# Get latest release tag
|
||||
tag="$(curl -s https://api.github.com/repos/jean-emmanuel/open-stage-control/releases/latest | jq -r .tag_name)"
|
||||
stripwhitespace() {
|
||||
sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//'
|
||||
}
|
||||
|
||||
nixeval() {
|
||||
nix --extra-experimental-features nix-command eval --json --impure -f "$nixpkgs" "$1" | jq -r .
|
||||
}
|
||||
|
||||
vendorhash() {
|
||||
(nix --extra-experimental-features nix-command build --impure -f "$nixpkgs" --no-link "$1" 2>&1 >/dev/null | tail -n3 | grep -F got: | cut -d: -f2- | stripwhitespace) 2>/dev/null || true
|
||||
}
|
||||
|
||||
findpath() {
|
||||
path="$(nix --extra-experimental-features nix-command eval --json --impure -f "$nixpkgs" "$1.meta.position" | jq -r . | cut -d: -f1)"
|
||||
outpath="$(nix --extra-experimental-features nix-command eval --json --impure --expr "builtins.fetchGit \"$nixpkgs\"")"
|
||||
|
||||
if [ -n "$outpath" ]; then
|
||||
path="${path/$(echo "$outpath" | jq -r .)/$nixpkgs}"
|
||||
fi
|
||||
|
||||
echo "$path"
|
||||
}
|
||||
|
||||
attr="${UPDATE_NIX_ATTR_PATH:-open-stage-control}"
|
||||
version="$(cd "$nixpkgs" && list-git-tags --pname="$(nixeval "$attr".pname)" --attr-path="$attr" | grep '^v' | sed -e 's|^v||' | sort -V | tail -n1)"
|
||||
|
||||
pkgpath="$(findpath "$attr")"
|
||||
pkgdir="$(dirname "$pkgpath")"
|
||||
|
||||
updated="$(cd "$nixpkgs" && update-source-version "$attr" "$version" --file="$pkgpath" --print-changes | jq -r length)"
|
||||
|
||||
if [ "$updated" -eq 0 ]; then
|
||||
echo 'update.sh: Package version not updated, nothing to do.'
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Download package.json from the latest release
|
||||
curl -sSL https://raw.githubusercontent.com/jean-emmanuel/open-stage-control/"$tag"/package.json | grep -v '"electron"\|"electron-installer-debian"' >"$nixpkgs"/pkgs/applications/audio/open-stage-control/package.json
|
||||
curl -sSL https://raw.githubusercontent.com/jean-emmanuel/open-stage-control/v"$version"/package.json | grep -v '"electron"\|"electron-installer-debian"' >"$pkgdir"/package.json
|
||||
|
||||
# Lock dependencies with node2nix
|
||||
node2nix \
|
||||
--node-env "$nixpkgs"/pkgs/development/node-packages/node-env.nix \
|
||||
--nodejs-16 \
|
||||
--input "$nixpkgs"/pkgs/applications/audio/open-stage-control/package.json \
|
||||
--output "$nixpkgs"/pkgs/applications/audio/open-stage-control/node-packages.nix \
|
||||
--composition "$nixpkgs"/pkgs/applications/audio/open-stage-control/node-composition.nix
|
||||
# Lock dependencies with npm
|
||||
(cd "$pkgdir" && npm install --package-lock-only --ignore-scripts --legacy-peer-deps)
|
||||
|
||||
rm -f "$nixpkgs"/pkgs/applications/audio/open-stage-control/package.json
|
||||
# Turn lock file into patch file
|
||||
(cd "$pkgdir" && (diff -u /dev/null ./package-lock.json || [ $? -eq 1 ])) >"$pkgdir"/package-lock.json.patch
|
||||
|
||||
# Update hash
|
||||
(cd "$nixpkgs" && update-source-version "${UPDATE_NIX_ATTR_PATH:-open-stage-control}" "${tag#v}")
|
||||
rm -f "$pkgdir"/{package.json,package-lock.json}
|
||||
|
||||
# Update FOD hash
|
||||
curhash="$(nixeval "$attr.npmDeps.outputHash")"
|
||||
newhash="$(vendorhash "$attr.npmDeps")"
|
||||
|
||||
if [ -n "$newhash" ] && [ "$curhash" != "$newhash" ]; then
|
||||
sed -i -e "s|\"$curhash\"|\"$newhash\"|" "$pkgpath"
|
||||
else
|
||||
echo 'update.sh: New npmDepsHash same as old npmDepsHash, nothing to do.'
|
||||
fi
|
||||
|
@ -31016,10 +31016,7 @@ with pkgs;
|
||||
|
||||
openscad = libsForQt5.callPackage ../applications/graphics/openscad {};
|
||||
|
||||
open-stage-control = callPackage ../applications/audio/open-stage-control {
|
||||
electron = electron_15;
|
||||
nodejs = nodejs-16_x;
|
||||
};
|
||||
open-stage-control = callPackage ../applications/audio/open-stage-control { };
|
||||
|
||||
opentimestamps-client = python3Packages.callPackage ../tools/misc/opentimestamps-client {};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user