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

This commit is contained in:
Doron Behar 2022-02-18 13:06:05 +02:00 committed by GitHub
commit 951c916783
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 126 additions and 42 deletions

View file

@ -7,78 +7,97 @@
, gtest
, openssl
, gflags
, gnuradio3_8
, gnuradio
, thrift
, libpcap
, enableRawUdp ? true, libpcap
, orc
, pkg-config
, uhd
, log4cpp
, blas, lapack
, matio
, pugixml
, protobuf
}:
gnuradio3_8.pkgs.mkDerivation rec {
gnuradio.pkgs.mkDerivation rec {
pname = "gnss-sdr";
# There's an issue with cpufeatures on 0.0.15, see:
# https://github.com/NixOS/nixpkgs/pull/142557#issuecomment-950217925
version = "0.0.13";
version = "0.0.16";
src = fetchFromGitHub {
owner = "gnss-sdr";
repo = "gnss-sdr";
rev = "v${version}";
sha256 = "0a3k47fl5dizzhbqbrbmckl636lznyjby2d2nz6fz21637hvrnby";
sha256 = "sha256-ODe4k6PDGtDX11FrbggEbN3tc4UtATaItUIpCKl4JjM=";
};
patches = [
# Use the relative install location for volk_gnsssdr_module and
# cpu_features which is bundled in the source. NOTE: Perhaps this patch
# should be sent upstream.
./fix_libcpu_features_install_path.patch
];
nativeBuildInputs = [
cmake
gnuradio3_8.unwrapped.python
gnuradio3_8.unwrapped.python.pkgs.Mako
gnuradio3_8.unwrapped.python.pkgs.six
pkg-config
gnuradio.unwrapped.python
gnuradio.unwrapped.python.pkgs.Mako
gnuradio.unwrapped.python.pkgs.six
];
checkInputs = [
gtest
];
buildInputs = [
gmp
armadillo
gnuradio3_8.unwrapped.boost
glog
gtest
openssl
gflags
openssl
orc
# UHD support is optional, but gnuradio is built with it, so there's
# nothing to be gained by leaving it out.
gnuradio3_8.unwrapped.uhd
log4cpp
blas lapack
matio
pugixml
protobuf
gnuradio3_8.pkgs.osmosdr
gnuradio.unwrapped.boost
] ++ lib.optionals (gnuradio.hasFeature "gr-uhd") [
gnuradio.unwrapped.uhd
] ++ (if (lib.versionAtLeast gnuradio.unwrapped.versionAttr.major "3.10") then [
gnuradio.unwrapped.spdlog
] else [
gnuradio.unwrapped.log4cpp
]) ++ lib.optionals (enableRawUdp) [
libpcap
] ++ lib.optionals (gnuradio3_8.hasFeature "gr-ctrlport") [
] ++ lib.optionals (gnuradio.hasFeature "gr-ctrlport") [
thrift
gnuradio3_8.unwrapped.python.pkgs.thrift
gnuradio.unwrapped.python.pkgs.thrift
] ++ lib.optionals (gnuradio.hasFeature "gr-pdu" || gnuradio.hasFeature "gr-iio") [
gnuradio.unwrapped.libiio
] ++ lib.optionals (gnuradio.hasFeature "gr-pdu") [
gnuradio.unwrapped.libad9361
];
cmakeFlags = [
"-DGFlags_ROOT_DIR=${gflags}/lib"
"-DGFlags_INCLUDE_DIRS=${gflags}/include"
"-DGLOG_INCLUDE_DIR=${glog}/include"
# Should use .dylib if darwin support is requested
"-DGFlags_LIBS=${gflags}/lib/libgflags.so"
"-DGLOG_LIBRARIES=${glog}/lib/libglog.so"
# Use our dependencies glog, gflags and armadillo dependencies
"-DENABLE_OWN_GLOG=OFF"
"-DENABLE_OWN_ARMADILLO=OFF"
"-DENABLE_ORC=ON"
"-DENABLE_LOG=ON"
"-DENABLE_RAW_UDP=${if enableRawUdp then "ON" else "OFF"}"
"-DENABLE_UHD=${if (gnuradio.hasFeature "gr-uhd") then "ON" else "OFF"}"
"-DENABLE_FMCOMMS2=${if (gnuradio.hasFeature "gr-iio" && gnuradio.hasFeature "gr-pdu") then "ON" else "OFF"}"
"-DENABLE_PLUTOSDR=${if (gnuradio.hasFeature "gr-iio") then "ON" else "OFF"}"
"-DENABLE_AD9361=${if (gnuradio.hasFeature "gr-pdu") then "ON" else "OFF"}"
"-DENABLE_UNIT_TESTING=OFF"
# gnss-sdr doesn't truly depend on BLAS or LAPACK, as long as
# armadillo is built using both, so skip checking for them.
"-DBLAS=YES"
"-DLAPACK=YES"
"-DBLAS_LIBRARIES=-lblas"
"-DLAPACK_LIBRARIES=-llapack"
# Similarly, it doesn't actually use gfortran despite checking for
# its presence.
"-DGFORTRAN=YES"
];
meta = with lib; {

View file

@ -0,0 +1,47 @@
--- a/CMakeLists.txt 1970-01-01 08:00:01.000000000 +0800
+++ b/CMakeLists.txt 2022-02-16 20:41:53.725290020 +0800
@@ -1214,7 +1214,7 @@
BINARY_DIR ${CMAKE_BINARY_DIR}/volk_gnsssdr_module/build
CMAKE_ARGS ${VOLK_GNSSSDR_CMAKE_ARGS}
-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>
- -DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR}
+ -DCMAKE_INSTALL_LIBDIR=lib
DOWNLOAD_COMMAND ""
UPDATE_COMMAND ""
PATCH_COMMAND ""
@@ -1247,7 +1247,7 @@
)
set(VOLK_GNSSSDR_BUILD_BYPRODUCTS
${VOLK_GNSSSDR_BUILD_BYPRODUCTS}
- ${CMAKE_BINARY_DIR}/volk_gnsssdr_module/install/${CMAKE_INSTALL_LIBDIR}/${CMAKE_FIND_LIBRARY_PREFIXES}cpu_features${CMAKE_STATIC_LIBRARY_SUFFIX}
+ ${CMAKE_BINARY_DIR}/volk_gnsssdr_module/install/lib/${CMAKE_FIND_LIBRARY_PREFIXES}cpu_features${CMAKE_STATIC_LIBRARY_SUFFIX}
)
endif()
ExternalProject_Add(volk_gnsssdr_module
@@ -1256,7 +1256,7 @@
BINARY_DIR ${CMAKE_BINARY_DIR}/volk_gnsssdr_module/build
CMAKE_ARGS ${VOLK_GNSSSDR_CMAKE_ARGS}
-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>
- -DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR}
+ -DCMAKE_INSTALL_LIBDIR=lib
DOWNLOAD_COMMAND ""
UPDATE_COMMAND ""
PATCH_COMMAND ""
@@ -1271,7 +1271,7 @@
BINARY_DIR ${CMAKE_BINARY_DIR}/volk_gnsssdr_module/build
CMAKE_ARGS ${VOLK_GNSSSDR_CMAKE_ARGS}
-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>
- -DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR}
+ -DCMAKE_INSTALL_LIBDIR=lib
DOWNLOAD_COMMAND ""
UPDATE_COMMAND ""
PATCH_COMMAND ""
@@ -1310,7 +1310,7 @@
if(CMAKE_VERSION VERSION_GREATER 3.0 AND SUPPORTED_CPU_FEATURES_ARCH)
if(NOT CpuFeatures_FOUND)
set_target_properties(Volkgnsssdr::volkgnsssdr PROPERTIES
- INTERFACE_LINK_LIBRARIES ${CMAKE_BINARY_DIR}/volk_gnsssdr_module/install/${CMAKE_INSTALL_LIBDIR}/${CMAKE_FIND_LIBRARY_PREFIXES}cpu_features${CMAKE_STATIC_LIBRARY_SUFFIX}
+ INTERFACE_LINK_LIBRARIES ${CMAKE_BINARY_DIR}/volk_gnsssdr_module/install/lib/${CMAKE_FIND_LIBRARY_PREFIXES}cpu_features${CMAKE_STATIC_LIBRARY_SUFFIX}
)
endif()
endif()

View file

@ -251,7 +251,11 @@ stdenv.mkDerivation rec {
];
passthru = shared.passthru // {
# Deps that are potentially overriden and are used inside GR plugins - the same version must
inherit boost volk;
inherit
boost
volk
log4cpp
;
} // lib.optionalAttrs (hasFeature "gr-uhd") {
inherit uhd;
} // lib.optionalAttrs (hasFeature "gr-qtgui") {

View file

@ -275,7 +275,11 @@ stdenv.mkDerivation rec {
];
passthru = shared.passthru // {
# Deps that are potentially overriden and are used inside GR plugins - the same version must
inherit boost volk;
inherit
boost
volk
log4cpp
;
} // lib.optionalAttrs (hasFeature "gr-uhd") {
inherit uhd;
} // lib.optionalAttrs (hasFeature "gr-qtgui") {

View file

@ -49,12 +49,12 @@
, versionAttr ? {
major = "3.10";
minor = "1";
patch = "0";
patch = "1";
}
}:
let
sourceSha256 = "sha256-bU6z7H08G8QIToogAMI2P5tHBtVZezlBDqSbnEsqAjE=";
sourceSha256 = "sha256-vsAK+GQzcpA9Vsa6q4RFEzVpbF7/+yZkMsemKn6VhIg=";
featuresInfo = {
# Needed always
basic = {
@ -293,9 +293,15 @@ stdenv.mkDerivation rec {
];
passthru = shared.passthru // {
# Deps that are potentially overriden and are used inside GR plugins - the same version must
inherit boost volk;
inherit
boost
volk
spdlog
;
} // lib.optionalAttrs (hasFeature "gr-uhd") {
inherit uhd;
} // lib.optionalAttrs (hasFeature "gr-pdu") {
inherit libiio libad9361;
} // lib.optionalAttrs (hasFeature "gr-qtgui") {
inherit (libsForQt5) qwt;
};

View file

@ -5,7 +5,6 @@
, qt5
, gnuradio3_8Minimal
, thrift
, log4cpp
, mpir
, fftwFloat
, alsa-lib
@ -39,7 +38,7 @@ gnuradio3_8Minimal.pkgs.mkDerivation rec {
qt5.wrapQtAppsHook
];
buildInputs = [
log4cpp
gnuradio3_8Minimal.unwrapped.log4cpp
mpir
fftwFloat
alsa-lib

View file

@ -7,7 +7,6 @@
, thrift
# Not gnuradioPackages'
, codec2
, log4cpp
, gmp
, gsm
, libopus
@ -48,7 +47,7 @@ gnuradio3_8.pkgs.mkDerivation rec {
buildInputs = [
gnuradio3_8.unwrapped.boost
codec2
log4cpp
gnuradio3_8.unwrapped.log4cpp
gmp
libpulseaudio
libconfig

View file

@ -10,6 +10,8 @@
stdenv.mkDerivation rec {
pname = "volk";
# Version 2.5.1 seems to cause a build issue for aarch64-darwin, see:
# https://github.com/NixOS/nixpkgs/pull/160152#issuecomment-1043380478A
version = "2.5.0";
src = fetchFromGitHub {

View file

@ -14,16 +14,20 @@ let
};
mkDerivation = mkDerivationWith stdenv.mkDerivation;
callPackage = self.newScope {
callPackage = self.newScope ({
inherit (gnuradio)
# Packages that are potentially overriden and used as deps here.
boost
uhd
volk
;
inherit mkDerivationWith mkDerivation;
};
} // lib.optionalAttrs (gnuradio.hasFeature "gr-uhd") {
inherit (gnuradio) uhd;
} // (if (lib.versionAtLeast gnuradio.versionAttr.major "3.10") then {
inherit (gnuradio) spdlog;
} else {
inherit (gnuradio) log4cpp;
}));
in {
inherit callPackage mkDerivation mkDerivationWith;