2021-06-10 03:57:09 +01:00
|
|
|
{ stdenv, fetchurl, alsa-lib, cairo, dpkg, freetype
|
2020-12-22 17:50:27 +00:00
|
|
|
, gdk-pixbuf, glib, gtk3, lib, xorg
|
2021-04-30 15:02:05 +01:00
|
|
|
, libglvnd, libjack2, ffmpeg
|
2021-02-01 08:05:09 +00:00
|
|
|
, libxkbcommon, xdg-utils, zlib, pulseaudio
|
2020-12-22 17:50:27 +00:00
|
|
|
, wrapGAppsHook, makeWrapper }:
|
2019-07-12 09:54:55 +01:00
|
|
|
|
2020-12-22 17:50:27 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "bitwig-studio";
|
2021-04-07 16:24:24 +01:00
|
|
|
version = "3.3.7";
|
2019-07-12 09:54:55 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2020-12-22 17:50:27 +00:00
|
|
|
url = "https://downloads.bitwig.com/stable/${version}/${pname}-${version}.deb";
|
2021-04-07 16:24:24 +01:00
|
|
|
sha256 = "13jr45kzv0xjhhqk30qpq793349qyx8jpas4kl6i6bk3xfrd3fbz";
|
2019-07-12 09:54:55 +01:00
|
|
|
};
|
|
|
|
|
2020-12-22 17:50:27 +00:00
|
|
|
nativeBuildInputs = [ dpkg makeWrapper wrapGAppsHook ];
|
2019-12-22 14:26:36 +00:00
|
|
|
|
2020-12-22 17:50:27 +00:00
|
|
|
unpackCmd = ''
|
|
|
|
mkdir -p root
|
|
|
|
dpkg-deb -x $curSrc root
|
|
|
|
'';
|
|
|
|
|
|
|
|
dontBuild = true;
|
|
|
|
dontWrapGApps = true; # we only want $gappsWrapperArgs here
|
|
|
|
|
|
|
|
buildInputs = with xorg; [
|
2021-06-10 03:57:09 +01:00
|
|
|
alsa-lib cairo freetype gdk-pixbuf glib gtk3 libxcb xcbutil xcbutilwm zlib libXtst libxkbcommon pulseaudio libjack2 libX11 libglvnd libXcursor stdenv.cc.cc.lib
|
2020-12-22 17:50:27 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
binPath = lib.makeBinPath [
|
2021-04-30 15:02:05 +01:00
|
|
|
xdg-utils ffmpeg
|
2020-12-22 17:50:27 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
ldLibraryPath = lib.strings.makeLibraryPath buildInputs;
|
2019-12-22 14:26:36 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
2021-06-16 09:08:28 +01:00
|
|
|
runHook preInstall
|
|
|
|
|
2020-12-22 17:50:27 +00:00
|
|
|
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/bitwig-studio.desktop \
|
|
|
|
$out/share/applications/bitwig-studio.desktop \
|
|
|
|
--replace /usr/bin/bitwig-studio $out/bin/bitwig-studio
|
2021-06-16 09:08:28 +01:00
|
|
|
|
|
|
|
runHook postInstall
|
2020-12-22 17:50:27 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
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 -path '*/resources/*' | \
|
|
|
|
while IFS= read -r f ; do
|
|
|
|
patchelf --set-interpreter "${stdenv.cc.bintools.dynamicLinker}" $f
|
|
|
|
wrapProgram $f \
|
|
|
|
"''${gappsWrapperArgs[@]}" \
|
|
|
|
--prefix PATH : "${binPath}" \
|
2021-06-16 09:08:28 +01:00
|
|
|
--suffix LD_LIBRARY_PATH : "${ldLibraryPath}"
|
2020-12-22 17:50:27 +00:00
|
|
|
done
|
2019-12-22 14:26:36 +00:00
|
|
|
|
|
|
|
'';
|
2020-12-22 17:50:27 +00:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-12-22 17:50:27 +00:00
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|