acr-cli: init at 0.14 (#359508)
[NixPkgs.git] / pkgs / by-name / re / redux / package.nix
blob1ddf62dd2ca2d10008b543d842c781da9533313b
1 { lib
2 , stdenv
3 , fetchurl
4 , writeScript
5 , libX11
6 , libXext
7 , alsa-lib
8 , autoPatchelfHook
9 , releasePath ? null
12 # To use the full release version (same as renoise):
13 # 1) Sign into https://backstage.renoise.com and download the release version to some stable location.
14 # 2) Override the releasePath attribute to point to the location of the newly downloaded bundle.
15 # Note: Renoise creates an individual build for each license which screws somewhat with the
16 # use of functions like requireFile as the hash will be different for every user.
18 stdenv.mkDerivation rec {
19   pname = "redux";
20   version = "1.3.5";
22   src = if releasePath != null then releasePath
23     else fetchurl {
24       urls = [
25         "https://files.renoise.com/demo/Renoise_Redux_${lib.replaceStrings ["."] ["_"] version}_Demo_Linux_x86_64.tar.gz"
26         "https://files.renoise.com/demo/archive/Renoise_Redux_${lib.replaceStrings ["."] ["_"] version}_Demo_Linux_x86_64.tar.gz"
27       ];
28       sha256 = "sha256-eznsdLzgdJ7MyWe5WAEg1MHId5VlfyanoZ6+I9nI/0I=";
29     };
31   nativeBuildInputs = [
32     autoPatchelfHook
33   ];
35   buildInputs = [
36     libX11
37     libXext
38     alsa-lib
39     (lib.getLib stdenv.cc.cc)
40   ];
42   installPhase = ''
43     runHook preInstall
45     OUTDIR=$out/lib/vst2/RenoiseRedux.vst2
46     mkdir -p $OUTDIR
47     cp -r ./renoise_redux_x86_64/* $OUTDIR
49     runHook postInstall
50   '';
53   passthru.updateScript = writeScript "update-redux" ''
54     #!/usr/bin/env nix-shell
55     #!nix-shell -I nixpkgs=./. -i bash -p curl htmlq common-updater-scripts
56     set -euo pipefail
58     new_version="$(
59       curl 'https://files.renoise.com/demo/' \
60         | htmlq a --text \
61         | grep -E '^Renoise_Redux_([0-9]+_?)+_Demo_Linux_x86_64\.tar\.gz$' \
62         | grep -Eo '[0-9]+(_[0-9]+)*' \
63         | head -n1 \
64         | tr _ .
65     )"
66     update-source-version redux "$new_version" --system="x86_64-linux"
67   '';
69   meta = with lib; {
70     description = "Sample-based instrument, with a powerful phrase sequencer";
71     homepage = "https://www.renoise.com/products/redux";
72     sourceProvenance = with sourceTypes; [ binaryNativeCode ];
73     license = licenses.unfree;
74     maintainers = with maintainers; [ mihnea-s ];
75     platforms = [ "x86_64-linux" ];
76   };