gnuradio: fix build on darwin

This commit is contained in:
Jiajie Chen 2022-10-25 08:31:44 +08:00
parent 7025406707
commit 4e41708518
5 changed files with 15 additions and 10 deletions

View File

@ -271,11 +271,11 @@ stdenv.mkDerivation rec {
# order to build, see https://github.com/qradiolink/qradiolink/issues/67
++ lib.optionals (hasFeature "gr-vocoder") [
"-DLIBCODEC2_FOUND=TRUE"
"-DLIBCODEC2_LIBRARIES=${codec2}/lib/libcodec2.so"
"-DLIBCODEC2_LIBRARIES=${codec2}/lib/libcodec2${stdenv.hostPlatform.extensions.sharedLibrary}"
"-DLIBCODEC2_INCLUDE_DIRS=${codec2}/include"
"-DLIBCODEC2_HAS_FREEDV_API=ON"
"-DLIBGSM_FOUND=TRUE"
"-DLIBGSM_LIBRARIES=${gsm}/lib/libgsm.so"
"-DLIBGSM_LIBRARIES=${gsm}/lib/libgsm${stdenv.hostPlatform.extensions.sharedLibrary}"
"-DLIBGSM_INCLUDE_DIRS=${gsm}/include/gsm"
]
++ lib.optionals (hasFeature "volk" && volk != null) [

View File

@ -296,7 +296,7 @@ stdenv.mkDerivation rec {
# This is the only python reference worth removing, if needed.
+ lib.optionalString (!hasFeature "python-support") ''
${removeReferencesTo}/bin/remove-references-to -t ${python} $out/lib/cmake/gnuradio/GnuradioConfig.cmake
${removeReferencesTo}/bin/remove-references-to -t ${python} $(readlink -f $out/lib/libgnuradio-runtime.so)
${removeReferencesTo}/bin/remove-references-to -t ${python} $(readlink -f $out/lib/libgnuradio-runtime${stdenv.hostPlatform.extensions.sharedLibrary})
${removeReferencesTo}/bin/remove-references-to -t ${python.pkgs.pybind11} $out/lib/cmake/gnuradio/gnuradio-runtimeTargets.cmake
''
;

View File

@ -317,7 +317,7 @@ stdenv.mkDerivation rec {
# This is the only python reference worth removing, if needed.
+ lib.optionalString (!hasFeature "python-support") ''
${removeReferencesTo}/bin/remove-references-to -t ${python} $out/lib/cmake/gnuradio/GnuradioConfig.cmake
${removeReferencesTo}/bin/remove-references-to -t ${python} $(readlink -f $out/lib/libgnuradio-runtime.so)
${removeReferencesTo}/bin/remove-references-to -t ${python} $(readlink -f $out/lib/libgnuradio-runtime${stdenv.hostPlatform.extensions.sharedLibrary})
${removeReferencesTo}/bin/remove-references-to -t ${python.pkgs.pybind11} $out/lib/cmake/gnuradio/gnuradio-runtimeTargets.cmake
''
;

View File

@ -84,7 +84,11 @@ rec {
postInstall = ""
# Gcc references
+ lib.optionalString (hasFeature "gnuradio-runtime") ''
${removeReferencesTo}/bin/remove-references-to -t ${stdenv.cc} $(readlink -f $out/lib/libgnuradio-runtime.so)
${removeReferencesTo}/bin/remove-references-to -t ${stdenv.cc} $(readlink -f $out/lib/libgnuradio-runtime${stdenv.hostPlatform.extensions.sharedLibrary})
''
# Clang references in InstalledDir
+ lib.optionalString (hasFeature "gnuradio-runtime" && stdenv.isDarwin) ''
${removeReferencesTo}/bin/remove-references-to -t ${stdenv.cc.cc} $(readlink -f $out/lib/libgnuradio-runtime${stdenv.hostPlatform.extensions.sharedLibrary})
''
;
# NOTE: Outputs are disabled due to upstream not using GNU InstallDIrs cmake
@ -112,7 +116,6 @@ rec {
doCheck = false;
meta = with lib; {
broken = stdenv.isDarwin;
description = "Software Defined Radio (SDR) software";
longDescription = ''
GNU Radio is a free & open-source software development toolkit that

View File

@ -98,19 +98,21 @@ let
"${
lib.makeSearchPath
unwrapped.qt.qtbase.qtPluginPrefix
(builtins.map lib.getBin [
(builtins.map lib.getBin ([
unwrapped.qt.qtbase
] ++ lib.optionals stdenv.isLinux [
unwrapped.qt.qtwayland
])
]))
}"
"--prefix" "QML2_IMPORT_PATH" ":"
"${
lib.makeSearchPath
unwrapped.qt.qtbase.qtQmlPrefix
(builtins.map lib.getBin [
(builtins.map lib.getBin ([
unwrapped.qt.qtbase
] ++ lib.optionals stdenv.isLinux [
unwrapped.qt.qtwayland
])
]))
}"
]
else