1{
2 lib,
3 stdenv,
4 unzip,
5 fetchurl,
6}:
7
8# Upstream changes files in-place, to update:
9# 1. Check latest version at http://www.un4seen.com/
10# 2. Update `version`s and `hash` sums.
11# See also http://www.un4seen.com/forum/?topic=18614.0
12
13# Internet Archive used due to upstream URLs being unstable
14
15let
16 allBass = {
17 bass = {
18 h = "bass.h";
19 version = "2.4.17";
20 so = {
21 i686_linux = "libs/x86/libbass.so";
22 x86_64-linux = "libs/x86_64/libbass.so";
23 armv7l-linux = "libs/armhf/libbass.so";
24 aarch64-linux = "libs/aarch64/libbass.so";
25 };
26 url = "https://web.archive.org/web/20240501180538/http://www.un4seen.com/files/bass24-linux.zip";
27 hash = "sha256-/JAlvtZtnzuzZjWy3n1WT8Q5ZVLO0BJJAJT7/dELS3o=";
28 };
29
30 bass_fx = {
31 h = "C/bass_fx.h";
32 version = "2.4.12.1";
33 so = {
34 i686_linux = "libs/x86/libbass_fx.so";
35 x86_64-linux = "libs/x86_64/libbass_fx.so";
36 armv7l-linux = "libs/armhf/libbass_fx.so";
37 aarch64-linux = "libs/aarch64/libbass_fx.so";
38 };
39 url = "https://web.archive.org/web/20240926184106/https://www.un4seen.com/files/z/0/bass_fx24-linux.zip";
40 hash = "sha256-Hul2ELwnaDV8TDRMDXoFisle31GATDkf3PdkR2K9QTs=";
41 };
42
43 bassmidi = {
44 h = "bassmidi.h";
45 version = "2.4.15.3";
46 so = {
47 i686_linux = "libs/x86/libbassmidi.so";
48 x86_64-linux = "libs/x86_64/libbassmidi.so";
49 armv7l-linux = "libs/armhf/libbassmidi.so";
50 aarch64-linux = "libs/aarch64/libbassmidi.so";
51 };
52 url = "https://web.archive.org/web/20240501180447/http://www.un4seen.com/files/bassmidi24-linux.zip";
53 hash = "sha256-HrF1chhGk32bKN3jwal44Tz/ENGe/zORsrLPeGAv1OE=";
54 };
55
56 bassmix = {
57 h = "bassmix.h";
58 version = "2.4.12";
59 so = {
60 i686_linux = "libs/x86/libbassmix.so";
61 x86_64-linux = "libs/x86_64/libbassmix.so";
62 armv7l-linux = "libs/armhf/libbassmix.so";
63 aarch64-linux = "libs/aarch64/libbassmix.so";
64 };
65 url = "https://web.archive.org/web/20240930183631/https://www.un4seen.com/files/bassmix24-linux.zip";
66 hash = "sha256-oxxBhsjeLvUodg2SOMDH4wUy5na3nxLTqYkB+iXbOgA=";
67 };
68 };
69
70 dropBass =
71 name: bass:
72 stdenv.mkDerivation {
73 pname = "lib${name}";
74 inherit (bass) version;
75
76 src = fetchurl {
77 inherit (bass) hash url;
78 };
79
80 unpackCmd = ''
81 mkdir out
82 ${unzip}/bin/unzip $curSrc -d out
83 '';
84
85 lpropagatedBuildInputs = [ unzip ];
86 dontBuild = true;
87 installPhase =
88 let
89 so =
90 if bass.so ? ${stdenv.hostPlatform.system} then
91 bass.so.${stdenv.hostPlatform.system}
92 else
93 throw "${name} not packaged for ${stdenv.hostPlatform.system} (yet).";
94 in
95 ''
96 mkdir -p $out/{lib,include}
97 install -m644 -t $out/lib/ ${so}
98 install -m644 -t $out/include/ ${bass.h}
99 '';
100
101 meta = with lib; {
102 description = "Shareware audio library";
103 homepage = "https://www.un4seen.com/";
104 license = licenses.unfreeRedistributable;
105 platforms = builtins.attrNames bass.so;
106 maintainers = with maintainers; [ poz ];
107 };
108 };
109
110in
111lib.mapAttrs dropBass allBass