2024-01-02 11:29:13 +00:00
{ alsa-lib
, at-spi2-core
, cmake
, curl
, dbus
, libepoxy
, fetchFromGitHub
, freeglut
, freetype
, gtk3
, lib
, libGL
, libXcursor
, libXdmcp
, libXext
, libXinerama
, libXrandr
, libXtst
, libdatrie
, libjack2
, libpsl
, libselinux
, libsepol
, libsysprof-capture
, libthai
, libuuid
, libxkbcommon
, lv2
, pcre
, pcre2
, pkg-config
, python3
, sqlite
, gcc11Stdenv
, webkitgtk
} :
let
# JUCE version in submodules is incompatible with GCC12
# See here: https://forum.juce.com/t/build-fails-on-fedora-wrong-c-version/50902/2
stdenv = gcc11Stdenv ;
in
2021-04-13 19:44:15 +00:00
stdenv . mkDerivation rec {
pname = " C H O W T a p e M o d e l " ;
2024-01-02 11:29:13 +00:00
version = " 2 . 1 1 . 4 " ;
2021-04-13 19:44:15 +00:00
src = fetchFromGitHub {
owner = " j a t i n c h o w d h u r y 1 8 " ;
repo = " A n a l o g T a p e M o d e l " ;
2021-12-30 13:39:12 +00:00
rev = " v ${ version } " ;
2024-01-02 11:29:13 +00:00
sha256 = " s h a 2 5 6 - W r i H i 6 8 Y 6 h A s r w E + 7 4 J t V l A K U R 9 l f T c z j 6 U K 9 h 2 F O G M = " ;
2021-04-13 19:44:15 +00:00
fetchSubmodules = true ;
} ;
2021-12-30 13:39:12 +00:00
nativeBuildInputs = [ pkg-config cmake ] ;
2021-04-13 19:44:15 +00:00
buildInputs = [
2021-06-28 23:13:55 +00:00
alsa-lib
2021-12-30 13:39:12 +00:00
at-spi2-core
2021-04-13 19:44:15 +00:00
curl
2021-12-30 13:39:12 +00:00
dbus
libepoxy
2021-04-13 19:44:15 +00:00
freeglut
freetype
2021-12-30 13:39:12 +00:00
gtk3
2021-04-13 19:44:15 +00:00
libGL
libXcursor
2021-12-30 13:39:12 +00:00
libXdmcp
2021-04-13 19:44:15 +00:00
libXext
libXinerama
libXrandr
2021-12-30 13:39:12 +00:00
libXtst
libdatrie
2021-04-13 19:44:15 +00:00
libjack2
2021-12-30 13:39:12 +00:00
libpsl
libselinux
libsepol
libsysprof-capture
libthai
2024-01-02 11:29:13 +00:00
libuuid
2021-12-30 13:39:12 +00:00
libxkbcommon
lv2
pcre
2024-01-02 11:29:13 +00:00
pcre2
2021-04-13 19:44:15 +00:00
python3
2021-12-30 13:39:12 +00:00
sqlite
2024-01-02 11:29:13 +00:00
webkitgtk
2021-04-13 19:44:15 +00:00
] ;
2024-01-02 11:29:13 +00:00
# Link-time-optimization fails without these
2021-12-30 13:39:12 +00:00
cmakeFlags = [
2024-01-02 11:29:13 +00:00
" - D C M A K E _ A R = ${ stdenv . cc . cc } / b i n / g c c - a r "
" - D C M A K E _ R A N L I B = ${ stdenv . cc . cc } / b i n / g c c - r a n l i b "
" - D C M A K E _ N M = ${ stdenv . cc . cc } / b i n / g c c - n m "
2021-12-30 13:39:12 +00:00
] ;
2024-01-02 11:29:13 +00:00
cmakeBuildType = " R e l e a s e " ;
2021-12-30 13:39:12 +00:00
postPatch = " c d P l u g i n " ;
2021-04-13 19:44:15 +00:00
installPhase = ''
2024-01-02 11:29:13 +00:00
mkdir - p $ out/lib/lv2 $ out/lib/vst3 $ out/lib/clap $ out/bin $ out/share/doc/CHOWTapeModel /
cd CHOWTapeModel_artefacts / $ { cmakeBuildType }
2021-12-30 13:39:12 +00:00
cp - r LV2/CHOWTapeModel.lv2 $ out/lib/lv2
cp - r VST3/CHOWTapeModel.vst3 $ out/lib/vst3
2024-01-02 11:29:13 +00:00
cp - r CLAP/CHOWTapeModel.clap $ out/lib/clap
2021-12-30 13:39:12 +00:00
cp Standalone/CHOWTapeModel $ out/bin
2021-04-13 19:44:15 +00:00
cp ../../../../Manual/ChowTapeManual.pdf $ out/share/doc/CHOWTapeModel /
'' ;
2024-01-02 11:29:13 +00:00
# JUCE dlopens these, make sure they are in rpath
# Otherwise, segfault will happen
NIX_LDFLAGS = ( toString [
" - l X 1 1 "
" - l X e x t "
" - l X c u r s o r "
" - l X i n e r a m a "
" - l X r a n d r "
] ) ;
2021-04-13 19:44:15 +00:00
meta = with lib ; {
homepage = " h t t p s : / / g i t h u b . c o m / j a t i n c h o w d h u r y 1 8 / A n a l o g T a p e M o d e l " ;
2021-12-30 13:39:12 +00:00
description =
2024-01-02 11:29:13 +00:00
" P h y s i c a l m o d e l l i n g s i g n a l p r o c e s s i n g f o r a n a l o g t a p e r e c o r d i n g . L V 2 , V S T 3 , C L A P , a n d s t a n d a l o n e " ;
2021-04-13 19:44:15 +00:00
license = with licenses ; [ gpl3Only ] ;
maintainers = with maintainers ; [ magnetophon ] ;
platforms = platforms . linux ;
2022-06-16 17:23:12 +00:00
# error: 'vvtanh' was not declared in this scope; did you mean 'tanh'?
# error: no matching function for call to 'juce::dsp::SIMDRegister<double>::SIMDRegister(xsimd::simd_batch_traits<xsimd::batch<double, 2> >::batch_bool_type)'
broken = stdenv . isAarch64 ; # since 2021-12-27 on hydra (update to 2.10): https://hydra.nixos.org/build/162558991
2021-04-13 19:44:15 +00:00
} ;
}