4a7f99d55d
Part of: https://github.com/NixOS/nixpkgs/issues/108938 meta = with stdenv.lib; is a widely used pattern. We want to slowly remove the `stdenv.lib` indirection and encourage people to use `lib` directly. Thus let’s start with the meta field. This used a rewriting script to mostly automatically replace all occurances of this pattern, and add the `lib` argument to the package header if it doesn’t exist yet. The script in its current form is available at https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
46 lines
1.2 KiB
Nix
46 lines
1.2 KiB
Nix
{ lib, stdenv, fetchgit, cmake, pkg-config, makeWrapper
|
|
, boost
|
|
, pythonSupport ? true, python, swig
|
|
, airspy
|
|
, gnuradio
|
|
, hackrf
|
|
, libbladeRF
|
|
, rtl-sdr
|
|
, soapysdr-with-plugins
|
|
, uhd
|
|
, log4cpp
|
|
}:
|
|
|
|
assert pythonSupport -> python != null && swig != null;
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "gr-osmosdr";
|
|
version = "0.1.5";
|
|
|
|
src = fetchgit {
|
|
url = "git://git.osmocom.org/gr-osmosdr";
|
|
rev = "v${version}";
|
|
sha256 = "0bf9bnc1c3c4yqqqgmg3nhygj6rcfmyk6pybi27f7461d2cw1drv";
|
|
};
|
|
|
|
nativeBuildInputs = [ cmake makeWrapper pkg-config ];
|
|
buildInputs = [
|
|
boost log4cpp airspy gnuradio hackrf libbladeRF rtl-sdr uhd
|
|
] ++ stdenv.lib.optionals stdenv.isLinux [ soapysdr-with-plugins ]
|
|
++ stdenv.lib.optionals pythonSupport [ python swig python.pkgs.cheetah ];
|
|
|
|
postInstall = ''
|
|
for prog in "$out"/bin/*; do
|
|
wrapProgram "$prog" --set PYTHONPATH $PYTHONPATH:$(toPythonPath "$out")
|
|
done
|
|
'';
|
|
|
|
meta = with 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 ];
|
|
};
|
|
}
|