From 2a09a2c37e5a627044aaf90a3cb15cb9c9fd5ddf Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Tue, 24 Jan 2023 11:21:33 +0000 Subject: [PATCH] ladspa-sdk: fix cross and clean up The mkdirhier sed is no longer necessary as this string does not appear in the current Makefile. The default Make target runs tests, so we need to move that to checkPhase so it's disabled when cross-compiling. Might as well take the opportunity to enable strictDeps, but it doesn't really matter since there are no dependencies. --- .../applications/audio/ladspa-sdk/default.nix | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/audio/ladspa-sdk/default.nix b/pkgs/applications/audio/ladspa-sdk/default.nix index 47a36ed1b5df..8055683a3fcf 100644 --- a/pkgs/applications/audio/ladspa-sdk/default.nix +++ b/pkgs/applications/audio/ladspa-sdk/default.nix @@ -1,4 +1,5 @@ { lib, stdenv, fetchurl }: + stdenv.mkDerivation rec { pname = "ladspa-sdk"; version = "1.15"; @@ -7,12 +8,27 @@ stdenv.mkDerivation rec { sha256 = "1vgx54cgsnc3ncl9qbgjbmq12c444xjafjkgr348h36j16draaa2"; }; + sourceRoot = "ladspa_sdk_${version}/src"; + + strictDeps = true; + patchPhase = '' - cd src sed -i 's@/usr/@$(out)/@g' Makefile - sed -i 's@-mkdirhier@mkdir -p@g' Makefile ''; + makeFlags = [ + "CC=${stdenv.cc.targetPrefix}cc" + "CPP=${stdenv.cc.targetPrefix}c++" + ]; + + # The default target also runs tests, which we don't want to do in + # the build phase as it would break cross. + buildFlags = [ "targets" ]; + + # Tests try to create and play a sound file. Playing will fail, but + # it's probably still useful to run the part that creates the file. + doCheck = true; + meta = { description = "The SDK for the LADSPA audio plugin standard"; longDescription = ''