2023-11-17 10:32:22 +01: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:25:12 +02:00
stdenv . mkDerivation rec {
pname = " C H O W T a p e M o d e l " ;
2023-11-17 10:32:22 +01:00
version = " 2 . 1 1 . 4 " ;
2021-04-13 19:25:12 +02: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-09-05 09:07:13 +02:00
rev = " v ${ version } " ;
2023-11-17 10:32:22 +01: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:25:12 +02:00
fetchSubmodules = true ;
} ;
2021-09-05 09:07:13 +02:00
nativeBuildInputs = [ pkg-config cmake ] ;
2021-04-13 19:25:12 +02:00
buildInputs = [
2021-06-10 04:57:09 +02:00
alsa-lib
2021-09-05 09:07:13 +02:00
at-spi2-core
2021-04-13 19:25:12 +02:00
curl
2021-09-05 09:07:13 +02:00
dbus
libepoxy
2021-04-13 19:25:12 +02:00
freeglut
freetype
2021-09-05 09:07:13 +02:00
gtk3
2021-04-13 19:25:12 +02:00
libGL
libXcursor
2021-09-05 09:07:13 +02:00
libXdmcp
2021-04-13 19:25:12 +02:00
libXext
libXinerama
libXrandr
2021-09-05 09:07:13 +02:00
libXtst
libdatrie
2021-04-13 19:25:12 +02:00
libjack2
2021-09-05 09:07:13 +02:00
libpsl
libselinux
libsepol
libsysprof-capture
libthai
2023-11-17 10:32:22 +01:00
libuuid
2021-09-05 09:07:13 +02:00
libxkbcommon
lv2
pcre
2023-11-17 10:32:22 +01:00
pcre2
2021-04-13 19:25:12 +02:00
python3
2021-09-05 09:07:13 +02:00
sqlite
2023-11-17 10:32:22 +01:00
webkitgtk
2021-04-13 19:25:12 +02:00
] ;
2023-11-17 10:32:22 +01:00
# Link-time-optimization fails without these
2021-09-05 09:07:13 +02:00
cmakeFlags = [
2023-11-17 10:32:22 +01: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-09-05 09:07:13 +02:00
] ;
2023-11-17 10:32:22 +01:00
cmakeBuildType = " R e l e a s e " ;
2021-09-05 09:07:13 +02:00
postPatch = " c d P l u g i n " ;
2021-04-13 19:25:12 +02:00
installPhase = ''
2023-11-17 10:32:22 +01:00
mkdir - p $ out/lib/lv2 $ out/lib/vst3 $ out/lib/clap $ out/bin $ out/share/doc/CHOWTapeModel /
cd CHOWTapeModel_artefacts / $ { cmakeBuildType }
2021-09-05 09:07:13 +02:00
cp - r LV2/CHOWTapeModel.lv2 $ out/lib/lv2
cp - r VST3/CHOWTapeModel.vst3 $ out/lib/vst3
2023-11-17 10:32:22 +01:00
cp - r CLAP/CHOWTapeModel.clap $ out/lib/clap
2021-09-05 09:07:13 +02:00
cp Standalone/CHOWTapeModel $ out/bin
2021-04-13 19:25:12 +02:00
cp ../../../../Manual/ChowTapeManual.pdf $ out/share/doc/CHOWTapeModel /
'' ;
2023-11-17 10:32:22 +01: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:25:12 +02: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-09-05 09:07:13 +02:00
description =
2023-11-17 10:32:22 +01: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:25:12 +02:00
license = with licenses ; [ gpl3Only ] ;
maintainers = with maintainers ; [ magnetophon ] ;
platforms = platforms . linux ;
2022-05-19 21:09:42 +02: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
2024-02-11 03:19:15 +01:00
mainProgram = " C H O W T a p e M o d e l " ;
2021-04-13 19:25:12 +02:00
} ;
}