Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

satdump: init at 1.2.2 #369540

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

theverygaming
Copy link

@theverygaming theverygaming commented Dec 31, 2024

Closes: #314003

Packaged SatDump, a software to receive, decode and process data from satellites.

See https://www.satdump.org/about/ and https://github.com/SatDump/SatDump

Also https://repology.org/project/satdump/versions

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 25.05 Release Notes (or backporting 24.11 and 25.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@github-actions github-actions bot added the 8.has: maintainer-list (update) This PR changes `maintainers/maintainer-list.nix` label Dec 31, 2024
@NixOSInfra NixOSInfra added the 12. first-time contribution This PR is the author's first one; please be gentle! label Dec 31, 2024
@github-actions github-actions bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 labels Dec 31, 2024
@lucasew
Copy link
Contributor

lucasew commented Dec 31, 2024

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 369540


x86_64-linux

✅ 1 package built:
  • satdump

@github-actions github-actions bot added 10.rebuild-darwin: 1-10 and removed 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin labels Dec 31, 2024
@ofborg ofborg bot added the 8.has: package (new) This PR adds a new package label Dec 31, 2024
@ofborg ofborg bot requested a review from nviets December 31, 2024 14:44
@lucasew
Copy link
Contributor

lucasew commented Dec 31, 2024

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 369540


x86_64-linux

❌ 10 packages failed to build:
  • python312Packages.nipy
  • python312Packages.nipy.dist
  • python312Packages.niworkflows
  • python312Packages.niworkflows.dist
  • python312Packages.transforms3d
  • python312Packages.transforms3d.dist
  • python313Packages.nipy
  • python313Packages.nipy.dist
  • python313Packages.transforms3d
  • python313Packages.transforms3d.dist
✅ 5 packages built:
  • dotbot
  • dotbot.dist
  • nezha-theme-admin
  • nng
  • satdump

@theverygaming
Copy link
Author

theverygaming commented Jan 1, 2025

@lucasew running nixpkgs-review pr 369540 for me only builds satdump and nng, both successfully.

@lucasew
Copy link
Contributor

lucasew commented Jan 1, 2025

@lucasew running nixpkgs-review pr 369540 for me only builds satdump and nng, both successfully.

It is happening sometimes
Mic92/nixpkgs-review#446

@Erethon
Copy link
Contributor

Erethon commented Jan 5, 2025

I'll let other people properly review this, but it compiles and works with an rtl-sdr for me, so LGTM and thank you for the packaging effort!

@lucasew
Copy link
Contributor

lucasew commented Jan 5, 2025

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 369540


x86_64-linux

✅ 2 packages built:
  • nng
  • satdump

--replace-fail '$'{CMAKE_INSTALL_PREFIX}/'$'{CMAKE_INSTALL_LIBDIR} '$'{CMAKE_INSTALL_FULL_LIBDIR}
'';

passthru.updateScript = gitUpdater { };
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd recommend using nix-update-script instead, as it is more robust.

description = "A generic satellite data processing software";
homepage = "https://www.satdump.org/";
changelog = "https://github.com/SatDump/SatDump/releases/tag/${finalAttrs.version}";
license = lib.licenses.gpl3Only;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
license = lib.licenses.gpl3Only;
license = lib.licenses.gpl3Plus;

The license contains the "or (at your option) any later version" clause

# Optional dependencies
withZIQRecordingCompression ? true,
zstd,
withGUI ? true,
Copy link
Contributor

@Pandapip1 Pandapip1 Jan 15, 2025

Choose a reason for hiding this comment

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

Two things:

  • I can't imagine that too many people will be using these option flags. They are typically used when a non-free dependency has to be used to enable the feature, or if the option significantly changes how the program works (e.g. monado's tracing support). This is a lot to maintain, and disk space is relatively cheap nowadays.
  • If you decide to keep the flags, can I recommend you put them at the bottom of the parameter list so they can be differentiated from dependencies at a glance?

Copy link
Author

Choose a reason for hiding this comment

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

  • I chose to add these options because most of them are SDR sources, realistically people may only own a small subset of the receivers the software supports, so they may prefer to keep some of them disabled to save disk space. I can see SatDump being used in more embedded-ish applications where disk space may actually matter
  • Each of the flags is above the dependencies it enables, which i think is more readable than having the dependencies alltogether above the flags

Copy link
Contributor

@Pandapip1 Pandapip1 Jan 16, 2025

Choose a reason for hiding this comment

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

I can see SatDump being used in more embedded-ish applications where disk space may actually matter

I decided to try to measure the closure size of the dependencies you are concerned about. The full derivation, including all of the dependencies, is 7.53 MiB. I'll agree that withGUI makes sense to keep; disabling it should reduce the closure size by about 3 MiB... if it built correctly:

❯ nix build /nix/store/g23w6778khi5w333lgbfk7fcqy65cjys-satdump-1.2.2.drv^*
error: builder for '/nix/store/g23w6778khi5w333lgbfk7fcqy65cjys-satdump-1.2.2.drv' failed with exit code 1;
       last 25 log lines:
       > -- Found JEMALLOC headers: /nix/store/5nmvrb919gjjjdqy5xp3rb049ksmgbiz-jemalloc-5.3.0/include
       > -- Checking for module 'volk'
       > --   Found volk, version 3.1
       > -- Performing Test VOLK_HAS_ALLOC
       > -- Performing Test VOLK_HAS_ALLOC - Success
       > -- Found ZLIB: /nix/store/cqlaa2xf6lslnizyj9xqa8j0ii1yqw0x-zlib-1.3.1/lib/libz.so (found version "1.3.1")
       > -- Found PNG: /nix/store/ayk2mh02j7wrvgx17155xcwvpmgrzzka-libpng-apng-1.6.43/lib/libpng.so (found version "1.6.43")
       > -- Checking for module 'fftw3f'
       > --   Found fftw3f, version 3.3.10
       > -- Found CURL: /nix/store/8yfak7dis3yqqls4mclzp5jb1ic2jzab-curl-8.11.0/lib/libcurl.so (found version "8.11.0")
       > -- Building with curl!
       > -- Performing Test VOLK_HAS_volk_32fc_x2_add_32fc
       > -- Performing Test VOLK_HAS_volk_32fc_x2_add_32fc - Success
       > Building the GUI
       > Building GUI with OpenGL
       > CMake Error at /nix/store/38cffsqqx823crf1i4bcf6zz1qz1hgpd-cmake-3.30.5/share/cmake-3.30/Modules/FindPackageHandleStandardArgs.cmake:233 (message):
       >   Could NOT find OpenGL (missing: OPENGL_opengl_LIBRARY OPENGL_glx_LIBRARY
       >   OPENGL_INCLUDE_DIR)
       > Call Stack (most recent call first):
       >   /nix/store/38cffsqqx823crf1i4bcf6zz1qz1hgpd-cmake-3.30.5/share/cmake-3.30/Modules/FindPackageHandleStandardArgs.cmake:603 (_FPHSA_FAILURE_MESSAGE)
       >   /nix/store/38cffsqqx823crf1i4bcf6zz1qz1hgpd-cmake-3.30.5/share/cmake-3.30/Modules/FindOpenGL.cmake:579 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
       >   src-ui/CMakeLists.txt:28 (find_package)
       >
       > 
       > -- Configuring incomplete, errors occurred!
       For full logs, run 'nix log /nix/store/g23w6778khi5w333lgbfk7fcqy65cjys-satdump-1.2.2.drv'.

This is my point: adding all these options means a lot more testing is required. This is your first contribution to nixpkgs. Be warned: you do not want to add unnecessary maintenance burden on yourself unless you have a good reason to (i.e. you are actually making the embedded devices in question).

Side note: what embedded devices are you thinking of that run NixOS or linux in general? A raspberry pi compute module or similar would be using an SD card on the order of about a dozen gigabytes, so shaving a few MiB shouldn't matter.

Copy link
Author

Choose a reason for hiding this comment

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

I have now fixed the build without the GUI, it's the one thing i seem to have forgotten to test.
For the other options, things automatically don't get built when the dependencies are missing - which doesn't seem to be the case for the GUI.

Also the whole thing with dependencies being 7.53 MiB surprises me, that's out of the question then.

I don't think the options are a large extra maintenance effort, and i can also see them being useful in other cases. For exmple if i remember correctly there once was a bug in libhackrf (or maybe it was another SDR library, this was some years ago) that caused connected hackRF devices to be opened (which means they are unusable by other programs) at library initialization. In such cases the option of disabling these sources may prove to be quite useful.

On top of that i do plan to add support for SatDump on darwin where some depdendencies may not be available, i can see the options being useful in that case too.

And a piece of software similar to this one, also with various sources for various SDR devices also has a bunch of options for each source, see

airspy_source ? true,
airspy,
airspyhf_source ? true,
airspyhf,
bladerf_source ? true,
libbladeRF,
file_source ? true,
hackrf_source ? true,
hackrf,
limesdr_source ? true,
limesuite,
perseus_source ? false, # needs libperseus-sdr, not yet available in nixpks
plutosdr_source ? stdenv.hostPlatform.isLinux,
libiio,
libad9361,
rfspace_source ? true,
rtl_sdr_source ? true,
rtl-sdr-osmocom,
libusb1, # osmocom better w/ rtlsdr v4
rtl_tcp_source ? true,
sdrplay_source ? false,
sdrplay,
soapy_source ? true,
soapysdr-with-plugins,
spyserver_source ? true,
usrp_source ? false,
uhd,
boost,
# Sinks
audio_sink ? true,
rtaudio,
network_sink ? true,
portaudio_sink ? false,
portaudio,
# Decoders
falcon9_decoder ? false,
m17_decoder ? false,
codec2,
meteor_demodulator ? true,
radio ? true,
weather_sat_decoder ? false, # is missing some dsp/pll.h
# Misc
discord_presence ? true,
frequency_manager ? true,
recorder ? true,
rigctl_server ? true,
scanner ? true,

Copy link
Contributor

@Pandapip1 Pandapip1 left a comment

Choose a reason for hiding this comment

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

This LGTM.

@Pandapip1 Pandapip1 added the 12.approvals: 1 This PR was reviewed and approved by one reputable person label Jan 16, 2025
@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-already-reviewed/2617/2195

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.has: maintainer-list (update) This PR changes `maintainers/maintainer-list.nix` 8.has: package (new) This PR adds a new package 10.rebuild-darwin: 1-10 10.rebuild-linux: 1-10 12.approvals: 1 This PR was reviewed and approved by one reputable person 12. first-time contribution This PR is the author's first one; please be gentle!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Package request: SatDump
6 participants