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 | |
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')
-rw-r--r-- | pkgs/development/gnuradio-modules/ais/default.nix | 45 | ||||
-rw-r--r-- | pkgs/development/gnuradio-modules/gsm/default.nix | 48 | ||||
-rw-r--r-- | pkgs/development/gnuradio-modules/limesdr/default.nix | 59 | ||||
-rw-r--r-- | pkgs/development/gnuradio-modules/mkDerivation.nix | 23 | ||||
-rw-r--r-- | pkgs/development/gnuradio-modules/nacl/default.nix | 46 | ||||
-rw-r--r-- | pkgs/development/gnuradio-modules/osmosdr/default.nix | 84 | ||||
-rw-r--r-- | pkgs/development/gnuradio-modules/rds/default.nix | 57 |
7 files changed, 362 insertions, 0 deletions
diff --git a/pkgs/development/gnuradio-modules/ais/default.nix b/pkgs/development/gnuradio-modules/ais/default.nix new file mode 100644 index 0000000000000..0770d83f21d9f --- /dev/null +++ b/pkgs/development/gnuradio-modules/ais/default.nix @@ -0,0 +1,45 @@ +{ lib +, stdenv +, mkDerivation +, fetchFromGitHub +, cmake +, pkg-config +, python +, boost +, cppunit +, log4cpp +, osmosdr +}: + +mkDerivation rec { + pname = "gr-ais"; + version = "2015-12-20"; + src = fetchFromGitHub { + owner = "bistromath"; + repo = "gr-ais"; + rev = "cdc1f52745853f9c739c718251830eb69704b26e"; + sha256 = "1vl3kk8xr2mh5lf31zdld7yzmwywqffffah8iblxdzblgsdwxfl6"; + }; + disabledForGRafter = "3.8"; + + nativeBuildInputs = [ + cmake + pkg-config + python + ]; + + buildInputs = [ + cppunit + osmosdr + boost + log4cpp + ]; + + meta = with lib; { + description = "Gnuradio block for ais"; + homepage = "https://github.com/bistromath/gr-ais"; + license = licenses.gpl3Plus; + platforms = platforms.unix; + maintainers = with maintainers; [ mog ]; + }; +} diff --git a/pkgs/development/gnuradio-modules/gsm/default.nix b/pkgs/development/gnuradio-modules/gsm/default.nix new file mode 100644 index 0000000000000..835c5456668c9 --- /dev/null +++ b/pkgs/development/gnuradio-modules/gsm/default.nix @@ -0,0 +1,48 @@ +{ lib +, mkDerivation +, fetchFromGitHub +, cmake +, pkg-config +, cppunit +, swig +, boost +, log4cpp +, python +, libosmocore +, osmosdr +}: + +mkDerivation { + pname = "gr-gsm"; + version = "2016-08-25"; + src = fetchFromGitHub { + owner = "ptrkrysik"; + repo = "gr-gsm"; + rev = "3ca05e6914ef29eb536da5dbec323701fbc2050d"; + sha256 = "13nnq927kpf91iqccr8db9ripy5czjl5jiyivizn6bia0bam2pvx"; + }; + disabledForGRafter = "3.8"; + + nativeBuildInputs = [ + cmake + pkg-config + swig + python + ]; + + buildInputs = [ + cppunit + log4cpp + boost + libosmocore + osmosdr + ]; + + meta = with lib; { + description = "Gnuradio block for gsm"; + homepage = "https://github.com/ptrkrysik/gr-gsm"; + license = licenses.gpl3Plus; + platforms = platforms.linux; + maintainers = with maintainers; [ mog ]; + }; +} diff --git a/pkgs/development/gnuradio-modules/limesdr/default.nix b/pkgs/development/gnuradio-modules/limesdr/default.nix new file mode 100644 index 0000000000000..63136b33d658f --- /dev/null +++ b/pkgs/development/gnuradio-modules/limesdr/default.nix @@ -0,0 +1,59 @@ +{ lib +, mkDerivation +, fetchFromGitHub +, gnuradio +, cmake +, pkg-config +, doxygen +, swig +, python +, log4cpp +, mpir +, boost +, gmp +, icu +, limesuite +}: + +let + version = { + "3.7" = "2.0.0"; + "3.8" = "3.0.1"; + }.${gnuradio.versionAttr.major}; + src = fetchFromGitHub { + owner = "myriadrf"; + repo = "gr-limesdr"; + rev = "v${version}"; + sha256 = { + "3.7" = "0ldqvfwl0gil89l9s31fjf9d7ki0dk572i8vna336igfaz348ypq"; + "3.8" = "ffs+8TU0yr6IW1xZJ/abQ1CQWGZM+zYqPRJxy3ZvM9U="; + }.${gnuradio.versionAttr.major}; + }; +in mkDerivation { + pname = "gr-limesdr"; + inherit version src; + disabledForGRafter = "3.9"; + + nativeBuildInputs = [ + cmake + pkg-config + swig + python + ]; + buildInputs = [ + log4cpp + mpir + boost + gmp + icu + limesuite + ]; + + meta = with lib; { + description = "Gnuradio source and sink blocks for LimeSDR"; + homepage = "https://wiki.myriadrf.org/Gr-limesdr_Plugin_for_GNURadio"; + license = licenses.mit; + platforms = platforms.linux; + maintainers = [ maintainers.markuskowa ]; + }; +} diff --git a/pkgs/development/gnuradio-modules/mkDerivation.nix b/pkgs/development/gnuradio-modules/mkDerivation.nix new file mode 100644 index 0000000000000..235eff25cdbd0 --- /dev/null +++ b/pkgs/development/gnuradio-modules/mkDerivation.nix @@ -0,0 +1,23 @@ +{ lib +, unwrapped +}: + +mkDerivation: + +args: + +# Check if it's supposed to not get built for the current gnuradio version +if (builtins.hasAttr "disabledForGRafter" args) && +(lib.versionAtLeast unwrapped.versionAttr.major args.disabledForGRafter) then +let name = args.name or "${args.pname}"; in +throw "Package ${name} is incompatible with GNURadio ${unwrapped.versionAttr.major}" +else + +let + args_ = { + enableParallelBuilding = args.enableParallelBuilding or true; + nativeBuildInputs = (args.nativeBuildInputs or []); + # We add gnuradio itself by default + buildInputs = (args.buildInputs or []) ++ [ unwrapped ]; + }; +in mkDerivation (args // args_) diff --git a/pkgs/development/gnuradio-modules/nacl/default.nix b/pkgs/development/gnuradio-modules/nacl/default.nix new file mode 100644 index 0000000000000..1ffb0afee07e0 --- /dev/null +++ b/pkgs/development/gnuradio-modules/nacl/default.nix @@ -0,0 +1,46 @@ +{ lib +, mkDerivation +, fetchFromGitHub +, cmake +, pkg-config +, cppunit +, swig +, boost +, log4cpp +, python +, libsodium +}: + +mkDerivation { + pname = "gr-nacl"; + version = "2017-04-10"; + src = fetchFromGitHub { + owner = "stwunsch"; + repo = "gr-nacl"; + rev = "15276bb0fcabf5fe4de4e58df3d579b5be0e9765"; + sha256 = "018np0qlk61l7mlv3xxx5cj1rax8f1vqrsrch3higsl25yydbv7v"; + }; + disabledForGRafter = "3.8"; + + nativeBuildInputs = [ + cmake + pkg-config + swig + python + ]; + + buildInputs = [ + cppunit + log4cpp + boost + libsodium + ]; + + meta = with lib; { + description = "Gnuradio block for encryption"; + homepage = "https://github.com/stwunsch/gr-nacl"; + license = licenses.gpl3Plus; + platforms = platforms.linux ++ platforms.darwin; + maintainers = with maintainers; [ mog ]; + }; +} 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; + }; +} diff --git a/pkgs/development/gnuradio-modules/rds/default.nix b/pkgs/development/gnuradio-modules/rds/default.nix new file mode 100644 index 0000000000000..a2062783bd74e --- /dev/null +++ b/pkgs/development/gnuradio-modules/rds/default.nix @@ -0,0 +1,57 @@ +{ lib +, mkDerivation +, fetchFromGitHub +, gnuradio +, cmake +, pkg-config +, swig +, python +, log4cpp +, mpir +, boost +, gmp +, icu +}: + +let + version = { + "3.7" = "1.1.0"; + "3.8" = "3.8.0"; + }.${gnuradio.versionAttr.major}; + src = fetchFromGitHub { + owner = "bastibl"; + repo = "gr-rds"; + rev = "v${version}"; + sha256 = { + "3.7" = "0jkzchvw0ivcxsjhi1h0mf7k13araxf5m4wi5v9xdgqxvipjzqfy"; + "3.8" = "+yKLJu2bo7I2jkAiOdjvdhZwxFz9NFgTmzcLthH9Y5o="; + }.${gnuradio.versionAttr.major}; + }; +in mkDerivation { + pname = "gr-rds"; + inherit version src; + disabledForGRafter = "3.9"; + + buildInputs = [ + log4cpp + mpir + boost + gmp + icu + ]; + + nativeBuildInputs = [ + cmake + pkg-config + swig + python + ]; + + meta = with lib; { + description = "Gnuradio block for radio data system"; + homepage = "https://github.com/bastibl/gr-rds"; + license = licenses.gpl2Plus; + platforms = platforms.unix; + maintainers = with maintainers; [ mog ]; + }; +} |