lol

Merge pull request #266834 from viraptor/reaper-darwin

reaper: darwin platform

authored by

Weijia Wang and committed by
GitHub
c7f0bbcf 309c806b

+38 -13
+25 -10
pkgs/applications/audio/reaper/default.nix
··· 2 , fetchurl 3 , autoPatchelfHook 4 , makeWrapper 5 6 , alsa-lib 7 , curl ··· 14 , xdotool 15 , which 16 17 - , jackSupport ? true 18 , jackLibrary 19 - , pulseaudioSupport ? config.pulseaudio or true 20 , libpulseaudio 21 }: 22 23 let 24 - url_for_platform = version: arch: "https://www.reaper.fm/files/${lib.versions.major version}.x/reaper${builtins.replaceStrings ["."] [""] version}_linux_${arch}.tar.xz"; 25 in 26 stdenv.mkDerivation rec { 27 pname = "reaper"; ··· 29 30 src = fetchurl { 31 url = url_for_platform version stdenv.hostPlatform.qemuArch; 32 - hash = { 33 x86_64-linux = "sha256-P/PnbJPr4ErDz5ho1/dLERhqkKjdetHzKpCpfVZAYb0="; 34 aarch64-linux = "sha256-PdnBVlHwoEEv2SPq/p5oyiOlduCEqL35gAY+QIJU1Ys="; 35 }.${stdenv.hostPlatform.system}; 36 }; 37 38 nativeBuildInputs = [ 39 autoPatchelfHook 40 - makeWrapper 41 xdg-utils # Required for desktop integration 42 - which 43 ]; 44 45 buildInputs = [ 46 - alsa-lib 47 stdenv.cc.cc.lib # reaper and libSwell need libstdc++.so.6 48 gtk3 49 ]; 50 51 - runtimeDependencies = [ 52 gtk3 # libSwell needs libgdk-3.so.0 53 ] 54 ++ lib.optional jackSupport jackLibrary ··· 56 57 dontBuild = true; 58 59 - installPhase = '' 60 runHook preInstall 61 62 HOME="$out/share" XDG_DATA_HOME="$out/share" ./install-reaper.sh \ ··· 89 homepage = "https://www.reaper.fm/"; 90 sourceProvenance = with sourceTypes; [ binaryNativeCode ]; 91 license = licenses.unfree; 92 - platforms = [ "x86_64-linux" "aarch64-linux" ]; 93 maintainers = with maintainers; [ jfrankenau ilian orivej uniquepointer viraptor ]; 94 }; 95 }
··· 2 , fetchurl 3 , autoPatchelfHook 4 , makeWrapper 5 + , undmg 6 7 , alsa-lib 8 , curl ··· 15 , xdotool 16 , which 17 18 + , jackSupport ? stdenv.isLinux 19 , jackLibrary 20 + , pulseaudioSupport ? config.pulseaudio or stdenv.isLinux 21 , libpulseaudio 22 }: 23 24 let 25 + url_for_platform = version: arch: if stdenv.isDarwin 26 + then "https://www.reaper.fm/files/${lib.versions.major version}.x/reaper${builtins.replaceStrings ["."] [""] version}_universal.dmg" 27 + else "https://www.reaper.fm/files/${lib.versions.major version}.x/reaper${builtins.replaceStrings ["."] [""] version}_linux_${arch}.tar.xz"; 28 in 29 stdenv.mkDerivation rec { 30 pname = "reaper"; ··· 32 33 src = fetchurl { 34 url = url_for_platform version stdenv.hostPlatform.qemuArch; 35 + hash = if stdenv.isDarwin then "sha256-jaT+3cIFVfBopgeeTkpNs9rFX50unlPJogdhkI9bsWU=" else { 36 x86_64-linux = "sha256-P/PnbJPr4ErDz5ho1/dLERhqkKjdetHzKpCpfVZAYb0="; 37 aarch64-linux = "sha256-PdnBVlHwoEEv2SPq/p5oyiOlduCEqL35gAY+QIJU1Ys="; 38 }.${stdenv.hostPlatform.system}; 39 }; 40 41 nativeBuildInputs = [ 42 + makeWrapper 43 + ] ++ lib.optionals stdenv.isLinux [ 44 + which 45 autoPatchelfHook 46 xdg-utils # Required for desktop integration 47 + ] ++ lib.optionals stdenv.isDarwin [ 48 + undmg 49 ]; 50 51 + sourceRoot = lib.optionalString stdenv.isDarwin "Reaper.app"; 52 + 53 buildInputs = [ 54 stdenv.cc.cc.lib # reaper and libSwell need libstdc++.so.6 55 + ] ++ lib.optionals stdenv.isLinux [ 56 gtk3 57 + alsa-lib 58 ]; 59 60 + runtimeDependencies = lib.optionals stdenv.isLinux [ 61 gtk3 # libSwell needs libgdk-3.so.0 62 ] 63 ++ lib.optional jackSupport jackLibrary ··· 65 66 dontBuild = true; 67 68 + installPhase = if stdenv.isDarwin then '' 69 + runHook preInstall 70 + mkdir -p "$out/Applications/Reaper.app" 71 + cp -r * "$out/Applications/Reaper.app/" 72 + makeWrapper "$out/Applications/Reaper.app/Contents/MacOS/REAPER" "$out/bin/reaper" 73 + runHook postInstall 74 + '' else '' 75 runHook preInstall 76 77 HOME="$out/share" XDG_DATA_HOME="$out/share" ./install-reaper.sh \ ··· 104 homepage = "https://www.reaper.fm/"; 105 sourceProvenance = with sourceTypes; [ binaryNativeCode ]; 106 license = licenses.unfree; 107 + platforms = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ]; 108 maintainers = with maintainers; [ jfrankenau ilian orivej uniquepointer viraptor ]; 109 }; 110 }
+13 -3
pkgs/applications/audio/reaper/updater.sh
··· 5 6 reaper_ver=$(curl -Ls https://www.reaper.fm/download.php | grep -o 'Version [0-9]\.[0-9]*' | head -n1 | cut -d' ' -f2) 7 8 - function set_hash_for_arch() { 9 local arch=$1 10 pkg_hash=$(nix-prefetch-url https://www.reaper.fm/files/${reaper_ver%.*}.x/reaper${reaper_ver/./}_linux_$arch.tar.xz) 11 pkg_hash=$(nix hash to-sri "sha256:$pkg_hash") ··· 14 update-source-version reaper "${reaper_ver}" "$pkg_hash" --system=$arch-linux 15 } 16 17 - set_hash_for_arch aarch64 18 - set_hash_for_arch x86_64
··· 5 6 reaper_ver=$(curl -Ls https://www.reaper.fm/download.php | grep -o 'Version [0-9]\.[0-9]*' | head -n1 | cut -d' ' -f2) 7 8 + function set_hash_for_linux() { 9 local arch=$1 10 pkg_hash=$(nix-prefetch-url https://www.reaper.fm/files/${reaper_ver%.*}.x/reaper${reaper_ver/./}_linux_$arch.tar.xz) 11 pkg_hash=$(nix hash to-sri "sha256:$pkg_hash") ··· 14 update-source-version reaper "${reaper_ver}" "$pkg_hash" --system=$arch-linux 15 } 16 17 + function set_hash_for_darwin() { 18 + local arch=$1 19 + pkg_hash=$(nix-prefetch-url https://www.reaper.fm/files/${reaper_ver%.*}.x/reaper${reaper_ver/./}_universal.dmg) 20 + pkg_hash=$(nix hash to-sri "sha256:$pkg_hash") 21 + # reset the version so the second architecture update doesn't get ignored 22 + update-source-version reaper 0 "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" --system=$arch-darwin 23 + update-source-version reaper "${reaper_ver}" "$pkg_hash" --system=$arch-darwin 24 + } 25 + 26 + set_hash_for_linux aarch64 27 + set_hash_for_linux x86_64 28 + set_hash_for_darwin aarch64