diff options
Diffstat (limited to 'pkgs/applications/audio/reaper/default.nix')
-rw-r--r-- | pkgs/applications/audio/reaper/default.nix | 35 |
1 files changed, 25 insertions, 10 deletions
diff --git a/pkgs/applications/audio/reaper/default.nix b/pkgs/applications/audio/reaper/default.nix index b5cf860ad9b7c..dcbb7586eebe9 100644 --- a/pkgs/applications/audio/reaper/default.nix +++ b/pkgs/applications/audio/reaper/default.nix @@ -2,6 +2,7 @@ , fetchurl , autoPatchelfHook , makeWrapper +, undmg , alsa-lib , curl @@ -14,14 +15,16 @@ , xdotool , which -, jackSupport ? true +, jackSupport ? stdenv.isLinux , jackLibrary -, pulseaudioSupport ? config.pulseaudio or true +, pulseaudioSupport ? config.pulseaudio or stdenv.isLinux , libpulseaudio }: let - url_for_platform = version: arch: "https://www.reaper.fm/files/${lib.versions.major version}.x/reaper${builtins.replaceStrings ["."] [""] version}_linux_${arch}.tar.xz"; + url_for_platform = version: arch: if stdenv.isDarwin + then "https://www.reaper.fm/files/${lib.versions.major version}.x/reaper${builtins.replaceStrings ["."] [""] version}_universal.dmg" + else "https://www.reaper.fm/files/${lib.versions.major version}.x/reaper${builtins.replaceStrings ["."] [""] version}_linux_${arch}.tar.xz"; in stdenv.mkDerivation rec { pname = "reaper"; @@ -29,26 +32,32 @@ stdenv.mkDerivation rec { src = fetchurl { url = url_for_platform version stdenv.hostPlatform.qemuArch; - hash = { + hash = if stdenv.isDarwin then "sha256-jaT+3cIFVfBopgeeTkpNs9rFX50unlPJogdhkI9bsWU=" else { x86_64-linux = "sha256-P/PnbJPr4ErDz5ho1/dLERhqkKjdetHzKpCpfVZAYb0="; aarch64-linux = "sha256-PdnBVlHwoEEv2SPq/p5oyiOlduCEqL35gAY+QIJU1Ys="; }.${stdenv.hostPlatform.system}; }; nativeBuildInputs = [ - autoPatchelfHook makeWrapper - xdg-utils # Required for desktop integration + ] ++ lib.optionals stdenv.isLinux [ which + autoPatchelfHook + xdg-utils # Required for desktop integration + ] ++ lib.optionals stdenv.isDarwin [ + undmg ]; + sourceRoot = lib.optionalString stdenv.isDarwin "Reaper.app"; + buildInputs = [ - alsa-lib stdenv.cc.cc.lib # reaper and libSwell need libstdc++.so.6 + ] ++ lib.optionals stdenv.isLinux [ gtk3 + alsa-lib ]; - runtimeDependencies = [ + runtimeDependencies = lib.optionals stdenv.isLinux [ gtk3 # libSwell needs libgdk-3.so.0 ] ++ lib.optional jackSupport jackLibrary @@ -56,7 +65,13 @@ stdenv.mkDerivation rec { dontBuild = true; - installPhase = '' + installPhase = if stdenv.isDarwin then '' + runHook preInstall + mkdir -p "$out/Applications/Reaper.app" + cp -r * "$out/Applications/Reaper.app/" + makeWrapper "$out/Applications/Reaper.app/Contents/MacOS/REAPER" "$out/bin/reaper" + runHook postInstall + '' else '' runHook preInstall HOME="$out/share" XDG_DATA_HOME="$out/share" ./install-reaper.sh \ @@ -89,7 +104,7 @@ stdenv.mkDerivation rec { homepage = "https://www.reaper.fm/"; sourceProvenance = with sourceTypes; [ binaryNativeCode ]; license = licenses.unfree; - platforms = [ "x86_64-linux" "aarch64-linux" ]; + platforms = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ]; maintainers = with maintainers; [ jfrankenau ilian orivej uniquepointer viraptor ]; }; } |