gnuradio: fix cross compilation

This commit is contained in:
Doron Behar
2025-08-16 22:40:36 +03:00
parent 237e7a71ac
commit f198a8a111
2 changed files with 10 additions and 2 deletions
+3 -1
View File
@@ -67,7 +67,7 @@ let
# when gr-qtgui is disabled, icu needs to be included, otherwise
# building with boost 1.7x fails
++ lib.optionals (!(hasFeature "gr-qtgui")) [ icu ];
pythonNative = with python.pkgs; [
pythonNative = with python.pythonOnBuildForHost.pkgs; [
mako
six
];
@@ -337,6 +337,8 @@ stdenv.mkDerivation (
# This is the only python reference worth removing, if needed.
+ lib.optionalString (!hasFeature "python-support") ''
remove-references-to -t ${python} $out/lib/cmake/gnuradio/GnuradioConfig.cmake
''
+ lib.optionalString (!hasFeature "python-support" && hasFeature "gnuradio-runtime") ''
remove-references-to -t ${python} $(readlink -f $out/lib/libgnuradio-runtime${stdenv.hostPlatform.extensions.sharedLibrary})
remove-references-to -t ${python.pkgs.pybind11} $out/lib/cmake/gnuradio/gnuradio-runtimeTargets.cmake
'';
+7 -1
View File
@@ -24,6 +24,7 @@ let
minor = builtins.elemAt (lib.splitVersion version) 2;
patch = builtins.elemAt (lib.splitVersion version) 3;
};
cross = stdenv.hostPlatform != stdenv.buildPlatform;
in
{
src =
@@ -57,7 +58,12 @@ in
))
) featuresInfo
);
cmakeFlags = lib.mapAttrsToList (
cmakeFlags = [
# https://pybind11.readthedocs.io/en/stable/changelog.html#version-2-13-0-june-25-2024
(lib.cmakeBool "CMAKE_CROSSCOMPILING" cross)
(lib.cmakeBool "PYBIND11_USE_CROSSCOMPILING" (cross && hasFeature "gnuradio-runtime"))
]
++ lib.mapAttrsToList (
feat: info:
(
if feat == "basic" then