ffado: support cross compilation (#334096)
This commit is contained in:
@@ -49,13 +49,25 @@ stdenv.mkDerivation rec {
|
||||
prePatch = ''
|
||||
substituteInPlace ./support/tools/ffado-diag.in \
|
||||
--replace /lib/modules/ "/run/booted-system/kernel-modules/lib/modules/"
|
||||
|
||||
# prevent build tools from leaking into closure
|
||||
substituteInPlace support/tools/SConscript --replace-fail \
|
||||
'support/tools/ffado-diag --static' \
|
||||
"echo '"'See `nix-store --query --tree ${placeholder "out"}`.'"'"
|
||||
'' + lib.optionalString (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
|
||||
# skip the CC sanity check, since that requires invoking cross-compiled binaries during build
|
||||
substituteInPlace SConstruct \
|
||||
--replace-fail 'conf.CompilerCheck()' 'True' \
|
||||
--replace-fail "pkg-config" "$PKG_CONFIG"
|
||||
substituteInPlace admin/pkgconfig.py \
|
||||
--replace-fail "pkg-config" "$PKG_CONFIG"
|
||||
'';
|
||||
|
||||
nativeBuildInputs =
|
||||
[
|
||||
(scons.override {
|
||||
# SConstruct script depends on distutils removed in Python 3.12
|
||||
python3Packages = python311.pkgs;
|
||||
python3Packages = python311.pythonOnBuildForHost.pkgs;
|
||||
})
|
||||
pkg-config
|
||||
which
|
||||
@@ -68,6 +80,8 @@ stdenv.mkDerivation rec {
|
||||
|
||||
prefixKey = "PREFIX=";
|
||||
sconsFlags = [
|
||||
"CUSTOM_ENV=True" # tell SConstruct to use nixpkgs' CC/CXX/CFLAGS
|
||||
"DETECT_USERSPACE_ENV=False"
|
||||
"DEBUG=False"
|
||||
"ENABLE_ALL=True"
|
||||
"BUILD_TESTS=True"
|
||||
@@ -97,11 +111,7 @@ stdenv.mkDerivation rec {
|
||||
|
||||
enableParallelBuilding = true;
|
||||
dontWrapQtApps = true;
|
||||
|
||||
postInstall = ''
|
||||
# prevent build tools from leaking into closure
|
||||
echo 'See `nix-store --query --tree ${placeholder "out"}`.' > $out/lib/libffado/static_info.txt
|
||||
'';
|
||||
strictDeps = true;
|
||||
|
||||
preFixup = lib.optionalString withMixer ''
|
||||
wrapQtApp "$bin/bin/ffado-mixer"
|
||||
|
||||
Reference in New Issue
Block a user