-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7dbfd6b
commit 1b1684c
Showing
5 changed files
with
8,423 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
}; | ||
} |
18 changes: 18 additions & 0 deletions
18
pkgs/applications/audio/open-stage-control/generate-dependencies.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
17
pkgs/applications/audio/open-stage-control/node-composition.nix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
Oops, something went wrong.