commit 8536b610f03dee528e6cb2d8c908125fca906fa8 parent 038f4f471bc5b4a81cb907389d87b4255381b6bb Author: Bradley Gannon <bradley@bradleygannon.com> Date: Tue, 1 Sep 2026 21:08:02 -0400 Build SDR++ module against version in nixpkgs by default Diffstat:
| M | flake.nix | | | 47 | +++++++++++++++++++++++++++++++++++++++++++++++ |
1 file changed, 47 insertions(+), 0 deletions(-)
diff --git a/flake.nix b/flake.nix @@ -21,8 +21,54 @@ zstd ]; lib-path = with stable; lib.makeLibraryPath libInputs; + + civ-sync = stable.stdenv.mkDerivation { + pname = "civ-sync"; + version = "0.1.0"; + + src = ./civ_module; + + nativeBuildInputs = with stable; [ + cmake + cargo + rustc + ]; + + buildInputs = with stable; [ + fftwFloat + glfw + libGL + sdrpp + volk + zstd + ]; + + dontConfigure = true; + + buildPhase = '' + runHook preBuild + cargo build --release --offline + cmake -S shim -B build \ + -DCMAKE_BUILD_TYPE=Release \ + -DSDRPP_DIR=${stable.sdrpp.src} \ + -DSDRPP_CORE_LIB=${stable.sdrpp}/lib/libsdrpp_core.so + cmake --build build + runHook postBuild + ''; + + installPhase = '' + runHook preInstall + install -Dm755 build/civ_sync.so "$out/lib/sdrpp/plugins/civ_sync.so" + runHook postInstall + ''; + }; in { + packages.${system} = { + inherit civ-sync; + default = civ-sync; + }; + devShells.${system}.default = stable.mkShellNoCC { packages = with stable; [ cargo @@ -33,6 +79,7 @@ rust-analyzer rustc rustfmt + sdrpp systemd udev ] ++ libInputs;