From 69a8d48d73a556b5eb5b9293d622a01cefc84749 Mon Sep 17 00:00:00 2001 From: polygon Date: Fri, 29 Nov 2024 20:05:32 +0100 Subject: [PATCH] bitwig-studio: 5.2.5 -> 5.2.7, fix Onset and Beat detection --- .../audio/bitwig-studio/bitwig-studio5.nix | 6 ++-- .../audio/bitwig-studio/bitwig-wrapper.nix | 36 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 6 +++- 3 files changed, 44 insertions(+), 4 deletions(-) create mode 100644 pkgs/applications/audio/bitwig-studio/bitwig-wrapper.nix diff --git a/pkgs/applications/audio/bitwig-studio/bitwig-studio5.nix b/pkgs/applications/audio/bitwig-studio/bitwig-studio5.nix index 5e189db20f0c9..3e31c770d183f 100644 --- a/pkgs/applications/audio/bitwig-studio/bitwig-studio5.nix +++ b/pkgs/applications/audio/bitwig-studio/bitwig-studio5.nix @@ -28,13 +28,13 @@ }: stdenv.mkDerivation rec { - pname = "bitwig-studio"; - version = "5.2.5"; + pname = "bitwig-studio-unwrapped"; + version = "5.2.7"; src = fetchurl { name = "bitwig-studio-${version}.deb"; url = "https://www.bitwig.com/dl/Bitwig%20Studio/${version}/installer_linux/"; - hash = "sha256-x6Uw6o+a3nArMm1Ev5ytGtLDGQ3r872WqlC022zT8Hk="; + hash = "sha256-Tyi7qYhTQ5i6fRHhrmz4yHXSdicd4P4iuF9FRKRhkMI="; }; nativeBuildInputs = [ dpkg makeWrapper wrapGAppsHook3 ]; diff --git a/pkgs/applications/audio/bitwig-studio/bitwig-wrapper.nix b/pkgs/applications/audio/bitwig-studio/bitwig-wrapper.nix new file mode 100644 index 0000000000000..771044380582b --- /dev/null +++ b/pkgs/applications/audio/bitwig-studio/bitwig-wrapper.nix @@ -0,0 +1,36 @@ +{ stdenv, bindfs, bubblewrap, mktemp, writeShellScript, bitwig-studio-unwrapped }: +stdenv.mkDerivation { + inherit (bitwig-studio-unwrapped) version; + + pname = "bitwig-studio"; + + dontUnpack = true; + dontConfigure = true; + dontBuild = true; + dontPatchELF = true; + dontStrip = true; + + installPhase = let + wrapper = writeShellScript "bitwig-studio" '' + set -e + + echo "Creating temporary directory" + TMPDIR=$(${mktemp}/bin/mktemp --directory) + echo "Temporary directory: $TMPDIR" + echo "Copying default Vamp Plugin settings" + cp -r ${bitwig-studio-unwrapped}/libexec/resources/VampTransforms $TMPDIR + echo "Changing permissions to be writable" + chmod -R u+w $TMPDIR/VampTransforms + + echo "Starting Bitwig Studio in Bubblewrap Environment" + ${bubblewrap}/bin/bwrap --bind / / --bind $TMPDIR/VampTransforms ${bitwig-studio-unwrapped}/libexec/resources/VampTransforms ${bitwig-studio-unwrapped}/bin/bitwig-studio || true + + echo "Bitwig exited, removing temporary directory" + rm -rf $TMPDIR + ''; + in '' + mkdir -p $out/bin + cp ${wrapper} $out/bin/bitwig-studio + cp -r ${bitwig-studio-unwrapped}/share $out + ''; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index e90d1208feffd..db0b230445897 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -13405,10 +13405,14 @@ with pkgs; bitwig-studio4 = callPackage ../applications/audio/bitwig-studio/bitwig-studio4.nix { libjpeg = libjpeg8; }; - bitwig-studio5 = callPackage ../applications/audio/bitwig-studio/bitwig-studio5.nix { + bitwig-studio5-unwrapped = callPackage ../applications/audio/bitwig-studio/bitwig-studio5.nix { libjpeg = libjpeg8; }; + bitwig-studio5 = callPackage ../applications/audio/bitwig-studio/bitwig-wrapper.nix { + bitwig-studio-unwrapped = bitwig-studio5-unwrapped; + }; + bitwig-studio = bitwig-studio5; blackbox = callPackage ../applications/version-management/blackbox {