heroic: use qt6 version of kdialog (#372495)
[NixPkgs.git] / pkgs / by-name / jc / jconvolver / package.nix
blob8ccf37a79f68ed2dd31b90acca2564e1615ea73f
2   lib,
3   stdenv,
4   fetchurl,
5   flac,
6   unzip,
7   fftwFloat,
8   hybridreverb2,
9   libclthreads,
10   libjack2,
11   libsndfile,
12   zita-convolver,
15 stdenv.mkDerivation rec {
16   pname = "jconvolver";
17   version = "1.1.0";
19   src = fetchurl {
20     url = "https://kokkinizita.linuxaudio.org/linuxaudio/downloads/${pname}-${version}.tar.bz2";
21     sha256 = "03fq1rk5wyn32w0aaa9vqijnw9x9i0i7sv4nhsf949bk5lvi2nmc";
22   };
24   reverbs = fetchurl {
25     url = "http://kokkinizita.linuxaudio.org/linuxaudio/downloads/jconvolver-reverbs.tar.bz2";
26     sha256 = "127aj211xfqp37c94d9cn0mmwzbjkj3f6br5gr67ckqirvsdkndi";
27   };
28   weird = fetchurl {
29     url = "http://kokkinizita.linuxaudio.org/linuxaudio/downloads/weird.wav";
30     sha256 = "14xchdikx5k8zlgwglrqi168vki3n3rwhn73dkbj5qwh2ndrlyrc";
31   };
33   porihall-sf = fetchurl {
34     url = "http://legacy.spa.aalto.fi/projects/poririrs/wavs/sndfld.zip";
35     sha256 = "0z1kmdin3vcy6wmnym9jlfh8hwvci9404hff02cb98iw2slxid42";
36   };
37   porihall-bd = fetchurl {
38     url = "http://legacy.spa.aalto.fi/projects/poririrs/wavs/bin_dfeq.zip";
39     sha256 = "03m2brfxs851sag4z7kd71h6anv6hj34zcambwib0v1byg8vyplp";
40   };
41   porihall-c = fetchurl {
42     url = "http://legacy.spa.aalto.fi/projects/poririrs/wavs/cardioid.zip";
43     sha256 = "0ilbfvb2kvg5z6zi0mf2k4n0vgpir3iz5fa53xw92c07fs0cx36w";
44   };
46   spacenet-hm2 = fetchurl {
47     url = "https://webfiles.york.ac.uk/OPENAIR/IRs/hamilton-mausoleum/b-format/hm2_000_bformat_48k.wav";
48     sha256 = "1icnzfzq3mccbmnvmvh22mw8g8dci4i9h7lgrpmycj58v3gnb1p5";
49   };
50   spacenet-lyd3 = fetchurl {
51     url = "https://webfiles.york.ac.uk/OPENAIR/IRs/st-andrews-church/b-format/lyd3_000_bformat_48k.wav";
52     sha256 = "144cc0i91q5i72lwbxydx3nvxrd12j7clxjhwa2b8sf69ypz58wd";
53   };
54   spacenet-mh3 = fetchurl {
55     url = "https://webfiles.york.ac.uk/OPENAIR/IRs/maes-howe/b-format/mh3_000_bformat_48k.wav";
56     sha256 = "1c6v9jlm88l1sx2383yivycdrs9jqfsfx8cpbkjg19v2x1dfns0b";
57   };
58   spacenet-minster1 = fetchurl {
59     url = "https://webfiles.york.ac.uk/OPENAIR/IRs/york-minster/b-format/minster1_bformat_48k.wav";
60     sha256 = "1cs26pawjkv6qvwhfirfvzh21xvnmx8yh7f4xcr79cxv5c6hhnrw";
61   };
63   nativeBuildInputs = [
64     flac
65     unzip
66   ];
68   buildInputs = [
69     fftwFloat
70     hybridreverb2
71     libclthreads
72     libjack2
73     libsndfile
74     zita-convolver
75   ];
77   outputs = [
78     "bin"
79     "out"
80     "doc"
81   ];
83   preConfigure = ''
84     cd source
85   '';
87   makeFlags = [
88     "PREFIX=$(bin)"
89   ];
91   postInstall = ''
92     mkdir -p $doc/share/doc/jconvolver
93     cp -r ../[A-Z]* $doc/share/doc/jconvolver/
95     mkdir -p $out/share/jconvolver
96     cp -r ../config-files $out/share/jconvolver/
97     cd $out/share/jconvolver
98     for conf in */*.conf */*/*.conf; do
99       if grep -q /audio/ $conf; then
100         substituteInPlace $conf --replace /audio/ $out/share/jconvolver/
101       fi
102     done
103     substituteInPlace config-files/xtalk-cancel/EYCv2-44.conf --replace /cd "#/cd"
104     ln -s ${weird} config-files/weird.wav
106     tar xf ${reverbs}
107     cd reverbs
108     unzip -d porihall ${porihall-sf} s1_r4_sf.wav
109     unzip -d porihall ${porihall-bd} s1_r3_bd.wav
110     unzip -d porihall ${porihall-c} s1_r3_c.wav
112     mkdir spacenet
113     ln -s ${spacenet-hm2} spacenet/HM2_000_WXYZ_48k.amb
114     ln -s ${spacenet-lyd3} spacenet/Lyd3_000_WXYZ_48k.amb
115     ln -s ${spacenet-mh3} spacenet/MH3_000_WXYZ_48k.amb
116     ln -s ${spacenet-minster1} spacenet/Minster1_000_WXYZ_48k.amb
118     mkdir -p hybridreverb-database/large_concert_hall/music/8m
119     for flac in ${hybridreverb2}/share/HybridReverb2/RIR_Database/large_concert_hall/music/8m/*.flac; do
120       flac --output-prefix=hybridreverb-database/large_concert_hall/music/8m/ -d $flac
121     done
122   '';
124   enableParallelBuilding = true;
126   meta = with lib; {
127     description = "JACK client and audio file convolver with reverb samples";
128     homepage = "https://kokkinizita.linuxaudio.org/linuxaudio/";
129     license = licenses.gpl2Plus;
130     maintainers = with maintainers; [ orivej ];
131     platforms = platforms.linux;
132   };