LPCNet: unbreak on clang (#403639)

Changed files
+37 -9
pkgs
by-name
lp
LPCNet
+37 -9
pkgs/by-name/lp/LPCNet/package.nix
···
codec2,
# for tests
octave,
+
sox,
}:
stdenv.mkDerivation (finalAttrs: {
···
src = fetchFromGitHub {
owner = "drowe67";
repo = "LPCNet";
-
rev = "v${finalAttrs.version}";
+
tag = "v${finalAttrs.version}";
hash = "sha256-tHZLKXmuM86A6OpfS3CRRjhFbqj1Q/w1w56msdgLHb0=";
};
+
passthru = {
# Prebuilt neural network model that is needed during the build - can be overwritten
nnmodel = fetchurl {
···
hash = "sha256-UJRAkkdR/dh/+qVoPuPd3ZN69cgzuRBMzOZdUWFJJsg=";
};
};
+
preConfigure = ''
mkdir build
cp \
···
patchShebangs *.sh unittest/*.sh
'';
-
nativeBuildInputs = [ cmake ];
-
buildInputs = [ codec2 ];
-
nativeCheckInputs = [ octave ];
+
nativeBuildInputs = [
+
cmake
+
];
+
+
buildInputs = [
+
codec2
+
];
+
+
cmakeFlags = lib.optionals (stdenv.cc.isClang && stdenv.hostPlatform.isAarch64) [
+
# unsupported option '-mfpu=' for target 'x86_64-apple-darwin'
+
"-DNEON=OFF"
+
];
+
+
nativeCheckInputs = [
+
octave
+
sox
+
];
+
+
disabledTests = lib.optionals (stdenv.cc.isClang && stdenv.hostPlatform.isAarch64) [
+
# disable tests that require NEON
+
"SIMD_functions"
+
];
doCheck = true;
-
preCheck = ''
+
checkPhase = ''
+
runHook preCheck
+
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}/build/source/build/src"
+
+
ctest -j 1 --output-on-failure -E '^${lib.concatStringsSep "|" finalAttrs.disabledTests}$'
+
+
runHook postCheck
'';
-
meta = with lib; {
+
meta = {
description = "Experimental Neural Net speech coding for FreeDV";
homepage = "https://github.com/drowe67/LPCNet";
-
license = licenses.bsd3;
-
maintainers = with maintainers; [ doronbehar ];
-
platforms = platforms.all;
+
license = lib.licenses.bsd3;
+
maintainers = with lib.maintainers; [ doronbehar ];
+
platforms = lib.platforms.all;
};
})