38 # JUCE version in submodules is incompatible with GCC12
39 # See here: https://forum.juce.com/t/build-fails-on-fedora-wrong-c-version/50902/2
42 stdenv.mkDerivation rec {
43 pname = "CHOWTapeModel";
46 src = fetchFromGitHub {
47 owner = "jatinchowdhury18";
48 repo = "AnalogTapeModel";
50 sha256 = "sha256-WriHi68Y6hAsrwE+74JtVlAKUR9lfTczj6UK9h2FOGM=";
51 fetchSubmodules = true;
54 nativeBuildInputs = [ pkg-config cmake ];
89 # Link-time-optimization fails without these
91 "-DCMAKE_AR=${stdenv.cc.cc}/bin/gcc-ar"
92 "-DCMAKE_RANLIB=${stdenv.cc.cc}/bin/gcc-ranlib"
93 "-DCMAKE_NM=${stdenv.cc.cc}/bin/gcc-nm"
96 cmakeBuildType = "Release";
98 postPatch = "cd Plugin";
101 mkdir -p $out/lib/lv2 $out/lib/vst3 $out/lib/clap $out/bin $out/share/doc/CHOWTapeModel/
102 cd CHOWTapeModel_artefacts/${cmakeBuildType}
103 cp -r LV2/CHOWTapeModel.lv2 $out/lib/lv2
104 cp -r VST3/CHOWTapeModel.vst3 $out/lib/vst3
105 cp -r CLAP/CHOWTapeModel.clap $out/lib/clap
106 cp Standalone/CHOWTapeModel $out/bin
107 cp ../../../../Manual/ChowTapeManual.pdf $out/share/doc/CHOWTapeModel/
110 # JUCE dlopens these, make sure they are in rpath
111 # Otherwise, segfault will happen
112 NIX_LDFLAGS = (toString [
121 homepage = "https://github.com/jatinchowdhury18/AnalogTapeModel";
123 "Physical modelling signal processing for analog tape recording. LV2, VST3, CLAP, and standalone";
124 license = with licenses; [ gpl3Only ];
125 maintainers = with maintainers; [ magnetophon ];
126 platforms = platforms.linux;
127 # error: 'vvtanh' was not declared in this scope; did you mean 'tanh'?
128 # error: no matching function for call to 'juce::dsp::SIMDRegister<double>::SIMDRegister(xsimd::simd_batch_traits<xsimd::batch<double, 2> >::batch_bool_type)'
129 broken = stdenv.isAarch64; # since 2021-12-27 on hydra (update to 2.10): https://hydra.nixos.org/build/162558991
130 mainProgram = "CHOWTapeModel";