Skip to content

sdrpp: fix darwin build & server mode, add options, simplify#452963

Merged
SuperSandro2000 merged 3 commits into
NixOS:masterfrom
zaninime:push-swrkpwlpsxko
Nov 25, 2025
Merged

sdrpp: fix darwin build & server mode, add options, simplify#452963
SuperSandro2000 merged 3 commits into
NixOS:masterfrom
zaninime:push-swrkpwlpsxko

Conversation

@zaninime

@zaninime zaninime commented Oct 17, 2025

Copy link
Copy Markdown
Contributor

2 commits:

  1. soapysdr-with-plugins: split linux-only plugins (would prevent the build of sdrpp)
  2. sdrpp: fix the server mode, add missing options

The second required reworking the previous patch and altering the packaging slightly, also to include new options.

Things done

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.

Add a 👍 reaction to pull requests you find important.

/cc @sikmir

@nixpkgs-ci nixpkgs-ci Bot added 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. 10.rebuild-darwin: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. labels Oct 17, 2025
@nix-owners nix-owners Bot requested a review from sikmir October 17, 2025 15:52
@rafaelrc7

Copy link
Copy Markdown
Member

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 452963
Commit: ab638847058fd2a70e6b7aaa6d0a1576bb198686


x86_64-linux

❌ 5 packages failed to build:
  • cubicsdr
  • dumphfdl
  • openwebrx
  • openwebrx.dist
  • pothos
✅ 22 packages built:
  • abracadabra
  • dump1090-fa
  • gnss-sdr
  • gnuradioPackages.bladeRF
  • gnuradioPackages.osmosdr
  • gnuradioPackages.osmosdr.dev
  • gqrx
  • gqrx-gr-audio
  • gqrx-portaudio
  • python312Packages.soapysdr-with-plugins
  • python313Packages.soapysdr-with-plugins
  • qradiolink
  • rtl_433
  • sdrangel
  • sdrpp
  • sigdigger
  • soapysdr-with-plugins
  • srsran
  • srsran.dev
  • suscan
  • trunk-recorder
  • welle-io

Error logs: `x86_64-linux`
cubicsdr
Running phase: patchPhase
@nix { "action": "setPhase", "phase": "patchPhase" }
applying patch /nix/store/h0winyjri026ddvsgid50v0xjhv5zvfj-0e3a785bd2af56d18ff06b56579197b3e89b34ab.patch
patching file src/process/SpectrumVisualProcessor.cpp
Running phase: updateAutotoolsGnuConfigScriptsPhase
@nix { "action": "setPhase", "phase": "updateAutotoolsGnuConfigScriptsPhase" }
Running phase: configurePhase
@nix { "action": "setPhase", "phase": "configurePhase" }
cmake flags: -DCMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY=OFF -DCMAKE_FIND_USE_PACKAGE_REGISTRY=OFF -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF -DCMAKE_INSTALL_LOCALEDIR=/nix/store/mfvcr661zjik36ygsba3lcmd6qs7iqdn-cubicsdr-0.2.7/share/locale -DCMAKE_INSTALL_LIBEXECDIR=/nix/store/mfvcr661zjik36ygsba3lcmd6qs7iqdn-cubicsdr-0.2.7/libexec -DCMAKE_INSTALL_LIBDIR=/nix/store/mfvcr661zjik36ygsba3lcmd6qs7iqdn-cubicsdr-0.2.7/lib -DCMAKE_INSTALL_DOCDIR=/nix/store/mfvcr661zjik36ygsba3lcmd6qs7iqdn-cubicsdr-0.2.7/share/doc/CubicSDR -DCMAKE_INSTALL_INFODIR=/nix/store/mfvcr661zjik36ygsba3lcmd6qs7iqdn-cubicsdr-0.2.7/share/info -DCMAKE_INSTALL_MANDIR=/nix/store/mfvcr661zjik36ygsba3lcmd6qs7iqdn-cubicsdr-0.2.7/share/man -DCMAKE_INSTALL_INCLUDEDIR=/nix/store/mfvcr661zjik36ygsba3lcmd6qs7iqdn-cubicsdr-0.2.7/include -DCMAKE_INSTALL_SBINDIR=/nix/store/mfvcr661zjik36ygsba3lcmd6qs7iqdn-cubicsdr-0.2.7/sbin -DCMAKE_INSTALL_BINDIR=/nix/store/mfvcr661zjik36ygsba3lcmd6qs7iqdn-cubicsdr-0.2.7/bin -DCMAKE_INSTALL_NAME_DIR=/nix/store/mfvcr661zjik36ygsba3lcmd6qs7iqdn-cubicsdr-0.2.7/lib -DCMAKE_POLICY_DEFAULT_CMP0025=NEW -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_STRIP=/nix/store/dmypp1h4ldn0vfk3fi6yfyf5yxp9yz0k-gcc-wrapper-14.3.0/bin/strip -DCMAKE_RANLIB=/nix/store/dmypp1h4ldn0vfk3fi6yfyf5yxp9yz0k-gcc-wrapper-14.3.0/bin/ranlib -DCMAKE_AR=/nix/store/dmypp1h4ldn0vfk3fi6yfyf5yxp9yz0k-gcc-wrapper-14.3.0/bin/ar -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_INSTALL_PREFIX=/nix/store/mfvcr661zjik36ygsba3lcmd6qs7iqdn-cubicsdr-0.2.7 -DUSE_HAMLIB=ON
CMake Error at CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 3.5 has been removed from CMake.

Update the VERSION argument <min> value. Or, use the <min>...<max> syntax
to tell CMake that the project requires at least <min> but has been updated
to work with policies introduced by <max> or earlier.

Or, add -DCMAKE_POLICY_VERSION_MINIMUM=3.5 to try configuring anyway.

-- Configuring incomplete, errors occurred!

pothos
patching file blocks/file/BinaryFileSink.cpp
patching file blocks/file/BinaryFileSource.cpp
patching file blocks/file/TextFileSink.cpp
patching file soapy/DemoController.cpp
Running phase: updateAutotoolsGnuConfigScriptsPhase
@nix { "action": "setPhase", "phase": "updateAutotoolsGnuConfigScriptsPhase" }
Running phase: configurePhase
@nix { "action": "setPhase", "phase": "configurePhase" }
cmake flags: -DCMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY=OFF -DCMAKE_FIND_USE_PACKAGE_REGISTRY=OFF -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF -DCMAKE_INSTALL_LOCALEDIR=/nix/store/iwhx9h7c8ky463x3q4svyka4s9pqwqf8-pothos-0.7.1/share/locale -DCMAKE_INSTALL_LIBEXECDIR=/nix/store/iwhx9h7c8ky463x3q4svyka4s9pqwqf8-pothos-0.7.1/libexec -DCMAKE_INSTALL_LIBDIR=/nix/store/iwhx9h7c8ky463x3q4svyka4s9pqwqf8-pothos-0.7.1/lib -DCMAKE_INSTALL_DOCDIR=/nix/store/iwhx9h7c8ky463x3q4svyka4s9pqwqf8-pothos-0.7.1/share/doc/Pothos -DCMAKE_INSTALL_INFODIR=/nix/store/iwhx9h7c8ky463x3q4svyka4s9pqwqf8-pothos-0.7.1/share/info -DCMAKE_INSTALL_MANDIR=/nix/store/iwhx9h7c8ky463x3q4svyka4s9pqwqf8-pothos-0.7.1/share/man -DCMAKE_INSTALL_INCLUDEDIR=/nix/store/iwhx9h7c8ky463x3q4svyka4s9pqwqf8-pothos-0.7.1/include -DCMAKE_INSTALL_SBINDIR=/nix/store/iwhx9h7c8ky463x3q4svyka4s9pqwqf8-pothos-0.7.1/sbin -DCMAKE_INSTALL_BINDIR=/nix/store/iwhx9h7c8ky463x3q4svyka4s9pqwqf8-pothos-0.7.1/bin -DCMAKE_INSTALL_NAME_DIR=/nix/store/iwhx9h7c8ky463x3q4svyka4s9pqwqf8-pothos-0.7.1/lib -DCMAKE_POLICY_DEFAULT_CMP0025=NEW -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_STRIP=/nix/store/dmypp1h4ldn0vfk3fi6yfyf5yxp9yz0k-gcc-wrapper-14.3.0/bin/strip -DCMAKE_RANLIB=/nix/store/dmypp1h4ldn0vfk3fi6yfyf5yxp9yz0k-gcc-wrapper-14.3.0/bin/ranlib -DCMAKE_AR=/nix/store/dmypp1h4ldn0vfk3fi6yfyf5yxp9yz0k-gcc-wrapper-14.3.0/bin/ar -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_INSTALL_PREFIX=/nix/store/iwhx9h7c8ky463x3q4svyka4s9pqwqf8-pothos-0.7.1
CMake Error at CMakeLists.txt:4 (cmake_minimum_required):
  Compatibility with CMake < 3.5 has been removed from CMake.

Update the VERSION argument <min> value. Or, use the <min>...<max> syntax
to tell CMake that the project requires at least <min> but has been updated
to work with policies introduced by <max> or earlier.

Or, add -DCMAKE_POLICY_VERSION_MINIMUM=3.5 to try configuring anyway.

-- Configuring incomplete, errors occurred!

@rafaelrc7 rafaelrc7 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Taking a look at hydra, cubicsdr and pothos are failing already, and the other packages failing are dependants. So it's not this PRs fault.

sdrpp built fine and also the --server mode is working properly! I was planning to open a PR to fix it (following what the current solution does) but was waiting for the other open PRs to be closed. Anyway, your solution looks much more clean, thanks a lot.

However, shouldn't the commit and PR names be sdrpp: 1.1.0-unstable-2024-01-22 -> 1.2.1-unstable-2025-10-06, as per pkgs/README.md#commit-conventions and pkgs/README.md#Versioning?

Other comments were made on the changes.

Comment thread pkgs/by-name/sd/sdrpp/package.nix Outdated
Comment thread pkgs/by-name/sd/sdrpp/package.nix Outdated
Comment thread pkgs/by-name/sd/sdrpp/package.nix Outdated
@zaninime zaninime force-pushed the push-swrkpwlpsxko branch 2 times, most recently from 682b790 to e7cb262 Compare October 18, 2025 09:00
@zaninime zaninime changed the title sdrpp: update to unstable-2025-10-06 sdrpp: 1.1.0-unstable-2024-01-22 -> 1.2.1-unstable-2025-10-09 Oct 18, 2025
@zaninime zaninime requested a review from rafaelrc7 October 18, 2025 09:01
@rafaelrc7

Copy link
Copy Markdown
Member

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 452963 --package-regex sdrpp
Commit: e7cb262289ea5584989866ed82786f32be9f395c


x86_64-linux

✅ 1 package built:
  • sdrpp

@nixpkgs-ci nixpkgs-ci Bot added the 12.approvals: 1 This PR was reviewed and approved by one person. label Oct 18, 2025
@zaninime

Copy link
Copy Markdown
Contributor Author

@rafaelrc7, while I was at it, I decided to change the patch a bit: https://github.com/AlexandreRouma/SDRPlusPlus/compare/master...zaninime:SDRPlusPlus:adapt-nix?expand=1

The differences are:

  1. @prefix@ is replaced only when present, so the configurability of the paths is not lost.
  2. @prefix@ is also put back in the configuration saved on the disk. This was not necessary before, as the path was unconditionally replaced during config load, however I found it confusing to see an invalid path written in the config file.
  3. The prefix can be overridden by setting the env var SDRPP_PREFIX. This helps with building a custom sdrpp derivation with extra modules.

Do you think it's worth adding to this PR?

@rafaelrc7

Copy link
Copy Markdown
Member

@rafaelrc7, while I was at it, I decided to change the patch a bit: https://github.com/AlexandreRouma/SDRPlusPlus/compare/master...zaninime:SDRPlusPlus:adapt-nix?expand=1

The differences are:

1. `@prefix@` is replaced only when present, so the configurability of the paths is not lost.

2. `@prefix@` is also put back in the configuration saved on the disk. This was not necessary before, as the path was unconditionally replaced during config load, however I found it confusing to see an invalid path written in the config file.

3. The prefix can be overridden by setting the env var `SDRPP_PREFIX`. This helps with building a custom sdrpp derivation with extra modules.

Do you think it's worth adding to this PR?

The code seems fine, and I guess does help experimenting with other modules, so I think it is worth it.

@rafaelrc7 rafaelrc7 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I forgot to submit the review

Comment thread pkgs/by-name/sd/sdrpp/package.nix Outdated
@zaninime zaninime force-pushed the push-swrkpwlpsxko branch 2 times, most recently from d457504 to 4119720 Compare October 20, 2025 13:55
@zaninime

Copy link
Copy Markdown
Contributor Author

Okay, I guess it should be really ready :)

@rafaelrc7

Copy link
Copy Markdown
Member

I believe there is something wrong with the patch. I tried running it through nixpkgs-review, it built fine for both x86_64 and aarch64-linux.

However, when I tried to run the binary it errored:

[nix-shell:~/.cache/nixpkgs-review/pr-452963-8]$ results/sdrpp-x86_64-linux/bin/sdrpp 
[20/10/2025 16:21:40.000] [INFO] SDR++ v1.2.1-unstable-2025-10-09
[20/10/2025 16:21:40.000] [INFO] Loading config
[20/10/2025 16:21:40.000] [ERROR] Resource directory doesn't exist! Please make sure that you've configured it correctly in config.json (check readme for details)

You can reproduce it by running nix run nixpkgs#nixpkgs-review -- pr --package-regex "sdrpp" 452963. Could you take a look at this? If I find out the problem before, I'll comment.

@zaninime

Copy link
Copy Markdown
Contributor Author

I can't reproduce it. Could it be that your config.json actually points to an invalid location? I tried changing mine, both with @prefix@ in it, as well as with a concrete path to the derivation. It works in both cases.

@rafaelrc7

Copy link
Copy Markdown
Member

I can't reproduce it. Could it be that your config.json actually points to an invalid location? I tried changing mine, both with @prefix@ in it, as well as with a concrete path to the derivation. It works in both cases.

You are right. I deleted my config.json file and tried again and it worked. It seems that the patch is fine, but maybe it is incompatible with previous behaviour? If that's true, this surpasses my nixpkgs knowledge and I don't know if this makes this update supposed to be marked as "breaking".

Anyway, with that sorted, I think the code itself is fine now.

@rafaelrc7

Copy link
Copy Markdown
Member

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 452963 --package-regex sdrpp
Commit: 4119720a4e77d99c087e3288f0d69bee4168741a


x86_64-linux

✅ 1 package built:
  • sdrpp

aarch64-linux

✅ 1 package built:
  • sdrpp

@rafaelrc7

Copy link
Copy Markdown
Member

Also, for further referece, I forgot to try the --server functionality. When I ran it for the first time, it crashed:

[nix-shell:~/.cache/nixpkgs-review/pr-452963-9]$ ./results/sdrpp-x86_64-linux/bin/sdrpp --server
[20/10/2025 17:18:53.000] [INFO] SDR++ v1.2.1-unstable-2025-10-09
[20/10/2025 17:18:53.000] [INFO] Loading config
[20/10/2025 17:18:53.000] [INFO] =====| SERVER MODE |=====
[20/10/2025 17:18:53.000] [INFO] Loading modules
[20/10/2025 17:18:53.000] [WARN] Module directory /home/rafael/.cache/nixpkgs-review/pr-452963-9/@prefix@/lib/sdrpp/plugins does not exist, not loading modules from directory
Segmentation fault         (core dumped) ./results/sdrpp-x86_64-linux/bin/sdrpp --server

However, when I ran it again it worked, and it did not crash again. I don't know the reason, there might be an edge-case bug in your patch, but, as I mentioned, after the first time crash, it did not happen again.

@zaninime

Copy link
Copy Markdown
Contributor Author

Mmh, I'm also not able to reproduce it. What I observed is that the software crashes when it's not finding any module, which is consistent with the warning message you got ([20/10/2025 17:18:53.000] [WARN] Module directory /home/rafael/.cache/nixpkgs-review/pr-452963-9/@prefix@/lib/sdrpp/plugins does not exist, not loading modules from directory)

But apparently the software fixed the configuration afterwards all by itself? Also the path mentioned is weird. @prefix@ should appear at the very beginning of the string only. At the moment it would be replaced with eg. /home/rafael/.cache/nixpkgs-review/pr-452963-9//nix/store/.../lib/sdrpp/plugins

@ofborg ofborg Bot added the 6.topic: darwin Running or building packages on Darwin label Oct 30, 2025
@zaninime

Copy link
Copy Markdown
Contributor Author

Rebased atop master due to conflicts from #450737

@rafaelrc7

Copy link
Copy Markdown
Member

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 452963 --package-regex sdrpp
Commit: 504bb0011dbcea59b4c2e85e83a26ed074f9f479


x86_64-linux

✅ 1 package built:
  • sdrpp

Comment thread pkgs/top-level/all-packages.nix Outdated
@zaninime zaninime requested a review from sikmir November 11, 2025 20:32
@zaninime

Copy link
Copy Markdown
Contributor Author

@sikmir any outstanding concerns? Could I ask you to otherwise please merge?

Comment thread pkgs/top-level/all-packages.nix Outdated
soapyremote
soapyrtlsdr
]
++ (lib.optionals stdenv.hostPlatform.isLinux [
soapybladerf

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can fix soapybladerf build on darwin by fixing libbladeRF:

--- i/pkgs/by-name/li/libbladeRF/package.nix
+++ w/pkgs/by-name/li/libbladeRF/package.nix
@@ -62,7 +62,7 @@ stdenv.mkDerivation rec {
   ];

   env = lib.optionalAttrs stdenv.cc.isClang {
-    NIX_CFLAGS_COMPILE = "-Wno-error=unused-but-set-variable";
+    NIX_CFLAGS_COMPILE = "-Wno-error=unused-but-set-variable -Wno-error=tautological-overlap-compare";
   };

   hardeningDisable = [ "fortify" ];

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be part of this PR? Happy to open a separate one for that.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added as a separate commit to this PR.

Comment thread pkgs/top-level/all-packages.nix Outdated
Allow clean-build of soapysdr-with-plugins on Darwin.
- rework patch to apply more cleanly and cover all entrypoints in one
  place.
- add `audio_source` parameter, useful for making "server only" builds
  (avoid dependency on rtaudio in these builds)
- fix build on Darwin by disabling soapyplutosdr, which in turns depends
  on libiio (Linux only)
@zaninime zaninime requested a review from sikmir November 11, 2025 21:16
@nixpkgs-ci nixpkgs-ci Bot requested a review from markuskowa November 11, 2025 21:24
@nixpkgs-ci nixpkgs-ci Bot added 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. and removed 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. labels Nov 11, 2025
@sikmir

sikmir commented Nov 11, 2025

Copy link
Copy Markdown
Member

#457704

@zaninime

Copy link
Copy Markdown
Contributor Author

The PR you linked is not ready. They are still waiting on uhd to catch up. Anything else here?


env = lib.optionalAttrs stdenv.cc.isClang {
NIX_CFLAGS_COMPILE = "-Wno-error=unused-but-set-variable";
NIX_CFLAGS_COMPILE = "-Wno-error=unused-but-set-variable -Wno-error=tautological-overlap-compare";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should just omit Werror that is somewhere in the source code.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Na, this is just a warning clang per default treats as error.

version_number = "1.2.1";

version = "${version_number}-unstable-" + git_date;
upstreamVersion = "1.2.1";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would call this releaseVersion but details.

@SuperSandro2000 SuperSandro2000 added this pull request to the merge queue Nov 25, 2025
@nixpkgs-ci nixpkgs-ci Bot added 12.approvals: 2 This PR was reviewed and approved by two persons. and removed 12.approvals: 1 This PR was reviewed and approved by one person. labels Nov 25, 2025
Merged via the queue into NixOS:master with commit fc34e90 Nov 25, 2025
37 of 38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: darwin Running or building packages on Darwin 10.rebuild-darwin: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. 12.approvals: 2 This PR was reviewed and approved by two persons.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants