1{
2 stdenv,
3 lib,
4 bash,
5 fetchFromGitHub,
6 faust2jaqt,
7 faust2lv2,
8}:
9stdenv.mkDerivation rec {
10 pname = "faustPhysicalModeling";
11 version = "2.79.3";
12
13 src = fetchFromGitHub {
14 owner = "grame-cncm";
15 repo = "faust";
16 rev = version;
17 sha256 = "sha256-j5ADlKZriwLARpEJ/4xgvyAhF5ld9Hl2gXZS3NPJJj8=";
18 };
19
20 nativeBuildInputs = [
21 faust2jaqt
22 faust2lv2
23 ];
24
25 buildInputs = [
26 bash
27 ];
28
29 # ld: /nix/store/*-gcc-14-20241116/lib/gcc/x86_64-unknown-linux-gnu/14.2.1/crtbegin.o:
30 # relocation R_X86_64_32 against hidden symbol `__TMC_END__' can not be used when making a PIE object
31 hardeningDisable = [ "pie" ];
32
33 dontWrapQtApps = true;
34
35 buildPhase = ''
36 runHook preBuild
37
38 cd examples/physicalModeling
39
40 for f in *MIDI.dsp; do
41 faust2jaqt -time -vec -double -midi -nvoices 16 -t 99999 $f
42 faust2lv2 -time -vec -double -gui -nvoices 16 -t 99999 $f
43 done
44
45 runHook postBuild
46 '';
47
48 installPhase = ''
49 runHook preInstall
50
51 mkdir -p $out/lib/lv2 $out/bin
52 mv *.lv2/ $out/lib/lv2
53 for f in $(find . -executable -type f); do
54 cp $f $out/bin/
55 done
56 patchShebangs --host $out/bin
57
58 runHook postInstall
59 '';
60
61 meta = with lib; {
62 description = "Physical models included with faust compiled as jack standalone and lv2 instruments";
63 homepage = "https://github.com/grame-cncm/faust/tree/master-dev/examples/physicalModeling";
64 license = licenses.mit;
65 platforms = platforms.linux;
66 maintainers = with maintainers; [ magnetophon ];
67 # compiles stuff for the build platform, difficult to do properly
68 broken = stdenv.hostPlatform != stdenv.buildPlatform;
69 };
70}