nova-filters: refactor

This commit is contained in:
Weijia Wang 2023-06-06 18:54:40 +03:00
parent ac6d8999f0
commit 4779646dd0
2 changed files with 36 additions and 21 deletions

View File

@ -1,33 +1,50 @@
{lib, stdenv, fetchurl, scons, boost, ladspaH, pkg-config }:
{ lib
, stdenv
, fetchurl
, scons
, boost
, ladspaH
, libcxxabi
}:
stdenv.mkDerivation {
version = "0.2-2";
stdenv.mkDerivation (finalAttrs: {
pname = "nova-filters";
version = "0.2-2";
src = fetchurl {
url = "https://klingt.org/~tim/nova-filters/nova-filters_0.2-2.tar.gz";
sha256 = "16064vvl2w5lz4xi3lyjk4xx7fphwsxc14ajykvndiz170q32s6i";
url = "https://klingt.org/~tim/nova-filters/nova-filters_${finalAttrs.version}.tar.gz";
hash = "sha256-0WgxMDjhx2b39FKRwLrm8LrTO5nS0xE7+bRwQfcmBpg=";
};
nativeBuildInputs = [ pkg-config scons ];
buildInputs = [ boost ladspaH ];
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"}"
patchPhase = ''
# remove TERM:
sed -i -e '4d' SConstruct
sed -i 's@Options@Variables@g' SConstruct
sed -i "s@-fomit-frame-pointer -ffast-math -mfpmath=sse@-I ${boost.dev}/include@g" SConstruct
sed -i "s@env.has_key('cxx')@'cxx' in env@g" SConstruct
sed -i "s@ladspa.h@${ladspaH}/include/ladspa.h@g" filters.cpp
sed -i "s@LADSPA_HINT_SAMPLE_RATE, 0, 0.5@LADSPA_HINT_SAMPLE_RATE, 0.0001, 0.5@g" filters.cpp
sed -i "s/= check/= detail::filter_base<internal_type, checked>::check/" nova/source/dsp/filter.hpp
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.linux;
platforms = platforms.unix;
};
}
})

View File

@ -33274,9 +33274,7 @@ with pkgs;
notmuch-addrlookup = callPackage ../applications/networking/mailreaders/notmuch-addrlookup { };
nova-filters = callPackage ../applications/audio/nova-filters {
boost = boost172;
};
nova-filters = callPackage ../applications/audio/nova-filters { };
nvi = callPackage ../applications/editors/nvi { };