overlays-personal/pkgs/reaper/default.nix

86 lines
2.3 KiB
Nix
Raw Normal View History

2021-07-19 01:34:21 +02:00
{ config, lib, stdenv
, fetchurl
, autoPatchelfHook
, makeWrapper
, alsa-lib
, gtk3
, lame
, ffmpeg
, vlc
, xdg-utils
, which
, jackSupport ? true, libjack2
, pulseaudioSupport ? config.pulseaudio or true, libpulseaudio
2019-05-14 20:54:45 +02:00
}:
stdenv.mkDerivation rec {
2021-07-19 01:34:21 +02:00
pname = "reaper";
2022-03-21 15:31:15 +01:00
version = "6.47";
2019-05-14 20:54:45 +02:00
src = fetchurl {
2022-01-22 09:11:12 +01:00
url = "https://www.reaper.fm/files/${lib.versions.major version}.x/reaper${builtins.replaceStrings ["."] [""] version}_linux_${stdenv.hostPlatform.qemuArch}.tar.xz";
hash = {
2022-03-21 15:33:39 +01:00
x86_64-linux = "sha256-31HmIx/ohbrzu5uj8KOOZiHNCmXwng9h+fIGaJfYyqA=";
2022-03-21 15:31:15 +01:00
aarch64-linux = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=";
2022-01-22 09:11:12 +01:00
}.${stdenv.hostPlatform.system};
2019-05-14 20:54:45 +02:00
};
2021-07-19 01:34:21 +02:00
nativeBuildInputs = [
autoPatchelfHook
makeWrapper
xdg-utils # Required for desktop integration
which
];
2019-05-14 20:54:45 +02:00
buildInputs = [
2021-07-19 01:34:21 +02:00
alsa-lib
stdenv.cc.cc.lib # reaper and libSwell need libstdc++.so.6
gtk3
2019-05-14 20:54:45 +02:00
];
runtimeDependencies = [
2021-07-19 01:34:21 +02:00
gtk3 # libSwell needs libgdk-3.so.0
]
++ lib.optional jackSupport libjack2
++ lib.optional pulseaudioSupport libpulseaudio;
2019-05-14 20:54:45 +02:00
dontBuild = true;
installPhase = ''
2021-07-19 01:34:21 +02:00
runHook preInstall
HOME="$out/share" XDG_DATA_HOME="$out/share" ./install-reaper.sh \
2019-05-14 20:54:45 +02:00
--install $out/opt \
--integrate-user-desktop
rm $out/opt/REAPER/uninstall-reaper.sh
2021-07-19 01:34:21 +02:00
# Dynamic loading of plugin dependencies does not adhere to rpath of
# reaper executable that gets modified with runtimeDependencies.
# Patching each plugin with DT_NEEDED is cumbersome and requires
# hardcoding of API versions of each dependency.
# Setting the rpath of the plugin shared object files does not
# seem to have an effect for some plugins.
# We opt for wrapping the executable with LD_LIBRARY_PATH prefix.
2019-05-14 20:54:45 +02:00
wrapProgram $out/opt/REAPER/reaper \
2021-07-19 01:34:21 +02:00
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ lame ffmpeg vlc ]}"
2020-04-11 15:38:30 +02:00
cp -rv ${./jsfx}/* $out/opt/REAPER/InstallData/Effects/
2019-05-14 20:54:45 +02:00
mkdir $out/bin
ln -s $out/opt/REAPER/reaper $out/bin/
ln -s $out/opt/REAPER/reamote-server $out/bin/
2021-07-19 01:34:21 +02:00
runHook postInstall
2019-05-14 20:54:45 +02:00
'';
2021-02-27 08:40:08 +01:00
meta = with lib; {
2019-05-14 20:54:45 +02:00
description = "Digital audio workstation";
homepage = "https://www.reaper.fm/";
2019-05-14 20:54:45 +02:00
license = licenses.unfree;
2021-07-19 01:34:21 +02:00
platforms = [ "x86_64-linux" "aarch64-linux" ];
2022-01-22 09:11:12 +01:00
maintainers = with maintainers; [ jfrankenau ilian orivej uniquepointer ];
2019-05-14 20:54:45 +02:00
};
}