nixpkgs/pkgs/applications/radio/gnss-sdr/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

108 lines
2.9 KiB
Nix
Raw Normal View History

{ lib
, fetchFromGitHub
2022-04-11 16:34:22 +00:00
, fetchpatch
, armadillo
, cmake
, gmp
, glog
2021-03-14 18:03:18 +00:00
, gtest
, openssl
, gflags
, gnuradio
, thrift
, enableRawUdp ? true, libpcap
, orc
, pkg-config
, blas, lapack
2019-08-08 20:11:41 +00:00
, matio
, pugixml
, protobuf
}:
gnuradio.pkgs.mkDerivation rec {
pname = "gnss-sdr";
2024-01-27 14:27:42 +00:00
version = "0.0.19.1";
src = fetchFromGitHub {
owner = "gnss-sdr";
repo = "gnss-sdr";
rev = "v${version}";
2024-01-27 14:27:42 +00:00
sha256 = "sha256-IbkYdw1pwI+FMnZMChsxMz241Kv4EzMcBb0mm6/jq1k=";
};
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
pkg-config
gnuradio.unwrapped.python
gnuradio.unwrapped.python.pkgs.mako
gnuradio.unwrapped.python.pkgs.six
];
nativeCheckInputs = [
gtest
];
buildInputs = [
gmp
armadillo
glog
gflags
openssl
orc
blas lapack
2019-08-08 20:11:41 +00:00
matio
pugixml
protobuf
gnuradio.unwrapped.boost
gnuradio.unwrapped.logLib
] ++ lib.optionals (gnuradio.hasFeature "gr-uhd") [
gnuradio.unwrapped.uhd
] ++ lib.optionals (enableRawUdp) [
libpcap
] ++ lib.optionals (gnuradio.hasFeature "gr-ctrlport") [
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 = [
2024-01-27 14:27:42 +00:00
(lib.cmakeFeature "GFlags_INCLUDE_DIRS" "${gflags}/include")
(lib.cmakeFeature "GLOG_INCLUDE_DIR" "${glog}/include")
# Should use .dylib if darwin support is requested
2024-01-27 14:27:42 +00:00
(lib.cmakeFeature "GFlags_LIBS" "${gflags}/lib/libgflags.so")
(lib.cmakeFeature "-DGLOG_LIBRARIES" "${glog}/lib/libglog.so")
# Use our dependencies glog, gflags and armadillo dependencies
2024-01-27 14:27:42 +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)
# gnss-sdr doesn't truly depend on BLAS or LAPACK, as long as
# armadillo is built using both, so skip checking for them.
2024-01-27 14:27:42 +00:00
(lib.cmakeFeature "BLAS_LIBRARIES" "-lblas")
(lib.cmakeFeature "LAPACK_LIBRARIES" "-llapack")
];
meta = with lib; {
description = "An open source Global Navigation Satellite Systems software-defined receiver";
2020-03-14 05:56:58 +00:00
homepage = "https://gnss-sdr.org/";
license = licenses.gpl3Plus;
platforms = platforms.linux;
};
}