base16-schemes: unstable-2024-06-21 -> unstable-2024-11-12
[NixPkgs.git] / pkgs / by-name / de / decent-sampler / package.nix
blobce7418d559a46a66e228e531a80f70390b609c82
1 { lib
2 , stdenv
3 , fetchzip
4 , fetchurl
5 , makeDesktopItem
6 , copyDesktopItems
7 , buildFHSEnv
8 , alsa-lib
9 , freetype
10 , nghttp2
11 , libX11
12 , }:
14 let
15   pname = "decent-sampler";
16   version = "1.10.0";
18   icon = fetchurl {
19     url = "https://archive.org/download/ds-256/DS256.png";
20     hash = "sha256-SV8zY5QJ6uRSrLuGTmT1zwGoIIXCV9GD2ZNiqK+i1Bc=";
21   };
23   decent-sampler = stdenv.mkDerivation {
24     inherit pname version;
26     src = fetchzip {
27       # dropbox links: https://www.dropbox.com/sh/dwyry6xpy5uut07/AABBJ84bjTTSQWzXGG5TOQpfa\
28       url = "https://archive.org/download/decent-sampler-linux-static-download-mirror/Decent_Sampler-${version}-Linux-Static-x86_64.tar.gz";
29       hash = "sha256-KYCf/F2/ziuXDHim4FPZQBARiSywvQDJBzKbHua+3SM=";
30     };
32     nativeBuildInputs = [ copyDesktopItems ];
34     desktopItems = [
35       (makeDesktopItem {
36         type = "Application";
37         name = "decent-sampler";
38         desktopName = "Decent Sampler";
39         comment = "DecentSampler player";
40         icon = "decent-sampler";
41         exec = "decent-sampler";
42         categories = [ "Audio" "AudioVideo" ];
43       })
44     ];
46     installPhase = ''
47       runHook preInstall
49       install -Dm755 DecentSampler $out/bin/decent-sampler
50       install -Dm755 DecentSampler.so -t $out/lib/vst
51       install -d "$out/lib/vst3" && cp -r "DecentSampler.vst3" $out/lib/vst3
52       install -Dm444 ${icon} $out/share/pixmaps/decent-sampler.png
54       runHook postInstall
55     '';
56   };
60 buildFHSEnv {
61   inherit (decent-sampler) pname version;
63   targetPkgs = pkgs: [
64     alsa-lib
65     decent-sampler
66     freetype
67     nghttp2
68     libX11
69   ];
71   runScript = "decent-sampler";
73   extraInstallCommands = ''
74     cp -r ${decent-sampler}/lib $out/lib
75     cp -r ${decent-sampler}/share $out/share
76   '';
78   meta = with lib; {
79     description = "Audio sample player";
80     longDescription = ''
81         Decent Sampler is an audio sample player.
82         Allowing you to play sample libraries in the DecentSampler format
83         (files with extensions: dspreset and dslibrary).
84     '';
85     mainProgram = "decent-sampler";
86     homepage = "https://www.decentsamples.com/product/decent-sampler-plugin/";
87     # It claims to be free but we currently cannot find any license
88     # that it is released under.
89     license = licenses.unfree;
90     platforms = [ "x86_64-linux" ];
91     maintainers = with maintainers; [ adam248 ];
92   };