nixpkgs/pkgs/applications/audio/bitwig-studio/bitwig-studio5.nix
Jan Tojnar eb04659fc2 treewide: wrapGAppsHook → wrapGAppsHook3
This was achieved using the following command:

    sd 'wrapGAppsHook\b' wrapGAppsHook3 (rg -l 'wrapGAppsHook\b')

And then manually reverted the following changes:

- alias in top-level.nix
- function name in wrap-gapps-hook.sh
- comment in postFixup of at-spi2-core
- comment in gtk4
- comment in preFixup of 1password-gui/linux.nix
- comment in postFixup of qgis/unwrapped-ltr.nix and qgis/unwrapped.nix
- comment in postFixup of telegram-desktop
- comment in postFixup of fwupd
- buildCommand of mongodb-compass
- postFixup of xflux-gui
- comment in a patch in kdePackages.kde-gtk-config and plasma5Packages.kde-gtk-config
- description of programs.sway.wrapperFeatures.gtk NixOS option (manual rebuild)
2024-04-27 02:23:22 +02:00

127 lines
2.8 KiB
Nix

{ stdenv
, fetchurl
, alsa-lib
, atk
, cairo
, dpkg
, ffmpeg
, freetype
, gdk-pixbuf
, glib
, gtk3
, harfbuzz
, lib
, libglvnd
, libjack2
, libjpeg
, libxkbcommon
, makeWrapper
, pango
, pipewire
, pulseaudio
, wrapGAppsHook3
, xdg-utils
, xorg
, zlib
}:
stdenv.mkDerivation rec {
pname = "bitwig-studio";
version = "5.1.6";
src = fetchurl {
url = "https://downloads.bitwig.com/stable/${version}/${pname}-${version}.deb";
sha256 = "sha256-U1Qp7/7kAr1IEcv256I2J/sb5MYxfR20Pi5N8WaVh2U=";
};
nativeBuildInputs = [ dpkg makeWrapper wrapGAppsHook3 ];
unpackCmd = ''
mkdir -p root
dpkg-deb -x $curSrc root
'';
dontBuild = true;
dontWrapGApps = true; # we only want $gappsWrapperArgs here
buildInputs = with xorg; [
alsa-lib
atk
cairo
freetype
gdk-pixbuf
glib
gtk3
harfbuzz
libglvnd
libjack2
# libjpeg8 is required for converting jpeg's to colour palettes
libjpeg
libxcb
libXcursor
libX11
libXtst
libxkbcommon
pango
pipewire
pulseaudio
stdenv.cc.cc.lib
xcbutil
xcbutilwm
zlib
];
installPhase = ''
runHook preInstall
mkdir -p $out/bin
cp -r opt/bitwig-studio $out/libexec
ln -s $out/libexec/bitwig-studio $out/bin/bitwig-studio
cp -r usr/share $out/share
substitute usr/share/applications/com.bitwig.BitwigStudio.desktop \
$out/share/applications/com.bitwig.BitwigStudio.desktop \
--replace /usr/bin/bitwig-studio $out/bin/bitwig-studio
runHook postInstall
'';
postFixup = ''
# patchelf fails to set rpath on BitwigStudioEngine, so we use
# the LD_LIBRARY_PATH way
find $out -type f -executable \
-not -name '*.so.*' \
-not -name '*.so' \
-not -name '*.jar' \
-not -name 'jspawnhelper' \
-not -path '*/resources/*' | \
while IFS= read -r f ; do
patchelf --set-interpreter "${stdenv.cc.bintools.dynamicLinker}" $f
# make xdg-open overrideable at runtime
wrapProgram $f \
"''${gappsWrapperArgs[@]}" \
--prefix PATH : "${lib.makeBinPath [ ffmpeg ]}" \
--suffix PATH : "${lib.makeBinPath [ xdg-utils ]}" \
--suffix LD_LIBRARY_PATH : "${lib.strings.makeLibraryPath buildInputs}"
done
find $out -type f -executable -name 'jspawnhelper' | \
while IFS= read -r f ; do
patchelf --set-interpreter "${stdenv.cc.bintools.dynamicLinker}" $f
done
'';
meta = with lib; {
description = "A digital audio workstation";
longDescription = ''
Bitwig Studio is a multi-platform music-creation system for
production, performance and DJing, with a focus on flexible
editing tools and a super-fast workflow.
'';
homepage = "https://www.bitwig.com/";
license = licenses.unfree;
platforms = [ "x86_64-linux" ];
maintainers = with maintainers; [ bfortz michalrus mrVanDalo ];
};
}