From c71cba712e6e5be5eb1b166e62e5f41af7325706 Mon Sep 17 00:00:00 2001 From: ners Date: Wed, 12 Jul 2023 19:18:41 +0200 Subject: [PATCH 1/2] pianoteq.standard-8: init at 8.1.1 --- pkgs/applications/audio/pianoteq/default.nix | 40 +++++++++++++------- 1 file changed, 27 insertions(+), 13 deletions(-) diff --git a/pkgs/applications/audio/pianoteq/default.nix b/pkgs/applications/audio/pianoteq/default.nix index e528cc8ade8d..44df96cc33c4 100644 --- a/pkgs/applications/audio/pianoteq/default.nix +++ b/pkgs/applications/audio/pianoteq/default.nix @@ -2,7 +2,7 @@ let versionForFile = v: builtins.replaceStrings ["."] [""] v; - mkPianoteq = { name, src, version, archdir ? if (stdenv.hostPlatform.system == "aarch64-linux") then "arm-64bit" else "x86-64bit", ... }: + mkPianoteq = { name, mainProgram, src, version, archdir ? if (stdenv.hostPlatform.system == "aarch64-linux") then "arm-64bit" else "x86-64bit", ... }: stdenv.mkDerivation rec { inherit src version; @@ -47,12 +47,13 @@ let homepage = "https://www.modartt.com/pianoteq"; description = "Software synthesizer that features real-time MIDI-control of digital physically modeled pianos and related instruments"; license = licenses.unfree; + inherit mainProgram; platforms = [ "x86_64-linux" "aarch64-linux" ]; maintainers = [ maintainers.mausch ]; }; }; - fetchWithCurlScript = { name, sha256, script, impureEnvVars ? [] }: + fetchWithCurlScript = { name, hash, script, impureEnvVars ? [] }: stdenv.mkDerivation { inherit name; builder = writeShellScript "builder.sh" '' @@ -81,7 +82,7 @@ let ''; nativeBuildInputs = [ curl ]; outputHashAlgo = "sha256"; - outputHash = sha256; + outputHash = hash; impureEnvVars = lib.fetchers.proxyImpureEnvVars ++ impureEnvVars ++ [ # This variable allows the user to pass additional options to curl @@ -89,9 +90,9 @@ let ]; }; - fetchPianoteqTrial = { name, sha256 }: + fetchPianoteqTrial = { name, hash }: fetchWithCurlScript { - inherit name sha256; + inherit name hash; script = '' html=$( "''${curl[@]}" --silent --request GET \ @@ -122,9 +123,9 @@ let ''; }; - fetchPianoteqWithLogin = { name, sha256 }: + fetchPianoteqWithLogin = { name, hash }: fetchWithCurlScript { - inherit name sha256; + inherit name hash; impureEnvVars = [ "NIX_MODARTT_USERNAME" "NIX_MODARTT_PASSWORD" ]; @@ -168,35 +169,48 @@ in { # TODO currently can't install more than one because `lame` clashes stage-trial = mkPianoteq rec { name = "stage-trial"; - version = "8.0.8"; + mainProgram = "Pianoteq 8 STAGE"; + version = "8.1.1"; src = fetchPianoteqTrial { name = "pianoteq_stage_linux_trial_v${versionForFile version}.7z"; - sha256 = "sha256-dp0bTzzh4aQ2KQ3z9zk+3meKQY4YRYQ86rccHd3+hAQ="; + hash = "sha256-jMGv95WiD7UHAuSzKgauLhlsNvO/RWVrHd2Yf3kiUTo="; }; }; standard-trial = mkPianoteq rec { name = "standard-trial"; - version = "8.0.8"; + mainProgram = "Pianoteq 8"; + version = "8.1.1"; src = fetchPianoteqTrial { name = "pianoteq_linux_trial_v${versionForFile version}.7z"; - sha256 = "sha256-LSrnrjkEhsX9TirUUFs9tNqH2A3cTt3I7YTfcTT6EP8="; + hash = "sha256-pL4tJMV8OTVLT4fwABcImWO+iaVe9gCdDN3rbkL+noc="; }; }; stage-6 = mkPianoteq rec { name = "stage-6"; + mainProgram = "Pianoteq 6 STAGE"; version = "6.7.3"; archdir = if (stdenv.hostPlatform.system == "aarch64-linux") then throw "Pianoteq stage-6 is not supported on aarch64-linux" else "amd64"; src = fetchPianoteqWithLogin { name = "pianoteq_stage_linux_v${versionForFile version}.7z"; - sha256 = "0jy0hkdynhwv0zhrqkby0hdphgmcc09wxmy74rhg9afm1pzl91jy"; + hash = "0jy0hkdynhwv0zhrqkby0hdphgmcc09wxmy74rhg9afm1pzl91jy"; }; }; stage-7 = mkPianoteq rec { name = "stage-7"; + mainProgram = "Pianoteq 7 STAGE"; version = "7.3.0"; src = fetchPianoteqWithLogin { name = "pianoteq_stage_linux_v${versionForFile version}.7z"; - sha256 = "05w7sv9v38r6ljz9xai816w5z2qqwx88hcfjm241fvgbs54125hx"; + hash = "05w7sv9v38r6ljz9xai816w5z2qqwx88hcfjm241fvgbs54125hx"; + }; + }; + standard-8 = mkPianoteq rec { + name = "pro-8"; + mainProgram = "Pianoteq 8"; + version = "8.1.1"; + src = fetchPianoteqWithLogin { + name = "pianoteq_linux_v${versionForFile version}.7z"; + hash = "sha256-vWvo+ctJ0yN6XeJZZVhA3Ul9eWJWAh7Qo54w0TpOiVw="; }; }; # TODO other paid binaries, I don't own that so I don't know their hash. From d4d79d4b8c5109ae537629ea331ebacb16b54e9d Mon Sep 17 00:00:00 2001 From: ners Date: Sun, 16 Jul 2023 12:57:18 +0200 Subject: [PATCH 2/2] pianoteq: add desktop file --- pkgs/applications/audio/pianoteq/default.nix | 81 ++++++++++-- pkgs/applications/audio/pianoteq/pianoteq.svg | 116 ++++++++++++++++++ 2 files changed, 186 insertions(+), 11 deletions(-) create mode 100644 pkgs/applications/audio/pianoteq/pianoteq.svg diff --git a/pkgs/applications/audio/pianoteq/default.nix b/pkgs/applications/audio/pianoteq/default.nix index 44df96cc33c4..e13573cf0587 100644 --- a/pkgs/applications/audio/pianoteq/default.nix +++ b/pkgs/applications/audio/pianoteq/default.nix @@ -1,8 +1,33 @@ -{ lib, stdenv, curl, jq, htmlq, xorg, alsa-lib, freetype, p7zip, autoPatchelfHook, writeShellScript, zlib, libjack2, makeWrapper }: +{ lib +, stdenv +, curl +, jq +, htmlq +, xorg +, alsa-lib +, freetype +, p7zip +, autoPatchelfHook +, writeShellScript +, zlib +, libjack2 +, makeWrapper +, copyDesktopItems +, makeDesktopItem +, librsvg +}: let - versionForFile = v: builtins.replaceStrings ["."] [""] v; + versionForFile = v: builtins.replaceStrings [ "." ] [ "" ] v; - mkPianoteq = { name, mainProgram, src, version, archdir ? if (stdenv.hostPlatform.system == "aarch64-linux") then "arm-64bit" else "x86-64bit", ... }: + mkPianoteq = + { name + , mainProgram + , startupWMClass + , src + , version + , archdir ? if (stdenv.hostPlatform.system == "aarch64-linux") then "arm-64bit" else "x86-64bit" + , ... + }: stdenv.mkDerivation rec { inherit src version; @@ -14,18 +39,34 @@ let nativeBuildInputs = [ autoPatchelfHook + copyDesktopItems makeWrapper + librsvg ]; buildInputs = [ stdenv.cc.cc.lib - xorg.libX11 # libX11.so.6 - xorg.libXext # libXext.so.6 - alsa-lib # libasound.so.2 - freetype # libfreetype.so.6 + xorg.libX11 # libX11.so.6 + xorg.libXext # libXext.so.6 + alsa-lib # libasound.so.2 + freetype # libfreetype.so.6 + ]; + + desktopItems = [ + (makeDesktopItem { + name = pname; + exec = ''"${mainProgram}"''; + desktopName = mainProgram; + icon = "pianoteq"; + comment = meta.description; + categories = [ "AudioVideo" "Audio" "Recorder" ]; + startupNotify = false; + inherit startupWMClass; + }) ]; installPhase = '' + runHook preInstall mkdir -p $out/bin mv -t $out/bin Pianoteq*/${archdir}/* for f in $out/bin/Pianoteq*; do @@ -41,6 +82,18 @@ let } fi done + install -Dm644 ${./pianoteq.svg} $out/share/icons/hicolor/scalable/apps/pianoteq.svg + for size in 16 22 32 48 64 128 256; do + dir=$out/share/icons/hicolor/"$size"x"$size"/apps + mkdir -p $dir + rsvg-convert \ + --keep-aspect-ratio \ + --width $size \ + --height $size \ + --output $dir/pianoteq.png \ + ${./pianoteq.svg} + done + runHook postInstall ''; meta = with lib; { @@ -49,11 +102,11 @@ let license = licenses.unfree; inherit mainProgram; platforms = [ "x86_64-linux" "aarch64-linux" ]; - maintainers = [ maintainers.mausch ]; + maintainers = with maintainers; [ mausch ners ]; }; }; - fetchWithCurlScript = { name, hash, script, impureEnvVars ? [] }: + fetchWithCurlScript = { name, hash, script, impureEnvVars ? [ ] }: stdenv.mkDerivation { inherit name; builder = writeShellScript "builder.sh" '' @@ -165,11 +218,13 @@ let ''; }; -in { +in +{ # TODO currently can't install more than one because `lame` clashes stage-trial = mkPianoteq rec { name = "stage-trial"; mainProgram = "Pianoteq 8 STAGE"; + startupWMClass = "Pianoteq STAGE Trial"; version = "8.1.1"; src = fetchPianoteqTrial { name = "pianoteq_stage_linux_trial_v${versionForFile version}.7z"; @@ -179,6 +234,7 @@ in { standard-trial = mkPianoteq rec { name = "standard-trial"; mainProgram = "Pianoteq 8"; + startupWMClass = "Pianoteq Trial"; version = "8.1.1"; src = fetchPianoteqTrial { name = "pianoteq_linux_trial_v${versionForFile version}.7z"; @@ -188,6 +244,7 @@ in { stage-6 = mkPianoteq rec { name = "stage-6"; mainProgram = "Pianoteq 6 STAGE"; + startupWMClass = "Pianoteq STAGE"; version = "6.7.3"; archdir = if (stdenv.hostPlatform.system == "aarch64-linux") then throw "Pianoteq stage-6 is not supported on aarch64-linux" else "amd64"; src = fetchPianoteqWithLogin { @@ -198,6 +255,7 @@ in { stage-7 = mkPianoteq rec { name = "stage-7"; mainProgram = "Pianoteq 7 STAGE"; + startupWMClass = "Pianoteq STAGE"; version = "7.3.0"; src = fetchPianoteqWithLogin { name = "pianoteq_stage_linux_v${versionForFile version}.7z"; @@ -205,8 +263,9 @@ in { }; }; standard-8 = mkPianoteq rec { - name = "pro-8"; + name = "standard-8"; mainProgram = "Pianoteq 8"; + startupWMClass = "Pianoteq"; version = "8.1.1"; src = fetchPianoteqWithLogin { name = "pianoteq_linux_v${versionForFile version}.7z"; diff --git a/pkgs/applications/audio/pianoteq/pianoteq.svg b/pkgs/applications/audio/pianoteq/pianoteq.svg new file mode 100644 index 000000000000..0e410d0ff8d0 --- /dev/null +++ b/pkgs/applications/audio/pianoteq/pianoteq.svg @@ -0,0 +1,116 @@ + + + + + + + + + + + + + + + + + + + + + + + +