Skip to content

Commit

Permalink
pianoteq: refactor, bump versions
Browse files Browse the repository at this point in the history
  • Loading branch information
ners committed Oct 25, 2024
1 parent 999e344 commit 05bf905
Showing 1 changed file with 66 additions and 73 deletions.
139 changes: 66 additions & 73 deletions pkgs/applications/audio/pianoteq/default.nix
Original file line number Diff line number Diff line change
@@ -1,31 +1,34 @@
{ lib
, stdenv
, curl
, jq
, htmlq
, xorg
, alsa-lib
, freetype
, p7zip
, autoPatchelfHook
, writeShellScript
, zlib
, libjack2
, makeWrapper
, copyDesktopItems
, makeDesktopItem
, curl
, freetype
, htmlq
, jq
, libglvnd
, libjack2
, librsvg
, makeDesktopItem
, makeWrapper
, p7zip
, writeShellScript
}:
let
versionForFile = v: builtins.replaceStrings [ "." ] [ "" ] v;

archdirs =
if stdenv.isx86_64 then ["x86-64bit" "amd64"]
else if stdenv.isAarch64 then ["arm-64bit" "arm"]
else throw "unsupported platform";

mkPianoteq =
{ name
, mainProgram
, startupWMClass
, src
, version
, archdir ? if (stdenv.hostPlatform.system == "aarch64-linux") then "arm-64bit" else "x86-64bit"
, ...
}:
stdenv.mkDerivation rec {
Expand All @@ -45,11 +48,9 @@ let
];

buildInputs = [
stdenv.cc.cc.lib
xorg.libX11 # libX11.so.6
xorg.libXext # libXext.so.6
alsa-lib # libasound.so.2
freetype # libfreetype.so.6
libglvnd # libGL.so.1
];

desktopItems = [
Expand All @@ -68,20 +69,7 @@ let
installPhase = ''
runHook preInstall
mkdir -p $out/bin
mv -t $out/bin Pianoteq*/${archdir}/*
for f in $out/bin/Pianoteq*; do
if [ -x "$f" ] && [ -f "$f" ]; then
wrapProgram "$f" --prefix LD_LIBRARY_PATH : ${
lib.makeLibraryPath (buildInputs ++ [
xorg.libXcursor
xorg.libXinerama
xorg.libXrandr
libjack2
zlib
])
}
fi
done
mv -t $out/bin ${builtins.concatStringsSep " " (builtins.map (dir: "Pianoteq*/${dir}/*") archdirs)}
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
Expand Down Expand Up @@ -218,59 +206,64 @@ let
'';
};

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.2.0";
src = fetchPianoteqTrial {
name = "pianoteq_stage_linux_trial_v${versionForFile version}.7z";
hash = "sha256-66xbcqNrnVJ+C9FQ8Bg8A7nj/bFrjt6jKheusrXVWvI=";
};
};
standard-trial = mkPianoteq rec {
name = "standard-trial";
mainProgram = "Pianoteq 8";
startupWMClass = "Pianoteq Trial";
version = "8.2.0";
src = fetchPianoteqTrial {
name = "pianoteq_linux_trial_v${versionForFile version}.7z";
hash = "sha256-IFFQMn8EFo5X8sUZV2/vtQOA83NHEFrUsU++CvYbN1c=";
version6 = "6.7.3";
version7 = "7.5.4";
version8 = "8.3.2";

mkStandard = version: hash: mkPianoteq {
name = "standard";
mainProgram = "Pianoteq ${lib.versions.major version}";
startupWMClass = "Pianoteq";
inherit version;
src = fetchPianoteqWithLogin {
name = "pianoteq_linux_v${versionForFile version}.7z";
inherit hash;
};
};
stage-6 = mkPianoteq rec {
name = "stage-6";
mainProgram = "Pianoteq 6 STAGE";
mkStage = version: hash: mkPianoteq {
name = "stage";
mainProgram = "Pianoteq ${lib.versions.major version} 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";
inherit version;
src = fetchPianoteqWithLogin {
name = "pianoteq_stage_linux_v${versionForFile version}.7z";
hash = "0jy0hkdynhwv0zhrqkby0hdphgmcc09wxmy74rhg9afm1pzl91jy";
inherit hash;
};
};
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";
hash = "05w7sv9v38r6ljz9xai816w5z2qqwx88hcfjm241fvgbs54125hx";
mkStandardTrial = version: hash: mkPianoteq {
name = "standard-trial";
mainProgram = "Pianoteq ${lib.versions.major version}";
startupWMClass = "Pianoteq Trial";
inherit version;
src = fetchPianoteqTrial {
name = "pianoteq_linux_trial_v${versionForFile version}.7z";
inherit hash;
};
};
standard-8 = mkPianoteq rec {
name = "standard-8";
mainProgram = "Pianoteq 8";
startupWMClass = "Pianoteq";
version = "8.2.0";
src = fetchPianoteqWithLogin {
name = "pianoteq_linux_v${versionForFile version}.7z";
hash = "sha256-ME0urUc1jwUKpg+5BdawYo9WhvMsrztYTVOrJTVxtkY=";
mkStageTrial = version: hash: mkPianoteq {
name = "stage-trial";
mainProgram = "Pianoteq ${lib.versions.major version} STAGE";
startupWMClass = "Pianoteq STAGE Trial";
inherit version;
src = fetchPianoteqTrial {
name = "pianoteq_stage_linux_trial_v${versionForFile version}.7z";
inherit hash;
};
};
# TODO other paid binaries, I don't own that so I don't know their hash.
in
{
standard_8 = mkStandard version8 "sha256-U9i9XgZKed8KxDL1fwGbRs30wj0IQwMjP+GH2JpdrJ0=";
stage_8 = mkStage version8 "";
standard-trial_8 = mkStandardTrial version8 "sha256-nYhTtPtkmYwVV5N1XIGBNU9YBbeIxLOjw2bA29ObXps=";
stage-trial_8 = mkStageTrial version8 "sha256-dkSG1PZgVds4fTir/77TSKhd3pBMJaOcWnLtZHsPqWo=";

standard_7 = mkStandard version7 "sha256-TA9CiuT21fQedlMUGz7bNNxYun5ArmRjvIxjOGqXDCs=";
stage_7 = mkStage version7 "";
standard-trial_7 = mkStandardTrial version7 "sha256-3a3+SKTEhvDtqK5Kg4E6KiLvn5+j6JN6ntIb72u2bdQ=";
stage-trial_7 = mkStageTrial version7 "sha256-ybtq+hjnaQxpLxv2KE0ZcbQXtn5DJJsnMwCmh3rlrIc=";

standard_6 = mkStandard version6 "sha256-u6ZNpmHFVOk+r+6Q8OURSfAi41cxMoDvaEXrTtHEAVY=";
stage_6 = mkStage version6 "";
standard-trial_6 = mkStandardTrial version6 "sha256-nHTAqosOJqC0VnRw2/xVpZ6y02vvau6CgfNmgiN/AHs=";
stage-trial_6 = mkStageTrial version6 "sha256-zrv0c/Mxt1EysR7ZvmxtksXAF5MyXTFMNj4KAdO3QnE=";
}

0 comments on commit 05bf905

Please sign in to comment.