···11+{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, fftw, hackrf, libusb1 }:
22+33+stdenv.mkDerivation rec {
44+ name = "kalibrate-hackrf-unstable-20160827";
55+66+ # There are no tags/releases, so use the latest commit from git master.
77+ # Currently, the latest commit is from 2016-07-03.
88+ src = fetchFromGitHub {
99+ owner = "scateu";
1010+ repo = "kalibrate-hackrf";
1111+ rev = "2492c20822ca6a49dce97967caf394b1d4b2c43e";
1212+ sha256 = "1jvn1qx7csgycxpx1k804sm9gk5a0c65z9gh8ybp9awq3pziv0nx";
1313+ };
1414+1515+ nativeBuildInputs = [ autoreconfHook pkgconfig ];
1616+1717+ buildInputs = [ fftw hackrf libusb1 ];
1818+1919+ postInstall = ''
2020+ mv $out/bin/kal $out/bin/kal-hackrf
2121+ '';
2222+2323+ meta = with stdenv.lib; {
2424+ description = "Calculate local oscillator frequency offset in hackrf devices";
2525+ longDescription = ''
2626+ Kalibrate, or kal, can scan for GSM base stations in a given frequency
2727+ band and can use those GSM base stations to calculate the local
2828+ oscillator frequency offset.
2929+3030+ This package is for hackrf devices.
3131+ '';
3232+ homepage = https://github.com/scateu/kalibrate-hackrf;
3333+ license = licenses.bsd2;
3434+ platforms = platforms.linux;
3535+ maintainers = [ maintainers.mog ];
3636+ };
3737+}