summary refs log tree commit diff
path: root/pkgs/applications/audio/nova-filters/default.nix
blob: 1c457c8a0e7b7f81e625214cf185558d53682691 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
{ lib
, stdenv
, fetchurl
, scons
, boost
, ladspaH
, libcxxabi
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "nova-filters";
  version = "0.2-2";

  src = fetchurl {
    url = "https://klingt.org/~tim/nova-filters/nova-filters_${finalAttrs.version}.tar.gz";
    hash = "sha256-0WgxMDjhx2b39FKRwLrm8LrTO5nS0xE7+bRwQfcmBpg=";
  };

  postPatch = ''
    substituteInPlace SConstruct \
      --replace "'TERM' : os.environ['TERM']," "" \
      --replace "Options" "Variables" \
      --replace "-fomit-frame-pointer -ffast-math -mfpmath=sse" "-I${boost.dev}/include -I${ladspaH}/include" \
      --replace "env.has_key('cxx')" "True" \
      --replace "env['cxx']" "'${stdenv.cc.targetPrefix}c++'" \
      --replace "-Wl,--strip-all" "${lib.optionalString stdenv.isDarwin "-L${libcxxabi}/lib"}"

    substituteInPlace filters.cpp \
      --replace "LADSPA_HINT_SAMPLE_RATE, 0, 0.5" "LADSPA_HINT_SAMPLE_RATE, 0.0001, 0.5"

    substituteInPlace nova/source/dsp/filter.hpp \
      --replace "= check" "= detail::filter_base<internal_type, checked>::check"

    substituteInPlace nova/source/primitives/float.hpp \
      --replace "boost/detail/endian.hpp" "boost/predef/other/endian.h" \
      --replace "BOOST_LITTLE_ENDIAN" "BOOST_ENDIAN_LITTLE_BYTE"
  '';

  nativeBuildInputs = [
    scons
  ];

  meta = with lib; {
    description = "LADSPA plugins based on filters of nova";
    homepage = "http://klingt.org/~tim/nova-filters/";
    license = licenses.gpl2Plus;
    maintainers = [ maintainers.magnetophon ];
    platforms = platforms.unix;
  };
})