nixpkgs/pkgs/applications/radio/gnuradio/ais.nix
Doron Behar 3becac02f8 gnuradio: rewrite
Write (similar) expressions for GNURadio 3.7 and 3.8 and make 3.8
available as `gnuradio`, and `gnuradio3_7` point to the 3.7 build.

Teach both 3.7 & 3.8 expressions accept a `features` attribute set, that
tells them what features to compile. There are dependencies within the
different features, and we rely on upstream's cmake scripts to make sure
the `configurePhase` will fail if a feature is not enabled and needed by
another feature.  All features are enabled by default.

Put shared Nix functions and attributes for both 3.7 and 3.8 in:
pkgs/applications/radio/gnuradio/shared.nix

Add 2 patches accepted upstream, that don't install some python related
examples if python-support is not enabled.

Remove cmake python reference in 3.8 with removeReferencesTo, if
python-support is turned off.

Update gqrx (reverse dependency) to use a build of gnuradio3_7 without
gui components and for it's gr-osmosdr as well.

Write an external, `wrapper.nix` (shared for both 3.7 and 3.8). Teach it
to handle extra `gr-` packages via `GRC_BLOCKS_PATH`. Likely enable it
to accept extra python packages. Wrap the executables with env vars
wrapGAppsHook and wrapQtAppsHook would have likely given them (hence,
fix #87510). Point `gnuradio` to the wrapped 3.8 derivation.

Add @doronbehar to maintainers of both 3.8 and 3.7.

dirty: use upstreamed patches
2020-12-05 13:23:00 +02:00

41 lines
1.2 KiB
Nix

{ stdenv, fetchFromGitHub, cmake, pkgconfig, boost, gnuradio
, makeWrapper, cppunit, gr-osmosdr, log4cpp
, pythonSupport ? true, python, swig
}:
assert pythonSupport -> python != null && swig != null;
stdenv.mkDerivation {
pname = "gr-ais";
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 gr-osmosdr log4cpp
] ++ 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 ];
};
}