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

neothesia: init at unstable-2024-07-21 #256882

Closed
wants to merge 1 commit into from
Closed
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
86 changes: 86 additions & 0 deletions pkgs/applications/audio/neothesia/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
{ lib
, rustPlatform
, fetchFromGitHub
, cli ? false
, pkg-config
, alsa-lib
, wrapGAppsHook
, ffmpeg-full
, makeWrapper

Check failure on line 9 in pkgs/applications/audio/neothesia/default.nix

View workflow job for this annotation

GitHub Actions / nixos

sema-def-not-used

definition `makeWrapper` is not used
, libxkbcommon
, libGL
, wayland
}:

rustPlatform.buildRustPackage rec {
pname = "neothesia" + (lib.optionalString cli "-cli");
version = "unstable-2024-07-21";

src = fetchFromGitHub {
owner = "PolyMeilex";
repo = "Neothesia";
rev = "b29030a117badeb9891971261b857deca9cf91f2";
hash = "sha256-7HLIfxd7k9RMccTxuH5MBQc9o9ynbWDrJbNjD3wMCL4=";
};

nativeBuildInputs = [
pkg-config
wrapGAppsHook
] ++ (if cli then [
ffmpeg-full
] else [
#fontconfig
]);
buildInputs = [
] ++ (if cli then [
ffmpeg-full
] else [
alsa-lib
]);

cargoLock = {
lockFile = "${src}/Cargo.lock";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
lockFile = "${src}/Cargo.lock";
lockFile = ./Cargo.lock;

This is IFD here (https://nixos.org/manual/nix/unstable/language/import-from-derivation) and that is currently disallowed in nixpkgs

You'll need to copy the Cargo.lock file into nixpkgs unfortunately and reference it

(also the out dir in the root still needs to be removed: https://github.com/NixOS/nixpkgs/pull/256882/files#diff-ebf70d31835017636a8cab71dd0e0d2f3b397b9a331a98eabf030ccd60f8c0ba)

outputHashes = {
"mpeg_encoder-0.2.1" = "sha256-+BNZZ1FIr1374n8Zs1mww2w3eWHOH6ENOTYXz9RT2Ck=";
"glyphon-0.5.0" = "sha256-OGXLqiMjaZ7gR5ANkuCgkfn/I7c/4h9SRE6MZZMW3m4=";
"iced_core-0.13.0-dev" = "sha256-enPg3TzYMRVgTo6zcTxkUZpXxUWUZTkwmZuzm0CIShY=";
};
};

cargoBuildFlags = [ "--package" pname ];

postInstall = lib.optionalString (!cli) ''
install -D default.sf2 -t $out/share/neothesia
install -D flatpak/com.github.polymeilex.neothesia.desktop -t $out/share/applications
install -D flatpak/com.github.polymeilex.neothesia.png -t $out/share/icons/hicolor/256x256/apps
'';

preFixup = ''
gappsWrapperArgs+=(
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [
libxkbcommon
libGL
wayland
]}
)
'';

meta = with lib; {
description = (if cli then "A CLI program encoding visualisations of MIDI files into video" else "A GUI program visualising MIDI input and files by piano with sound");
longDescription = (if cli then ''
neothesia-cli is the CLI version of Neothesia.

When executing the program, you input the path to the MIDI file as the first argument. It will then render the notes flying towards a piano where a key lights up when a note is played. This is encoded into a video file.
'' else ''
Neothesia is a GUI program which can play MIDI files, visualising the notes on a piano it plays for you or which you play with MIDI input. Before the notes are played, they fly towars the piano.

It plays the notes through the sound output too. The default instrument sound can be changed by loading SoundFont files.

Neothesia may help you to learn how to play on the piano.
'');
homepage = "https://github.com/PolyMeilex/Neothesia";
license = licenses.gpl3Only;
maintainers = with maintainers; [ annaaurora ];
mainProgram = pname;
};
}
Loading
Loading