2020-12-15 09:56:54 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
2017-07-19 18:01:40 +01:00
|
|
|
, armadillo
|
|
|
|
, cmake
|
2020-12-15 09:56:54 +00:00
|
|
|
, gmp
|
2017-07-19 18:01:40 +01:00
|
|
|
, glog
|
2021-03-14 18:03:18 +00:00
|
|
|
, gtest
|
2017-07-19 18:01:40 +01:00
|
|
|
, openssl
|
2019-07-25 10:04:55 +01:00
|
|
|
, gflags
|
2022-02-16 14:37:32 +00:00
|
|
|
, gnuradio
|
2021-10-21 13:45:55 +01:00
|
|
|
, thrift
|
2022-02-16 14:37:32 +00:00
|
|
|
, enableRawUdp ? true, libpcap
|
2017-07-19 18:01:40 +01:00
|
|
|
, orc
|
2021-01-03 09:43:56 +00:00
|
|
|
, pkg-config
|
2020-03-31 15:47:18 +01:00
|
|
|
, blas, lapack
|
2019-08-08 21:11:41 +01:00
|
|
|
, matio
|
|
|
|
, pugixml
|
|
|
|
, protobuf
|
2017-07-19 18:01:40 +01:00
|
|
|
}:
|
|
|
|
|
2022-02-16 14:37:32 +00:00
|
|
|
gnuradio.pkgs.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "gnss-sdr";
|
2022-02-16 14:37:32 +00:00
|
|
|
version = "0.0.16";
|
2017-07-19 18:01:40 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "gnss-sdr";
|
|
|
|
repo = "gnss-sdr";
|
|
|
|
rev = "v${version}";
|
2022-02-16 14:37:32 +00:00
|
|
|
sha256 = "sha256-ODe4k6PDGtDX11FrbggEbN3tc4UtATaItUIpCKl4JjM=";
|
2017-07-19 18:01:40 +01:00
|
|
|
};
|
|
|
|
|
2022-02-16 14:37:32 +00:00
|
|
|
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
|
|
|
|
];
|
|
|
|
|
2020-12-15 09:56:54 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
2022-02-16 14:37:32 +00:00
|
|
|
pkg-config
|
|
|
|
gnuradio.unwrapped.python
|
|
|
|
gnuradio.unwrapped.python.pkgs.Mako
|
|
|
|
gnuradio.unwrapped.python.pkgs.six
|
|
|
|
];
|
|
|
|
checkInputs = [
|
|
|
|
gtest
|
2020-12-15 09:56:54 +00:00
|
|
|
];
|
|
|
|
|
2017-07-19 18:01:40 +01:00
|
|
|
buildInputs = [
|
2020-12-15 09:56:54 +00:00
|
|
|
gmp
|
2017-07-19 18:01:40 +01:00
|
|
|
armadillo
|
|
|
|
glog
|
2019-07-25 10:04:55 +01:00
|
|
|
gflags
|
2022-02-16 14:37:32 +00:00
|
|
|
openssl
|
2017-07-19 18:01:40 +01:00
|
|
|
orc
|
2020-03-31 15:47:18 +01:00
|
|
|
blas lapack
|
2019-08-08 21:11:41 +01:00
|
|
|
matio
|
|
|
|
pugixml
|
|
|
|
protobuf
|
2022-02-16 14:37:32 +00:00
|
|
|
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) [
|
2020-12-15 09:56:54 +00:00
|
|
|
libpcap
|
2022-02-16 14:37:32 +00:00
|
|
|
] ++ lib.optionals (gnuradio.hasFeature "gr-ctrlport") [
|
2021-10-21 13:45:55 +01:00
|
|
|
thrift
|
2022-02-16 14:37:32 +00:00
|
|
|
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
|
2017-07-19 18:01:40 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
cmakeFlags = [
|
2022-02-16 14:37:32 +00:00
|
|
|
"-DGFlags_INCLUDE_DIRS=${gflags}/include"
|
2017-07-19 18:01:40 +01:00
|
|
|
"-DGLOG_INCLUDE_DIR=${glog}/include"
|
2022-02-16 14:37:32 +00:00
|
|
|
# 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"}"
|
2018-11-10 23:53:53 +00:00
|
|
|
"-DENABLE_UNIT_TESTING=OFF"
|
2017-07-19 18:01:40 +01:00
|
|
|
|
|
|
|
# gnss-sdr doesn't truly depend on BLAS or LAPACK, as long as
|
|
|
|
# armadillo is built using both, so skip checking for them.
|
2020-03-31 15:47:18 +01:00
|
|
|
"-DBLAS_LIBRARIES=-lblas"
|
|
|
|
"-DLAPACK_LIBRARIES=-llapack"
|
2017-07-19 18:01:40 +01:00
|
|
|
];
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2017-07-19 18:01:40 +01:00
|
|
|
description = "An open source Global Navigation Satellite Systems software-defined receiver";
|
2020-03-14 05:56:58 +00:00
|
|
|
homepage = "https://gnss-sdr.org/";
|
2017-07-19 18:01:40 +01:00
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|