···1+{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, fftw, hackrf, libusb1 }:
2+3+stdenv.mkDerivation rec {
4+ name = "kalibrate-hackrf-unstable-20160827";
5+6+ # There are no tags/releases, so use the latest commit from git master.
7+ # Currently, the latest commit is from 2016-07-03.
8+ src = fetchFromGitHub {
9+ owner = "scateu";
10+ repo = "kalibrate-hackrf";
11+ rev = "2492c20822ca6a49dce97967caf394b1d4b2c43e";
12+ sha256 = "1jvn1qx7csgycxpx1k804sm9gk5a0c65z9gh8ybp9awq3pziv0nx";
13+ };
14+15+ nativeBuildInputs = [ autoreconfHook pkgconfig ];
16+17+ buildInputs = [ fftw hackrf libusb1 ];
18+19+ postInstall = ''
20+ mv $out/bin/kal $out/bin/kal-hackrf
21+ '';
22+23+ meta = with stdenv.lib; {
24+ description = "Calculate local oscillator frequency offset in hackrf devices";
25+ longDescription = ''
26+ Kalibrate, or kal, can scan for GSM base stations in a given frequency
27+ band and can use those GSM base stations to calculate the local
28+ oscillator frequency offset.
29+30+ This package is for hackrf devices.
31+ '';
32+ homepage = https://github.com/scateu/kalibrate-hackrf;
33+ license = licenses.bsd2;
34+ platforms = platforms.linux;
35+ maintainers = [ maintainers.mog ];
36+ };
37+}