nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at python-updates 143 lines 4.4 kB view raw
1{ 2 lib, 3 stdenv, 4 writeScript, 5 alsa-lib, 6 fetchurl, 7 libjack2, 8 libX11, 9 libXcursor, 10 libXext, 11 libXinerama, 12 libXrandr, 13 libXtst, 14 mpg123, 15 pipewire, 16 releasePath ? null, 17}: 18 19# To use the full release version: 20# 1) Sign into https://backstage.renoise.com and download the release version to some stable location. 21# 2) Override the releasePath attribute to point to the location of the newly downloaded bundle. 22# Note: Renoise creates an individual build for each license which screws somewhat with the 23# use of functions like requireFile as the hash will be different for every user. 24let 25 platforms = { 26 x86_64-linux = { 27 archSuffix = "x86_64"; 28 hash = "sha256-UxhGe22W50cqjNMoAdxHnyFmTmiysYd8EkASRFrpuYs="; 29 }; 30 aarch64-linux = { 31 archSuffix = "arm64"; 32 hash = "sha256-itWnH1JiG+AhYZtNtrJtW9p7LlRF/ab5+npFODiKznY="; 33 }; 34 }; 35 36in 37stdenv.mkDerivation rec { 38 pname = "renoise"; 39 version = "3.5.1"; 40 41 src = 42 if releasePath != null then 43 releasePath 44 else 45 let 46 platform = platforms.${stdenv.system} or (throw "unsupported system ${stdenv.hostPlatform.system}"); 47 urlVersion = lib.replaceStrings [ "." ] [ "_" ] version; 48 in 49 fetchurl { 50 urls = [ 51 "https://files.renoise.com/demo/Renoise_${urlVersion}_Demo_Linux_${platform.archSuffix}.tar.gz" 52 "https://files.renoise.com/demo/archive/Renoise_${urlVersion}_Demo_Linux_${platform.archSuffix}.tar.gz" 53 ]; 54 hash = platform.hash; 55 }; 56 57 buildInputs = [ 58 alsa-lib 59 libjack2 60 libX11 61 libXcursor 62 libXext 63 libXinerama 64 libXrandr 65 libXtst 66 pipewire 67 ]; 68 69 installPhase = '' 70 cp -r Resources $out 71 72 mkdir -p $out/lib/ 73 74 cp renoise $out/renoise 75 76 for path in ${toString buildInputs}; do 77 ln -s $path/lib/*.so* $out/lib/ 78 done 79 80 ln -s ${lib.getLib stdenv.cc.cc}/lib/libstdc++.so.6 $out/lib/ 81 82 mkdir $out/bin 83 ln -s $out/renoise $out/bin/renoise 84 85 # Desktop item 86 mkdir -p $out/share/applications 87 cp -r Installer/renoise.desktop $out/share/applications/renoise.desktop 88 89 # Desktop item icons 90 mkdir -p $out/share/icons/hicolor/{48x48,64x64,128x128}/apps 91 cp Installer/renoise-48.png $out/share/icons/hicolor/48x48/apps/renoise.png 92 cp Installer/renoise-64.png $out/share/icons/hicolor/64x64/apps/renoise.png 93 cp Installer/renoise-128.png $out/share/icons/hicolor/128x128/apps/renoise.png 94 ''; 95 96 postFixup = '' 97 patchelf \ 98 --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \ 99 --set-rpath ${mpg123}/lib:$out/lib \ 100 $out/renoise 101 102 for path in $out/AudioPluginServer*; do 103 patchelf \ 104 --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \ 105 --set-rpath $out/lib \ 106 $path 107 done 108 109 substituteInPlace $out/share/applications/renoise.desktop \ 110 --replace Exec=renoise Exec=$out/bin/renoise 111 ''; 112 113 passthru.updateScript = writeScript "update-renoise" '' 114 #!/usr/bin/env nix-shell 115 #!nix-shell -I nixpkgs=./. -i bash -p curl htmlq common-updater-scripts 116 set -euo pipefail 117 118 new_version="$( 119 curl 'https://files.renoise.com/demo/' \ 120 | htmlq a --text \ 121 | grep -E '^Renoise_([0-9]+_?)+_Demo_Linux_x86_64\.tar\.gz$' \ 122 | grep -Eo '[0-9]+(_[0-9]+)*' \ 123 | head -n1 \ 124 | tr _ . 125 )" 126 hash_x86_64="$(nix-prefetch-url "https://files.renoise.com/demo/Renoise_$(echo "$new_version" | tr . _)_Demo_Linux_x86_64.tar.gz")" 127 hash_arm64="$( nix-prefetch-url "https://files.renoise.com/demo/Renoise_$(echo "$new_version" | tr . _)_Demo_Linux_arm64.tar.gz")" 128 sri_x86_64="$(nix --extra-experimental-features nix-command hash to-sri --type sha256 "$hash_x86_64")" 129 sri_arm64="$( nix --extra-experimental-features nix-command hash to-sri --type sha256 "$hash_arm64")" 130 update-source-version renoise "$new_version" "$sri_x86_64" --system="x86_64-linux" --ignore-same-version 131 update-source-version renoise "$new_version" "$sri_arm64" --system="aarch64-linux" --ignore-same-version 132 ''; 133 134 meta = { 135 description = "Modern tracker-based DAW"; 136 homepage = "https://www.renoise.com/"; 137 sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ]; 138 license = lib.licenses.unfree; 139 maintainers = with lib.maintainers; [ uakci ]; 140 platforms = lib.attrNames platforms; 141 mainProgram = "renoise"; 142 }; 143}