2021-03-15 08:37:03 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
2020-04-24 23:36:52 +00:00
|
|
|
, armadillo
|
|
|
|
, cmake
|
2021-03-15 08:37:03 +00:00
|
|
|
, gmp
|
2020-04-24 23:36:52 +00:00
|
|
|
, glog
|
2021-04-05 15:23:46 +00:00
|
|
|
, gtest
|
2020-04-24 23:36:52 +00:00
|
|
|
, openssl
|
|
|
|
, gflags
|
2022-02-20 05:27:41 +00:00
|
|
|
, gnuradio
|
2021-10-28 06:52:43 +00:00
|
|
|
, thrift
|
2022-02-20 05:27:41 +00:00
|
|
|
, enableRawUdp ? true, libpcap
|
2020-04-24 23:36:52 +00:00
|
|
|
, orc
|
2021-01-15 22:18:51 +00:00
|
|
|
, pkg-config
|
2020-04-24 23:36:52 +00:00
|
|
|
, blas, lapack
|
|
|
|
, matio
|
|
|
|
, pugixml
|
|
|
|
, protobuf
|
|
|
|
}:
|
|
|
|
|
2022-02-20 05:27:41 +00:00
|
|
|
gnuradio.pkgs.mkDerivation rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "gnss-sdr";
|
2024-02-29 20:09:43 +00:00
|
|
|
version = "0.0.19.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "gnss-sdr";
|
|
|
|
repo = "gnss-sdr";
|
|
|
|
rev = "v${version}";
|
2024-02-29 20:09:43 +00:00
|
|
|
sha256 = "sha256-IbkYdw1pwI+FMnZMChsxMz241Kv4EzMcBb0mm6/jq1k=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-02-20 05:27:41 +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
|
|
|
|
];
|
|
|
|
|
2021-03-15 08:37:03 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
2022-02-20 05:27:41 +00:00
|
|
|
pkg-config
|
|
|
|
gnuradio.unwrapped.python
|
2023-03-15 16:39:30 +00:00
|
|
|
gnuradio.unwrapped.python.pkgs.mako
|
2022-02-20 05:27:41 +00:00
|
|
|
gnuradio.unwrapped.python.pkgs.six
|
|
|
|
];
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-02-20 05:27:41 +00:00
|
|
|
gtest
|
2021-03-15 08:37:03 +00:00
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [
|
2021-03-15 08:37:03 +00:00
|
|
|
gmp
|
2020-04-24 23:36:52 +00:00
|
|
|
armadillo
|
|
|
|
glog
|
|
|
|
gflags
|
2022-02-20 05:27:41 +00:00
|
|
|
openssl
|
2020-04-24 23:36:52 +00:00
|
|
|
orc
|
|
|
|
blas lapack
|
|
|
|
matio
|
|
|
|
pugixml
|
|
|
|
protobuf
|
2022-02-20 05:27:41 +00:00
|
|
|
gnuradio.unwrapped.boost
|
2023-04-29 16:46:19 +00:00
|
|
|
gnuradio.unwrapped.logLib
|
2022-02-20 05:27:41 +00:00
|
|
|
] ++ lib.optionals (gnuradio.hasFeature "gr-uhd") [
|
|
|
|
gnuradio.unwrapped.uhd
|
2023-04-29 16:46:19 +00:00
|
|
|
] ++ lib.optionals (enableRawUdp) [
|
2021-03-15 08:37:03 +00:00
|
|
|
libpcap
|
2022-02-20 05:27:41 +00:00
|
|
|
] ++ lib.optionals (gnuradio.hasFeature "gr-ctrlport") [
|
2021-10-28 06:52:43 +00:00
|
|
|
thrift
|
2022-02-20 05:27:41 +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
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
cmakeFlags = [
|
2024-02-29 20:09:43 +00:00
|
|
|
(lib.cmakeFeature "GFlags_INCLUDE_DIRS" "${gflags}/include")
|
|
|
|
(lib.cmakeFeature "GLOG_INCLUDE_DIR" "${glog}/include")
|
2022-02-20 05:27:41 +00:00
|
|
|
# Should use .dylib if darwin support is requested
|
2024-02-29 20:09:43 +00:00
|
|
|
(lib.cmakeFeature "GFlags_LIBS" "${gflags}/lib/libgflags.so")
|
|
|
|
(lib.cmakeFeature "-DGLOG_LIBRARIES" "${glog}/lib/libglog.so")
|
2022-02-20 05:27:41 +00:00
|
|
|
# Use our dependencies glog, gflags and armadillo dependencies
|
2024-02-29 20:09:43 +00:00
|
|
|
(lib.cmakeBool "ENABLE_OWN_GLOG" false)
|
|
|
|
(lib.cmakeBool "ENABLE_OWN_ARMADILLO" false)
|
|
|
|
(lib.cmakeBool "ENABLE_ORC" true)
|
|
|
|
(lib.cmakeBool "ENABLE_LOG" true)
|
|
|
|
(lib.cmakeBool "ENABLE_RAW_UDP" enableRawUdp)
|
|
|
|
(lib.cmakeBool "ENABLE_UHD" (gnuradio.hasFeature "gr-uhd"))
|
|
|
|
(lib.cmakeBool "ENABLE_FMCOMMS2" (gnuradio.hasFeature "gr-iio" && gnuradio.hasFeature "gr-pdu"))
|
|
|
|
(lib.cmakeBool "ENABLE_PLUTOSDR" (gnuradio.hasFeature "gr-iio"))
|
|
|
|
(lib.cmakeBool "ENABLE_AD9361" (gnuradio.hasFeature "gr-pdu"))
|
|
|
|
(lib.cmakeBool "ENABLE_UNIT_TESTING" false)
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# gnss-sdr doesn't truly depend on BLAS or LAPACK, as long as
|
|
|
|
# armadillo is built using both, so skip checking for them.
|
2024-02-29 20:09:43 +00:00
|
|
|
(lib.cmakeFeature "BLAS_LIBRARIES" "-lblas")
|
|
|
|
(lib.cmakeFeature "LAPACK_LIBRARIES" "-llapack")
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Open source Global Navigation Satellite Systems software-defined receiver";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://gnss-sdr.org/";
|
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|