diff options
author | Doron Behar <doron.behar@gmail.com> | 2020-10-16 23:31:20 +0300 |
---|---|---|
committer | Doron Behar <doron.behar@gmail.com> | 2021-03-13 12:46:59 +0200 |
commit | 2d08e55e9b8f96cf00466bd55fe0d132f1abd008 (patch) | |
tree | 1be9003486550aea9f8d92e6bf14eb3ca54af7df /pkgs/development/gnuradio-modules/osmosdr | |
parent | 7690f9a312e49e56b6df443169e5bf2ea420e0a7 (diff) |
gnuradio.pkgs: init
- Write a `mkDerivation` and `mkDerivationWith` function for gnuradio, like qt5. - qradiolink, gqrx: Use gnuradio's callPackage and mkDerivation. - Use gnuradio.callPackage to define all gnuradio.pkgs. - Move all gnuradio packages expressions to pkgs/development/gnuradio-modules/ - modeled after Python's. - Add more paths to gnuradio's wrapper - add the extra packages as python modules, and add their executables with proper env vars wrapping. Co-authored-by: Frederik Rietdijk <fridh@fridh.nl>
Diffstat (limited to 'pkgs/development/gnuradio-modules/osmosdr')
-rw-r--r-- | pkgs/development/gnuradio-modules/osmosdr/default.nix | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/pkgs/development/gnuradio-modules/osmosdr/default.nix b/pkgs/development/gnuradio-modules/osmosdr/default.nix new file mode 100644 index 0000000000000..4159862bbed77 --- /dev/null +++ b/pkgs/development/gnuradio-modules/osmosdr/default.nix @@ -0,0 +1,84 @@ +{ lib +, mkDerivation +, fetchgit +, gnuradio +, cmake +, pkg-config +, log4cpp +, mpir +, boost +, gmp +, fftwFloat +, python +, swig +, uhd +, icu +, airspy +, hackrf +, libbladeRF +, rtl-sdr +, soapysdr-with-plugins +}: + +let + version = { + "3.7" = "0.1.5"; + "3.8" = "0.2.2"; + }.${gnuradio.versionAttr.major}; + src = fetchgit { + url = "git://git.osmocom.org/gr-osmosdr"; + rev = "v${version}"; + sha256 = { + "3.7" = "0bf9bnc1c3c4yqqqgmg3nhygj6rcfmyk6pybi27f7461d2cw1drv"; + "3.8" = "HT6xlN6cJAnvF+s1g2I1uENhBJJizdADlLXeSD0rEqs="; + }.${gnuradio.versionAttr.major}; + }; +in mkDerivation { + pname = "gr-osmosdr"; + inherit version src; + disabledForGRafter = "3.9"; + + buildInputs = [ + log4cpp + mpir + boost + fftwFloat + gmp + icu + airspy + hackrf + libbladeRF + rtl-sdr + soapysdr-with-plugins + ] ++ lib.optional (gnuradio.hasFeature "gr-uhd" gnuradio.features) [ + uhd + ]; + cmakeFlags = [ + (if (gnuradio.hasFeature "python-support" gnuradio.features) then + "-DENABLE_PYTHON=ON" + else + "-DENABLE_PYTHON=OFF" + ) + ]; + nativeBuildInputs = [ + cmake + pkg-config + swig + ] ++ lib.optionals (gnuradio.hasFeature "python-support" gnuradio.features) [ + (if (gnuradio.versionAttr.major == "3.7") then + python.pkgs.cheetah + else + python.pkgs.Mako + ) + python + ] + ; + + meta = with lib; { + description = "Gnuradio block for OsmoSDR and rtl-sdr"; + homepage = "https://sdr.osmocom.org/trac/wiki/GrOsmoSDR"; + license = licenses.gpl3Plus; + maintainers = with maintainers; [ bjornfor ]; + platforms = platforms.unix; + }; +} |