Merge pull request #160121 from doronbehar/pkg/gnuradio/update

authored by Doron Behar and committed by GitHub 951c9167 5a4251a7

+126 -42
+48 -29
pkgs/applications/radio/gnss-sdr/default.nix
··· 7 , gtest 8 , openssl 9 , gflags 10 - , gnuradio3_8 11 , thrift 12 - , libpcap 13 , orc 14 , pkg-config 15 - , uhd 16 - , log4cpp 17 , blas, lapack 18 , matio 19 , pugixml 20 , protobuf 21 }: 22 23 - gnuradio3_8.pkgs.mkDerivation rec { 24 pname = "gnss-sdr"; 25 - # There's an issue with cpufeatures on 0.0.15, see: 26 - # https://github.com/NixOS/nixpkgs/pull/142557#issuecomment-950217925 27 - version = "0.0.13"; 28 29 src = fetchFromGitHub { 30 owner = "gnss-sdr"; 31 repo = "gnss-sdr"; 32 rev = "v${version}"; 33 - sha256 = "0a3k47fl5dizzhbqbrbmckl636lznyjby2d2nz6fz21637hvrnby"; 34 }; 35 36 nativeBuildInputs = [ 37 cmake 38 - gnuradio3_8.unwrapped.python 39 - gnuradio3_8.unwrapped.python.pkgs.Mako 40 - gnuradio3_8.unwrapped.python.pkgs.six 41 ]; 42 43 buildInputs = [ 44 gmp 45 armadillo 46 - gnuradio3_8.unwrapped.boost 47 glog 48 - gtest 49 openssl 50 - gflags 51 orc 52 - # UHD support is optional, but gnuradio is built with it, so there's 53 - # nothing to be gained by leaving it out. 54 - gnuradio3_8.unwrapped.uhd 55 - log4cpp 56 blas lapack 57 matio 58 pugixml 59 protobuf 60 - gnuradio3_8.pkgs.osmosdr 61 libpcap 62 - ] ++ lib.optionals (gnuradio3_8.hasFeature "gr-ctrlport") [ 63 thrift 64 - gnuradio3_8.unwrapped.python.pkgs.thrift 65 ]; 66 67 cmakeFlags = [ 68 - "-DGFlags_ROOT_DIR=${gflags}/lib" 69 "-DGLOG_INCLUDE_DIR=${glog}/include" 70 "-DENABLE_UNIT_TESTING=OFF" 71 72 # gnss-sdr doesn't truly depend on BLAS or LAPACK, as long as 73 # armadillo is built using both, so skip checking for them. 74 - "-DBLAS=YES" 75 - "-DLAPACK=YES" 76 "-DBLAS_LIBRARIES=-lblas" 77 "-DLAPACK_LIBRARIES=-llapack" 78 - 79 - # Similarly, it doesn't actually use gfortran despite checking for 80 - # its presence. 81 - "-DGFORTRAN=YES" 82 ]; 83 84 meta = with lib; {
··· 7 , gtest 8 , openssl 9 , gflags 10 + , gnuradio 11 , thrift 12 + , enableRawUdp ? true, libpcap 13 , orc 14 , pkg-config 15 , blas, lapack 16 , matio 17 , pugixml 18 , protobuf 19 }: 20 21 + gnuradio.pkgs.mkDerivation rec { 22 pname = "gnss-sdr"; 23 + version = "0.0.16"; 24 25 src = fetchFromGitHub { 26 owner = "gnss-sdr"; 27 repo = "gnss-sdr"; 28 rev = "v${version}"; 29 + sha256 = "sha256-ODe4k6PDGtDX11FrbggEbN3tc4UtATaItUIpCKl4JjM="; 30 }; 31 32 + patches = [ 33 + # Use the relative install location for volk_gnsssdr_module and 34 + # cpu_features which is bundled in the source. NOTE: Perhaps this patch 35 + # should be sent upstream. 36 + ./fix_libcpu_features_install_path.patch 37 + ]; 38 + 39 nativeBuildInputs = [ 40 cmake 41 + pkg-config 42 + gnuradio.unwrapped.python 43 + gnuradio.unwrapped.python.pkgs.Mako 44 + gnuradio.unwrapped.python.pkgs.six 45 + ]; 46 + checkInputs = [ 47 + gtest 48 ]; 49 50 buildInputs = [ 51 gmp 52 armadillo 53 glog 54 + gflags 55 openssl 56 orc 57 blas lapack 58 matio 59 pugixml 60 protobuf 61 + gnuradio.unwrapped.boost 62 + ] ++ lib.optionals (gnuradio.hasFeature "gr-uhd") [ 63 + gnuradio.unwrapped.uhd 64 + ] ++ (if (lib.versionAtLeast gnuradio.unwrapped.versionAttr.major "3.10") then [ 65 + gnuradio.unwrapped.spdlog 66 + ] else [ 67 + gnuradio.unwrapped.log4cpp 68 + ]) ++ lib.optionals (enableRawUdp) [ 69 libpcap 70 + ] ++ lib.optionals (gnuradio.hasFeature "gr-ctrlport") [ 71 thrift 72 + gnuradio.unwrapped.python.pkgs.thrift 73 + ] ++ lib.optionals (gnuradio.hasFeature "gr-pdu" || gnuradio.hasFeature "gr-iio") [ 74 + gnuradio.unwrapped.libiio 75 + ] ++ lib.optionals (gnuradio.hasFeature "gr-pdu") [ 76 + gnuradio.unwrapped.libad9361 77 ]; 78 79 cmakeFlags = [ 80 + "-DGFlags_INCLUDE_DIRS=${gflags}/include" 81 "-DGLOG_INCLUDE_DIR=${glog}/include" 82 + # Should use .dylib if darwin support is requested 83 + "-DGFlags_LIBS=${gflags}/lib/libgflags.so" 84 + "-DGLOG_LIBRARIES=${glog}/lib/libglog.so" 85 + # Use our dependencies glog, gflags and armadillo dependencies 86 + "-DENABLE_OWN_GLOG=OFF" 87 + "-DENABLE_OWN_ARMADILLO=OFF" 88 + "-DENABLE_ORC=ON" 89 + "-DENABLE_LOG=ON" 90 + "-DENABLE_RAW_UDP=${if enableRawUdp then "ON" else "OFF"}" 91 + "-DENABLE_UHD=${if (gnuradio.hasFeature "gr-uhd") then "ON" else "OFF"}" 92 + "-DENABLE_FMCOMMS2=${if (gnuradio.hasFeature "gr-iio" && gnuradio.hasFeature "gr-pdu") then "ON" else "OFF"}" 93 + "-DENABLE_PLUTOSDR=${if (gnuradio.hasFeature "gr-iio") then "ON" else "OFF"}" 94 + "-DENABLE_AD9361=${if (gnuradio.hasFeature "gr-pdu") then "ON" else "OFF"}" 95 "-DENABLE_UNIT_TESTING=OFF" 96 97 # gnss-sdr doesn't truly depend on BLAS or LAPACK, as long as 98 # armadillo is built using both, so skip checking for them. 99 "-DBLAS_LIBRARIES=-lblas" 100 "-DLAPACK_LIBRARIES=-llapack" 101 ]; 102 103 meta = with lib; {
+47
pkgs/applications/radio/gnss-sdr/fix_libcpu_features_install_path.patch
···
··· 1 + --- a/CMakeLists.txt 1970-01-01 08:00:01.000000000 +0800 2 + +++ b/CMakeLists.txt 2022-02-16 20:41:53.725290020 +0800 3 + @@ -1214,7 +1214,7 @@ 4 + BINARY_DIR ${CMAKE_BINARY_DIR}/volk_gnsssdr_module/build 5 + CMAKE_ARGS ${VOLK_GNSSSDR_CMAKE_ARGS} 6 + -DCMAKE_BUILD_TYPE=$<$<CONFIG:None>:None>$<$<CONFIG:Debug>:Debug>$<$<CONFIG:Release>:Release>$<$<CONFIG:RelWithDebInfo>:RelWithDebInfo>$<$<CONFIG:MinSizeRel>:MinSizeRel>$<$<CONFIG:NoOptWithASM>:NoOptWithASM>$<$<CONFIG:Coverage>:Coverage>$<$<CONFIG:O2WithASM>:O2WithASM>$<$<CONFIG:O3WithASM>:O3WithASM>$<$<CONFIG:ASAN>:ASAN> 7 + - -DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR} 8 + + -DCMAKE_INSTALL_LIBDIR=lib 9 + DOWNLOAD_COMMAND "" 10 + UPDATE_COMMAND "" 11 + PATCH_COMMAND "" 12 + @@ -1247,7 +1247,7 @@ 13 + ) 14 + set(VOLK_GNSSSDR_BUILD_BYPRODUCTS 15 + ${VOLK_GNSSSDR_BUILD_BYPRODUCTS} 16 + - ${CMAKE_BINARY_DIR}/volk_gnsssdr_module/install/${CMAKE_INSTALL_LIBDIR}/${CMAKE_FIND_LIBRARY_PREFIXES}cpu_features${CMAKE_STATIC_LIBRARY_SUFFIX} 17 + + ${CMAKE_BINARY_DIR}/volk_gnsssdr_module/install/lib/${CMAKE_FIND_LIBRARY_PREFIXES}cpu_features${CMAKE_STATIC_LIBRARY_SUFFIX} 18 + ) 19 + endif() 20 + ExternalProject_Add(volk_gnsssdr_module 21 + @@ -1256,7 +1256,7 @@ 22 + BINARY_DIR ${CMAKE_BINARY_DIR}/volk_gnsssdr_module/build 23 + CMAKE_ARGS ${VOLK_GNSSSDR_CMAKE_ARGS} 24 + -DCMAKE_BUILD_TYPE=$<$<CONFIG:None>:None>$<$<CONFIG:Debug>:Debug>$<$<CONFIG:Release>:Release>$<$<CONFIG:RelWithDebInfo>:RelWithDebInfo>$<$<CONFIG:MinSizeRel>:MinSizeRel>$<$<CONFIG:NoOptWithASM>:NoOptWithASM>$<$<CONFIG:Coverage>:Coverage>$<$<CONFIG:O2WithASM>:O2WithASM>$<$<CONFIG:O3WithASM>:O3WithASM>$<$<CONFIG:ASAN>:ASAN> 25 + - -DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR} 26 + + -DCMAKE_INSTALL_LIBDIR=lib 27 + DOWNLOAD_COMMAND "" 28 + UPDATE_COMMAND "" 29 + PATCH_COMMAND "" 30 + @@ -1271,7 +1271,7 @@ 31 + BINARY_DIR ${CMAKE_BINARY_DIR}/volk_gnsssdr_module/build 32 + CMAKE_ARGS ${VOLK_GNSSSDR_CMAKE_ARGS} 33 + -DCMAKE_BUILD_TYPE=$<$<CONFIG:None>:None>$<$<CONFIG:Debug>:Debug>$<$<CONFIG:Release>:Release>$<$<CONFIG:RelWithDebInfo>:RelWithDebInfo>$<$<CONFIG:MinSizeRel>:MinSizeRel>$<$<CONFIG:NoOptWithASM>:NoOptWithASM>$<$<CONFIG:Coverage>:Coverage>$<$<CONFIG:O2WithASM>:O2WithASM>$<$<CONFIG:O3WithASM>:O3WithASM>$<$<CONFIG:ASAN>:ASAN> 34 + - -DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR} 35 + + -DCMAKE_INSTALL_LIBDIR=lib 36 + DOWNLOAD_COMMAND "" 37 + UPDATE_COMMAND "" 38 + PATCH_COMMAND "" 39 + @@ -1310,7 +1310,7 @@ 40 + if(CMAKE_VERSION VERSION_GREATER 3.0 AND SUPPORTED_CPU_FEATURES_ARCH) 41 + if(NOT CpuFeatures_FOUND) 42 + set_target_properties(Volkgnsssdr::volkgnsssdr PROPERTIES 43 + - INTERFACE_LINK_LIBRARIES ${CMAKE_BINARY_DIR}/volk_gnsssdr_module/install/${CMAKE_INSTALL_LIBDIR}/${CMAKE_FIND_LIBRARY_PREFIXES}cpu_features${CMAKE_STATIC_LIBRARY_SUFFIX} 44 + + INTERFACE_LINK_LIBRARIES ${CMAKE_BINARY_DIR}/volk_gnsssdr_module/install/lib/${CMAKE_FIND_LIBRARY_PREFIXES}cpu_features${CMAKE_STATIC_LIBRARY_SUFFIX} 45 + ) 46 + endif() 47 + endif()
+5 -1
pkgs/applications/radio/gnuradio/3.8.nix
··· 251 ]; 252 passthru = shared.passthru // { 253 # Deps that are potentially overriden and are used inside GR plugins - the same version must 254 - inherit boost volk; 255 } // lib.optionalAttrs (hasFeature "gr-uhd") { 256 inherit uhd; 257 } // lib.optionalAttrs (hasFeature "gr-qtgui") {
··· 251 ]; 252 passthru = shared.passthru // { 253 # Deps that are potentially overriden and are used inside GR plugins - the same version must 254 + inherit 255 + boost 256 + volk 257 + log4cpp 258 + ; 259 } // lib.optionalAttrs (hasFeature "gr-uhd") { 260 inherit uhd; 261 } // lib.optionalAttrs (hasFeature "gr-qtgui") {
+5 -1
pkgs/applications/radio/gnuradio/3.9.nix
··· 275 ]; 276 passthru = shared.passthru // { 277 # Deps that are potentially overriden and are used inside GR plugins - the same version must 278 - inherit boost volk; 279 } // lib.optionalAttrs (hasFeature "gr-uhd") { 280 inherit uhd; 281 } // lib.optionalAttrs (hasFeature "gr-qtgui") {
··· 275 ]; 276 passthru = shared.passthru // { 277 # Deps that are potentially overriden and are used inside GR plugins - the same version must 278 + inherit 279 + boost 280 + volk 281 + log4cpp 282 + ; 283 } // lib.optionalAttrs (hasFeature "gr-uhd") { 284 inherit uhd; 285 } // lib.optionalAttrs (hasFeature "gr-qtgui") {
+9 -3
pkgs/applications/radio/gnuradio/default.nix
··· 49 , versionAttr ? { 50 major = "3.10"; 51 minor = "1"; 52 - patch = "0"; 53 } 54 }: 55 56 let 57 - sourceSha256 = "sha256-bU6z7H08G8QIToogAMI2P5tHBtVZezlBDqSbnEsqAjE="; 58 featuresInfo = { 59 # Needed always 60 basic = { ··· 293 ]; 294 passthru = shared.passthru // { 295 # Deps that are potentially overriden and are used inside GR plugins - the same version must 296 - inherit boost volk; 297 } // lib.optionalAttrs (hasFeature "gr-uhd") { 298 inherit uhd; 299 } // lib.optionalAttrs (hasFeature "gr-qtgui") { 300 inherit (libsForQt5) qwt; 301 };
··· 49 , versionAttr ? { 50 major = "3.10"; 51 minor = "1"; 52 + patch = "1"; 53 } 54 }: 55 56 let 57 + sourceSha256 = "sha256-vsAK+GQzcpA9Vsa6q4RFEzVpbF7/+yZkMsemKn6VhIg="; 58 featuresInfo = { 59 # Needed always 60 basic = { ··· 293 ]; 294 passthru = shared.passthru // { 295 # Deps that are potentially overriden and are used inside GR plugins - the same version must 296 + inherit 297 + boost 298 + volk 299 + spdlog 300 + ; 301 } // lib.optionalAttrs (hasFeature "gr-uhd") { 302 inherit uhd; 303 + } // lib.optionalAttrs (hasFeature "gr-pdu") { 304 + inherit libiio libad9361; 305 } // lib.optionalAttrs (hasFeature "gr-qtgui") { 306 inherit (libsForQt5) qwt; 307 };
+1 -2
pkgs/applications/radio/gqrx/default.nix
··· 5 , qt5 6 , gnuradio3_8Minimal 7 , thrift 8 - , log4cpp 9 , mpir 10 , fftwFloat 11 , alsa-lib ··· 39 qt5.wrapQtAppsHook 40 ]; 41 buildInputs = [ 42 - log4cpp 43 mpir 44 fftwFloat 45 alsa-lib
··· 5 , qt5 6 , gnuradio3_8Minimal 7 , thrift 8 , mpir 9 , fftwFloat 10 , alsa-lib ··· 38 qt5.wrapQtAppsHook 39 ]; 40 buildInputs = [ 41 + gnuradio3_8Minimal.unwrapped.log4cpp 42 mpir 43 fftwFloat 44 alsa-lib
+1 -2
pkgs/applications/radio/qradiolink/default.nix
··· 7 , thrift 8 # Not gnuradioPackages' 9 , codec2 10 - , log4cpp 11 , gmp 12 , gsm 13 , libopus ··· 48 buildInputs = [ 49 gnuradio3_8.unwrapped.boost 50 codec2 51 - log4cpp 52 gmp 53 libpulseaudio 54 libconfig
··· 7 , thrift 8 # Not gnuradioPackages' 9 , codec2 10 , gmp 11 , gsm 12 , libopus ··· 47 buildInputs = [ 48 gnuradio3_8.unwrapped.boost 49 codec2 50 + gnuradio3_8.unwrapped.log4cpp 51 gmp 52 libpulseaudio 53 libconfig
+2
pkgs/development/libraries/volk/default.nix
··· 10 11 stdenv.mkDerivation rec { 12 pname = "volk"; 13 version = "2.5.0"; 14 15 src = fetchFromGitHub {
··· 10 11 stdenv.mkDerivation rec { 12 pname = "volk"; 13 + # Version 2.5.1 seems to cause a build issue for aarch64-darwin, see: 14 + # https://github.com/NixOS/nixpkgs/pull/160152#issuecomment-1043380478A 15 version = "2.5.0"; 16 17 src = fetchFromGitHub {
+8 -4
pkgs/top-level/gnuradio-packages.nix
··· 14 }; 15 mkDerivation = mkDerivationWith stdenv.mkDerivation; 16 17 - callPackage = self.newScope { 18 inherit (gnuradio) 19 # Packages that are potentially overriden and used as deps here. 20 boost 21 - uhd 22 volk 23 ; 24 inherit mkDerivationWith mkDerivation; 25 - }; 26 - 27 in { 28 29 inherit callPackage mkDerivation mkDerivationWith;
··· 14 }; 15 mkDerivation = mkDerivationWith stdenv.mkDerivation; 16 17 + callPackage = self.newScope ({ 18 inherit (gnuradio) 19 # Packages that are potentially overriden and used as deps here. 20 boost 21 volk 22 ; 23 inherit mkDerivationWith mkDerivation; 24 + } // lib.optionalAttrs (gnuradio.hasFeature "gr-uhd") { 25 + inherit (gnuradio) uhd; 26 + } // (if (lib.versionAtLeast gnuradio.versionAttr.major "3.10") then { 27 + inherit (gnuradio) spdlog; 28 + } else { 29 + inherit (gnuradio) log4cpp; 30 + })); 31 in { 32 33 inherit callPackage mkDerivation mkDerivationWith;