diff --git a/pkgs/applications/audio/bitwig-studio/bitwig-studio4.nix b/pkgs/applications/audio/bitwig-studio/bitwig-studio4.nix new file mode 100644 index 000000000000..b6dea53012d8 --- /dev/null +++ b/pkgs/applications/audio/bitwig-studio/bitwig-studio4.nix @@ -0,0 +1,75 @@ +{ stdenv, fetchurl, alsa-lib, cairo, dpkg, freetype +, gdk-pixbuf, glib, gtk3, lib, xorg +, libglvnd, libjack2, ffmpeg +, libxkbcommon, xdg-utils, zlib, pulseaudio +, wrapGAppsHook, makeWrapper }: + +stdenv.mkDerivation rec { + pname = "bitwig-studio"; + version = "4.0"; + + src = fetchurl { + url = "https://downloads.bitwig.com/stable/${version}/${pname}-${version}.deb"; + sha256 = "38381c1a382abd9543931f34d5ae1789c31ec1217a1c852b5c5c442ccaf97063"; + }; + + nativeBuildInputs = [ dpkg makeWrapper wrapGAppsHook ]; + + unpackCmd = '' + mkdir -p root + dpkg-deb -x $curSrc root + ''; + + dontBuild = true; + dontWrapGApps = true; # we only want $gappsWrapperArgs here + + buildInputs = with xorg; [ + alsa-lib cairo freetype gdk-pixbuf glib gtk3 libxcb xcbutil xcbutilwm zlib libXtst libxkbcommon pulseaudio libjack2 libX11 libglvnd libXcursor stdenv.cc.cc.lib + ]; + + 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 -path '*/resources/*' | \ + while IFS= read -r f ; do + patchelf --set-interpreter "${stdenv.cc.bintools.dynamicLinker}" $f + wrapProgram $f \ + "''${gappsWrapperArgs[@]}" \ + --prefix PATH : "${lib.makeBinPath [ xdg-utils ffmpeg ]}" \ + --suffix LD_LIBRARY_PATH : "${lib.strings.makeLibraryPath buildInputs}" + 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 ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 6263f99c1375..134d26935606 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -23193,8 +23193,9 @@ in inherit (pkgs) bitwig-studio1; }; bitwig-studio3 = callPackage ../applications/audio/bitwig-studio/bitwig-studio3.nix { }; + bitwig-studio4 = callPackage ../applications/audio/bitwig-studio/bitwig-studio4.nix { }; - bitwig-studio = bitwig-studio3; + bitwig-studio = bitwig-studio4; bgpdump = callPackage ../tools/networking/bgpdump { };