mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-15 22:36:23 +01:00
Merge pull request #180080 from viraptor/reaper-update
reaper: Add update script
This commit is contained in:
commit
52bbd5121b
2 changed files with 24 additions and 1 deletions
|
@ -17,12 +17,15 @@
|
|||
, 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";
|
||||
in
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "reaper";
|
||||
version = "6.66";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://www.reaper.fm/files/${lib.versions.major version}.x/reaper${builtins.replaceStrings ["."] [""] version}_linux_${stdenv.hostPlatform.qemuArch}.tar.xz";
|
||||
url = url_for_platform version stdenv.hostPlatform.qemuArch;
|
||||
hash = {
|
||||
x86_64-linux = "sha256-kMXHHd+uIc5tKlDlxKjphZsfNMYvvV/4Zx84eRwPGcs=";
|
||||
aarch64-linux = "sha256-pB3qj9CJbI5iWBNKNX2niIfHrpSz9+qotX/zKGYDwYo=";
|
||||
|
@ -75,6 +78,8 @@ stdenv.mkDerivation rec {
|
|||
runHook postInstall
|
||||
'';
|
||||
|
||||
passthru.updateScript = ./updater.sh;
|
||||
|
||||
meta = with lib; {
|
||||
description = "Digital audio workstation";
|
||||
homepage = "https://www.reaper.fm/";
|
||||
|
|
18
pkgs/applications/audio/reaper/updater.sh
Executable file
18
pkgs/applications/audio/reaper/updater.sh
Executable file
|
@ -0,0 +1,18 @@
|
|||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i bash -p curl common-updater-scripts
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
reaper_ver=$(curl -Ls https://www.reaper.fm/download.php | grep -o 'Version [0-9]\.[0-9]*' | head -n1 | cut -d' ' -f2)
|
||||
|
||||
function set_hash_for_arch() {
|
||||
local arch=$1
|
||||
pkg_hash=$(nix-prefetch-url https://www.reaper.fm/files/${reaper_ver%.*}.x/reaper${reaper_ver/./}_linux_$arch.tar.xz)
|
||||
pkg_hash=$(nix hash to-sri "sha256:$pkg_hash")
|
||||
# reset the version so the second architecture update doesn't get ignored
|
||||
update-source-version reaper 0 "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" --system=$arch-linux
|
||||
update-source-version reaper "${reaper_ver}" "$pkg_hash" --system=$arch-linux
|
||||
}
|
||||
|
||||
set_hash_for_arch aarch64
|
||||
set_hash_for_arch x86_64
|
Loading…
Reference in a new issue