Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

open-stage-control: init at 1.17.0 #170464

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions pkgs/applications/audio/open-stage-control/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{ pkgs, stdenv, lib, fetchFromGitHub, makeBinaryWrapper, makeDesktopItem, copyDesktopItems, nodejs, electron, python3, ... }:

let
nodeComposition = import ./node-composition.nix {
inherit pkgs nodejs;
inherit (stdenv.hostPlatform) system;
};
in

nodeComposition.package.override rec {
pname = "open-stage-control";
inherit (nodeComposition.args) version;

src = fetchFromGitHub {
owner = "jean-emmanuel";
repo = "open-stage-control";
rev = "v${version}";
hash = "sha256-q18pRtsHfme+OPmi3LhJDK1AdpfkwhoE9LA2rNenDtY=";
};

nativeBuildInputs = [
copyDesktopItems
makeBinaryWrapper
];

buildInputs = [
python3.pkgs.python-rtmidi
];

dontNpmInstall = true;

postInstall = ''
# build assets
npm run build

# copy icon
install -Dm644 resources/images/logo.png $out/share/icons/hicolor/256x256/apps/open-stage-control.png
install -Dm644 resources/images/logo.svg $out/share/icons/hicolor/scalable/apps/open-stage-control.svg

# wrap electron and include python-rtmidi
makeWrapper '${electron}/bin/electron' $out/bin/open-stage-control \
--inherit-argv0 \
--add-flags $out/lib/node_modules/open-stage-control/app \
--prefix PYTHONPATH : "$PYTHONPATH" \
--prefix PATH : '${lib.makeBinPath [ python3 ]}'
'';

installCheckPhase = ''
XDG_CONFIG_HOME="$(mktemp -d)" $out/bin/open-stage-control --help
'';
doInstallCheck = true;

desktopItems = [
(makeDesktopItem {
name = "open-stage-control";
exec = "open-stage-control";
icon = "open-stage-control";
desktopName = "Open Stage Control";
comment = meta.description;
categories = [ "Network" "Audio" "AudioVideo" "Midi" ];
startupWMClass = "open-stage-control";
})
];

meta = with lib; {
description = "Libre and modular OSC / MIDI controller";
homepage = "https://openstagecontrol.ammd.net/";
license = licenses.gpl3Only;
maintainers = with maintainers; [ lilyinstarlight ];
platforms = platforms.linux;
};
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env nix-shell
#! nix-shell -i bash -p jq nodePackages.node2nix

# Get latest release tag
tag="$(curl -s https://api.github.com/repos/jean-emmanuel/open-stage-control/releases/latest | jq -r .tag_name)"

# Download package.json from the latest release
curl -s https://raw.githubusercontent.com/jean-emmanuel/open-stage-control/"$tag"/package.json | grep -v '"electron"\|"electron-installer-debian"\|"electron-packager"\|"electron-packager-plugin-non-proprietary-codecs-ffmpeg"' >package.json

# Lock dependencies with node2nix
node2nix \
--node-env ../../../development/node-packages/node-env.nix \
--nodejs-16 \
--input package.json \
--output node-packages.nix \
--composition node-composition.nix

rm -f package.json
17 changes: 17 additions & 0 deletions pkgs/applications/audio/open-stage-control/node-composition.nix
Original file line number Diff line number Diff line change
@@ -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-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;
}
Loading