about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/radio/gnuradio
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/applications/radio/gnuradio')
-rw-r--r--nixpkgs/pkgs/applications/radio/gnuradio/ais.nix40
-rw-r--r--nixpkgs/pkgs/applications/radio/gnuradio/default.nix126
-rw-r--r--nixpkgs/pkgs/applications/radio/gnuradio/gsm.nix39
-rw-r--r--nixpkgs/pkgs/applications/radio/gnuradio/limesdr.nix38
-rw-r--r--nixpkgs/pkgs/applications/radio/gnuradio/nacl.nix39
-rw-r--r--nixpkgs/pkgs/applications/radio/gnuradio/osmosdr.nix47
-rw-r--r--nixpkgs/pkgs/applications/radio/gnuradio/rds.nix38
-rw-r--r--nixpkgs/pkgs/applications/radio/gnuradio/wrapper.nix24
8 files changed, 391 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/applications/radio/gnuradio/ais.nix b/nixpkgs/pkgs/applications/radio/gnuradio/ais.nix
new file mode 100644
index 000000000000..dfb8415219c7
--- /dev/null
+++ b/nixpkgs/pkgs/applications/radio/gnuradio/ais.nix
@@ -0,0 +1,40 @@
+{ stdenv, fetchFromGitHub, cmake, pkgconfig, boost, gnuradio
+, makeWrapper, cppunit, gnuradio-osmosdr
+, pythonSupport ? true, python, swig
+}:
+
+assert pythonSupport -> python != null && swig != null;
+
+stdenv.mkDerivation rec {
+  name = "gnuradio-ais-${version}";
+  version = "2015-12-20";
+
+  src = fetchFromGitHub {
+    owner = "bistromath";
+    repo = "gr-ais";
+    # Upstream PR: https://github.com/bistromath/gr-ais/commit/8502d0252a2a1a9b8d1a71795eaeb5d820684054
+    "rev" = "8502d0252a2a1a9b8d1a71795eaeb5d820684054";
+    "sha256" = "1b9j0kc74cw12a7jv4lii77dgzqzg2s8ndzp4xmisxksgva1qfvh";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [
+    cmake boost gnuradio makeWrapper cppunit gnuradio-osmosdr
+  ] ++ stdenv.lib.optionals pythonSupport [ python swig ];
+
+  postInstall = ''
+    for prog in "$out"/bin/*; do
+        wrapProgram "$prog" --set PYTHONPATH $PYTHONPATH:$(toPythonPath "$out")
+    done
+  '';
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    description = "Gnuradio block for ais";
+    homepage = https://github.com/bistromath/gr-ais;
+    license = licenses.gpl3Plus;
+    platforms = platforms.linux ++ platforms.darwin;
+    maintainers = with maintainers; [ mog ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/radio/gnuradio/default.nix b/nixpkgs/pkgs/applications/radio/gnuradio/default.nix
new file mode 100644
index 000000000000..f9a50313c472
--- /dev/null
+++ b/nixpkgs/pkgs/applications/radio/gnuradio/default.nix
@@ -0,0 +1,126 @@
+{ stdenv, fetchFromGitHub, writeText, makeWrapper
+# Dependencies documented @ https://gnuradio.org/doc/doxygen/build_guide.html
+# => core dependencies
+, cmake, pkgconfig, git, boost, cppunit, fftw
+# => python wrappers
+# May be able to upgrade to swig3
+, python, swig2, numpy, scipy, matplotlib
+# => grc - the gnu radio companion
+, Mako, cheetah, pygtk # Note: GR is migrating to Mako. Cheetah should be removed for GR3.8
+# => gr-wavelet: collection of wavelet blocks
+, gsl
+# => gr-qtgui: the Qt-based GUI
+, qt4, qwt, pyqt4
+# => gr-wxgui: the Wx-based GUI
+, wxPython, lxml
+# => gr-audio: audio subsystems (system/OS dependent)
+, alsaLib   # linux   'audio-alsa'
+, CoreAudio # darwin  'audio-osx'
+# => uhd: the Ettus USRP Hardware Driver Interface
+, uhd
+# => gr-video-sdl: PAL and NTSC display
+, SDL
+# Other
+, libusb1, orc, pyopengl
+}:
+
+stdenv.mkDerivation rec {
+  name = "gnuradio-${version}";
+  version = "3.7.13.4";
+
+  src = fetchFromGitHub {
+    owner = "gnuradio";
+    repo = "gnuradio";
+    rev = "v${version}";
+    sha256 = "0ybfn2zfr9lc1bi3c794l4bzpj8y6vas9c4rbcj4nqlx0zf3p8fn";
+    fetchSubmodules = true;
+  };
+
+  nativeBuildInputs = [
+    cmake pkgconfig git makeWrapper cppunit orc
+  ];
+
+  buildInputs = [
+    boost fftw python swig2 lxml qt4
+    qwt SDL libusb1 uhd gsl
+  ] ++ stdenv.lib.optionals stdenv.isLinux  [ alsaLib   ]
+    ++ stdenv.lib.optionals stdenv.isDarwin [ CoreAudio ];
+
+  propagatedBuildInputs = [
+    Mako cheetah numpy scipy matplotlib pyqt4 pygtk wxPython pyopengl
+  ];
+
+  NIX_LDFLAGS = [
+    "-lpthread"
+  ];
+
+  enableParallelBuilding = true;
+
+  postPatch = ''
+    substituteInPlace \
+        gr-fec/include/gnuradio/fec/polar_decoder_common.h \
+        --replace BOOST_CONSTEXPR_OR_CONST const
+  '';
+
+  # Enables composition with nix-shell
+  grcSetupHook = writeText "grcSetupHook.sh" ''
+    addGRCBlocksPath() {
+      addToSearchPath GRC_BLOCKS_PATH $1/share/gnuradio/grc/blocks
+    }
+    addEnvHooks "$targetOffset" addGRCBlocksPath
+  '';
+
+  setupHook = [ grcSetupHook ];
+
+  # patch wxgui and pygtk check due to python importerror in a headless environment
+  # wxgtk gui will be removed in GR3.8
+  # c++11 hack may not be necessary anymore
+  preConfigure = ''
+    export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -Wno-unused-variable ${stdenv.lib.optionalString (!stdenv.isDarwin) "-std=c++11"}"
+    sed -i 's/.*wx\.version.*/set(WX_FOUND TRUE)/g' gr-wxgui/CMakeLists.txt
+    sed -i 's/.*pygtk_version.*/set(PYGTK_FOUND TRUE)/g' grc/CMakeLists.txt
+    find . -name "CMakeLists.txt" -exec sed -i '1iadd_compile_options($<$<COMPILE_LANGUAGE:CXX>:-std=c++11>)' "{}" ";"
+  '';
+
+  # Framework path needed for qwt6_qt4 but not qwt5
+  cmakeFlags =
+    stdenv.lib.optionals stdenv.isDarwin [ "-DCMAKE_FRAMEWORK_PATH=${qwt}/lib" ];
+
+  # - Ensure we get an interactive backend for matplotlib. If not the gr_plot_*
+  #   programs will not display anything. Yes, $MATPLOTLIBRC must point to the
+  #   *dirname* where matplotlibrc is located, not the file itself.
+  # - GNU Radio core is C++ but the user interface (GUI and API) is Python, so
+  #   we must wrap the stuff in bin/.
+  # Notes:
+  # - May want to use makeWrapper instead of wrapProgram
+  # - may want to change interpreter path on Python examples instead of wrapping
+  # - see https://github.com/NixOS/nixpkgs/issues/22688 regarding use of --prefix / python.withPackages
+  # - see https://github.com/NixOS/nixpkgs/issues/24693 regarding use of DYLD_FRAMEWORK_PATH on Darwin
+  postInstall = ''
+    printf "backend : Qt4Agg\n" > "$out/share/gnuradio/matplotlibrc"
+
+    for file in $(find $out/bin $out/share/gnuradio/examples -type f -executable); do
+        wrapProgram "$file" \
+            --prefix PYTHONPATH : $PYTHONPATH:$(toPythonPath "$out") \
+            --set MATPLOTLIBRC "$out/share/gnuradio" \
+            ${stdenv.lib.optionalString stdenv.isDarwin "--set DYLD_FRAMEWORK_PATH /System/Library/Frameworks"}
+    done
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Software Defined Radio (SDR) software";
+    longDescription = ''
+      GNU Radio is a free & open-source software development toolkit that
+      provides signal processing blocks to implement software radios. It can be
+      used with readily-available low-cost external RF hardware to create
+      software-defined radios, or without hardware in a simulation-like
+      environment. It is widely used in hobbyist, academic and commercial
+      environments to support both wireless communications research and
+      real-world radio systems.
+    '';
+    homepage = https://www.gnuradio.org;
+    license = licenses.gpl3;
+    platforms = platforms.linux ++ platforms.darwin;
+    maintainers = with maintainers; [ bjornfor fpletz ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/radio/gnuradio/gsm.nix b/nixpkgs/pkgs/applications/radio/gnuradio/gsm.nix
new file mode 100644
index 000000000000..dcb50df70520
--- /dev/null
+++ b/nixpkgs/pkgs/applications/radio/gnuradio/gsm.nix
@@ -0,0 +1,39 @@
+{ stdenv, fetchFromGitHub, cmake, pkgconfig, boost, gnuradio
+, makeWrapper, cppunit, libosmocore, gnuradio-osmosdr
+, pythonSupport ? true, python, swig
+}:
+
+assert pythonSupport -> python != null && swig != null;
+
+stdenv.mkDerivation rec {
+  name = "gnuradio-gsm-${version}";
+  version = "2016-08-25";
+
+  src = fetchFromGitHub {
+    owner = "ptrkrysik";
+    repo = "gr-gsm";
+    rev = "3ca05e6914ef29eb536da5dbec323701fbc2050d";
+    sha256 = "13nnq927kpf91iqccr8db9ripy5czjl5jiyivizn6bia0bam2pvx";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [
+    cmake boost gnuradio makeWrapper cppunit libosmocore gnuradio-osmosdr
+  ] ++ stdenv.lib.optionals pythonSupport [ python swig ];
+
+  postInstall = ''
+    for prog in "$out"/bin/*; do
+        wrapProgram "$prog" --set PYTHONPATH $PYTHONPATH:${gnuradio-osmosdr}/lib/${python.libPrefix}/site-packages:$(toPythonPath "$out")
+    done
+  '';
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.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/nixpkgs/pkgs/applications/radio/gnuradio/limesdr.nix b/nixpkgs/pkgs/applications/radio/gnuradio/limesdr.nix
new file mode 100644
index 000000000000..0a5d4f56d278
--- /dev/null
+++ b/nixpkgs/pkgs/applications/radio/gnuradio/limesdr.nix
@@ -0,0 +1,38 @@
+{ stdenv, fetchFromGitHub, cmake, boost, gnuradio
+, pythonSupport ? true, python, swig, limesuite
+} :
+
+assert pythonSupport -> python != null && swig != null;
+
+let
+  version = "1.0.0-RC";
+
+in stdenv.mkDerivation rec {
+  name = "gnuradio-limesdr-${version}";
+
+  src = fetchFromGitHub {
+    owner = "myriadrf";
+    repo = "gr-limesdr";
+    rev = "v${version}";
+    sha256 = "0b34mg9nfar2gcir98004ixrxmxi8p3p2hrvvi1razd869x2a0lf";
+  };
+
+  nativeBuildInputs = [
+    cmake
+  ] ++ stdenv.lib.optionals pythonSupport [ swig ];
+
+  buildInputs = [
+    boost gnuradio limesuite
+  ] ++ stdenv.lib.optionals pythonSupport [ python ];
+
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.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/nixpkgs/pkgs/applications/radio/gnuradio/nacl.nix b/nixpkgs/pkgs/applications/radio/gnuradio/nacl.nix
new file mode 100644
index 000000000000..2f4b0e4e3eb6
--- /dev/null
+++ b/nixpkgs/pkgs/applications/radio/gnuradio/nacl.nix
@@ -0,0 +1,39 @@
+{ stdenv, fetchFromGitHub, cmake, pkgconfig, boost, gnuradio, uhd
+, makeWrapper, libsodium, cppunit
+, pythonSupport ? true, python, swig
+}:
+
+assert pythonSupport -> python != null && swig != null;
+
+stdenv.mkDerivation rec {
+  name = "gnuradio-nacl-${version}";
+  version = "2017-04-10";
+
+  src = fetchFromGitHub {
+    owner = "stwunsch";
+    repo = "gr-nacl";
+    rev = "15276bb0fcabf5fe4de4e58df3d579b5be0e9765";
+    sha256 = "018np0qlk61l7mlv3xxx5cj1rax8f1vqrsrch3higsl25yydbv7v";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [
+    cmake boost gnuradio uhd makeWrapper libsodium cppunit
+  ] ++ stdenv.lib.optionals pythonSupport [ python swig ];
+
+  postInstall = ''
+    for prog in "$out"/bin/*; do
+        wrapProgram "$prog" --set PYTHONPATH $PYTHONPATH:$(toPythonPath "$out")
+    done
+  '';
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.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/nixpkgs/pkgs/applications/radio/gnuradio/osmosdr.nix b/nixpkgs/pkgs/applications/radio/gnuradio/osmosdr.nix
new file mode 100644
index 000000000000..846afe0e95d4
--- /dev/null
+++ b/nixpkgs/pkgs/applications/radio/gnuradio/osmosdr.nix
@@ -0,0 +1,47 @@
+{ stdenv, fetchgit, cmake, pkgconfig, makeWrapper
+, boost
+, pythonSupport ? true, python, swig
+, airspy
+, gnuradio
+, hackrf
+, libbladeRF
+, rtl-sdr
+, soapysdr-with-plugins
+, uhd
+}:
+
+assert pythonSupport -> python != null && swig != null;
+
+stdenv.mkDerivation rec {
+  name = "gnuradio-osmosdr-${version}";
+  version = "2018-08-15";
+
+  src = fetchgit {
+    url = "git://git.osmocom.org/gr-osmosdr";
+    rev = "4d83c6067f059b0c5015c3f59f8117bbd361e877";
+    sha256 = "1d5nb47506qry52bg4cn02d3l4lwxwz44g2fz1ph0q93c7892j60";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [
+    cmake makeWrapper boost
+    airspy gnuradio hackrf libbladeRF rtl-sdr uhd
+  ] ++ stdenv.lib.optionals stdenv.isLinux [ soapysdr-with-plugins ]
+    ++ stdenv.lib.optionals pythonSupport [ python swig ];
+
+  postInstall = ''
+    for prog in "$out"/bin/*; do
+        wrapProgram "$prog" --set PYTHONPATH $PYTHONPATH:$(toPythonPath "$out")
+    done
+  '';
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    description = "Gnuradio block for OsmoSDR and rtl-sdr";
+    homepage = https://sdr.osmocom.org/trac/wiki/GrOsmoSDR;
+    license = licenses.gpl3Plus;
+    platforms = platforms.linux ++ platforms.darwin;
+    maintainers = with maintainers; [ bjornfor the-kenny ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/radio/gnuradio/rds.nix b/nixpkgs/pkgs/applications/radio/gnuradio/rds.nix
new file mode 100644
index 000000000000..2e5443227fda
--- /dev/null
+++ b/nixpkgs/pkgs/applications/radio/gnuradio/rds.nix
@@ -0,0 +1,38 @@
+{ stdenv, fetchFromGitHub, cmake, pkgconfig, boost, gnuradio
+, makeWrapper, pythonSupport ? true, python, swig
+}:
+
+assert pythonSupport -> python != null && swig != null;
+
+stdenv.mkDerivation rec {
+  name = "gnuradio-rds-${version}";
+  version = "1.1.0";
+
+  src = fetchFromGitHub {
+    owner = "bastibl";
+    repo = "gr-rds";
+    rev = "v${version}";
+    sha256 = "0jkzchvw0ivcxsjhi1h0mf7k13araxf5m4wi5v9xdgqxvipjzqfy";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [
+    cmake boost gnuradio makeWrapper
+  ] ++ stdenv.lib.optionals pythonSupport [ python swig ];
+
+  postInstall = ''
+    for prog in "$out"/bin/*; do
+        wrapProgram "$prog" --set PYTHONPATH $PYTHONPATH:$(toPythonPath "$out")
+    done
+  '';
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    description = "Gnuradio block for radio data system";
+    homepage = https://github.com/bastibl/gr-rds;
+    license = licenses.gpl2Plus;
+    platforms = platforms.linux ++ platforms.darwin;
+    maintainers = with maintainers; [ mog ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/radio/gnuradio/wrapper.nix b/nixpkgs/pkgs/applications/radio/gnuradio/wrapper.nix
new file mode 100644
index 000000000000..ffed3da03187
--- /dev/null
+++ b/nixpkgs/pkgs/applications/radio/gnuradio/wrapper.nix
@@ -0,0 +1,24 @@
+{ stdenv, gnuradio, makeWrapper, python, extraPackages ? [] }:
+
+with { inherit (stdenv.lib) appendToName makeSearchPath; };
+
+stdenv.mkDerivation {
+  name = (appendToName "with-packages" gnuradio).name;
+  buildInputs = [ makeWrapper python ];
+
+  buildCommand = ''
+    mkdir -p $out/bin
+    ln -s "${gnuradio}"/bin/* $out/bin/
+
+    for file in $(find -L $out/bin -type f); do
+        if test -x "$(readlink -f "$file")"; then
+            wrapProgram "$file" \
+                --prefix PYTHONPATH : ${stdenv.lib.concatStringsSep ":"
+                                         (map (path: "$(toPythonPath ${path})") extraPackages)} \
+                --prefix GRC_BLOCKS_PATH : ${makeSearchPath "share/gnuradio/grc/blocks" extraPackages}
+        fi
+    done
+  '';
+
+  inherit (gnuradio) meta;
+}