treewide: use `addBinToPathHook`, minor cleanups (#379187)
[NixPkgs.git] / pkgs / by-name / fa / faustPhysicalModeling / package.nix
blob4ffa2d799996e638c6f8423772f81cceeb6b6581
2   stdenv,
3   lib,
4   bash,
5   fetchFromGitHub,
6   faust2jaqt,
7   faust2lv2,
8 }:
9 stdenv.mkDerivation rec {
10   pname = "faustPhysicalModeling";
11   version = "2.77.3";
13   src = fetchFromGitHub {
14     owner = "grame-cncm";
15     repo = "faust";
16     rev = version;
17     sha256 = "sha256-CADiJXyB4FivQjbh1nhpAVgCkTi1pW/vtXKXfL7o7xU=";
18   };
20   nativeBuildInputs = [
21     faust2jaqt
22     faust2lv2
23   ];
25   buildInputs = [
26     bash
27   ];
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" ];
33   dontWrapQtApps = true;
35   buildPhase = ''
36     runHook preBuild
38     cd examples/physicalModeling
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
45     runHook postBuild
46   '';
48   installPhase = ''
49     runHook preInstall
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
58     runHook postInstall
59   '';
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   };