about summary refs log tree commit diff
path: root/pkgs/applications/radio/hackrf/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/applications/radio/hackrf/default.nix')
-rw-r--r--pkgs/applications/radio/hackrf/default.nix32
1 files changed, 32 insertions, 0 deletions
diff --git a/pkgs/applications/radio/hackrf/default.nix b/pkgs/applications/radio/hackrf/default.nix
new file mode 100644
index 000000000000..81a66bf503c0
--- /dev/null
+++ b/pkgs/applications/radio/hackrf/default.nix
@@ -0,0 +1,32 @@
+{ stdenv, fetchFromGitHub, cmake, pkgconfig, libusb, fftwSinglePrec }:
+
+stdenv.mkDerivation rec {
+  name = "hackrf-${version}";
+  version = "2018.01.1";
+
+  src = fetchFromGitHub {
+    owner = "mossmann";
+    repo = "hackrf";
+    rev = "v${version}";
+    sha256 = "0idh983xh6gndk9kdgx5nzz76x3mxb42b02c5xvdqahadsfx3b9w";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [
+    cmake libusb fftwSinglePrec
+  ];
+
+  cmakeFlags = [ "-DUDEV_RULES_GROUP=plugdev" "-DUDEV_RULES_PATH=lib/udev/rules.d" ];
+
+  preConfigure = ''
+    cd host
+  '';
+
+  meta = with stdenv.lib; {
+    description = "An open source SDR platform";
+    homepage = http://greatscottgadgets.com/hackrf/;
+    license = licenses.gpl2;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ sjmackenzie the-kenny ];
+  };
+}