Skip to content

quirc: drop SDL dependency#389124

Merged
7c6f434c merged 1 commit intoNixOS:masterfrom
LordGrimmauld:quirk-minimal
Mar 13, 2025
Merged

quirc: drop SDL dependency#389124
7c6f434c merged 1 commit intoNixOS:masterfrom
LordGrimmauld:quirk-minimal

Conversation

@LordGrimmauld
Copy link
Contributor

@LordGrimmauld LordGrimmauld commented Mar 12, 2025

the quirc package depends on SDL for some demos and a test of those demos.
See upstream readme (demo) and upstream readme (test)

We already conditionally patched out the demos because they don't seem to build on darwin. It makes sense to provide a minimal package with basically only the lib output. The minimal package can get away without SDL dependencies pulled in to ffmpeg. ffmpeg is a core package, reducing the size of the derivation as well as reducing potentially vulnerable dependencies is a good thing.

I have not tested the impact of this. ffmpeg-full still builds and no longer lists SDL1 as a dependency through quirc (it lists it through libvisual until #388447 hits repos). Putting this here mostly to track. I am not sure how to actually use and test this plugin through ffmpeg. Help is appreciated. But seeing as darwin didn't provide the demos anyways and still builds ffmpeg, this really should be fine.

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 10.rebuild-darwin: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. labels Mar 12, 2025
@LordGrimmauld LordGrimmauld changed the base branch from staging to master March 12, 2025 00:53
Copy link
Member

@emilazy emilazy left a comment

Choose a reason for hiding this comment

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

Yeah this is fine. But also maybe let’s just unconditionally skip the demos? I’m really sceptical anyone cares about them and it bloats FFmpeg’s closure and it really does not seem worth it to do split outputs here.

I don’t think we need to patch SDL_CFLAGS etc.; we can just override them in makeFlags. Just patching install should suffice.

@LordGrimmauld
Copy link
Contributor Author

Yeah this is fine. But also maybe let’s just unconditionally skip the demos? I’m really sceptical anyone cares about them and it bloats FFmpeg’s closure and it really does not seem worth it to do split outputs here.

I don’t think we need to patch SDL_CFLAGS etc.; we can just override them in makeFlags. Just patching install should suffice.

not offering the demos is valid. however, we need to patch away the SDL_CFLAGS because otherwise pkg-config crashes and the build fails.

@emilazy
Copy link
Member

emilazy commented Mar 12, 2025

Can’t we just use makeFlags rather than patching the source?

@LordGrimmauld
Copy link
Contributor Author

LordGrimmauld commented Mar 12, 2025

Can’t we just use makeFlags rather than patching the source?

good call, i keep forgetting how cursed make is in just letting you override stuff by command line flags. This does indeed seem to work.

@LordGrimmauld LordGrimmauld changed the title ffmpeg: drop transient SDL dependency quirc: drop SDL dependency Mar 12, 2025
@7c6f434c
Copy link
Member

I originally packaged it for the demos, the library is just the supporting machinery for those. Although, it is true that qrtest is more useful than the camera integrations, and qrtest is installed in a way unaffected by this PR.

Apparently ffmpeg has videofilter quirc, which tries to add QR-code content from the video to video metadata? No idea how to use that.

@LordGrimmauld
Copy link
Contributor Author

@7c6f434c does this mean you actually use and maintain those demos?
I am happy to split into quirc and quirc-minimal, that was what i proposed initially until emily told me to just drop it. But if there is active users and maintainers, a split might actually be reasonable again. I can easily cherry-pick that, if desired.

@7c6f434c
Copy link
Member

Nowadays I am no longer on the hook for handling large amount of 2D-coded paper documents, so fine with me to drop GUI demos.

If you then try to also drop qrtest (no additional dependencies there), though, then remove me from maintainers.

@LordGrimmauld
Copy link
Contributor Author

Oh i didn't ever plan on dropping qrtest - the whole point of this is drop the SDL1 dependency going into ffmpeg, because ffmpeg is important and SDL1 is crusty and old. There is absolutely no reason to drop something that doesn't pull deps.

@grimmauld-bot
Copy link

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 389124


x86_64-linux

⏩ 18 packages marked as broken and skipped:
  • manim
  • manim-slides
  • manim-slides.dist
  • manim.dist
  • python312Packages.manim
  • python312Packages.manim-slides
  • python312Packages.manim-slides.dist
  • python312Packages.manim.dist
  • python312Packages.shazamio
  • python312Packages.shazamio.dist
  • python313Packages.manim
  • python313Packages.manim-slides
  • python313Packages.manim-slides.dist
  • python313Packages.manim.dist
  • python313Packages.shazamio
  • python313Packages.shazamio.dist
  • shaq
  • shaq.dist
✅ 113 packages built:
  • aider-chat (python312Packages.aider-chat)
  • aider-chat.dist (python312Packages.aider-chat.dist)
  • audiobookshelf
  • deltatouch
  • escrotum
  • escrotum.dist
  • escrotum.man
  • ffcast
  • ffmpeg-full (ffmpeg_7-full)
  • ffmpeg-full.bin (ffmpeg_7-full.bin)
  • ffmpeg-full.data (ffmpeg_7-full.data)
  • ffmpeg-full.dev (ffmpeg_7-full.dev)
  • ffmpeg-full.doc (ffmpeg_7-full.doc)
  • ffmpeg-full.lib (ffmpeg_7-full.lib)
  • ffmpeg-full.man (ffmpeg_7-full.man)
  • ffsubsync
  • ffsubsync.dist
  • git-sim
  • git-sim.dist
  • gruut (python312Packages.gruut)
  • gruut.dist (python312Packages.gruut.dist)
  • handbrake
  • imagination
  • immich
  • jellyfin
  • jellyfin-ffmpeg
  • jellyfin-ffmpeg.bin
  • jellyfin-ffmpeg.data
  • jellyfin-ffmpeg.dev
  • jellyfin-ffmpeg.doc
  • jellyfin-ffmpeg.lib
  • jellyfin-ffmpeg.man
  • kdePackages.kdenlive
  • kdePackages.kdenlive.debug
  • kdePackages.kdenlive.dev
  • kdePackages.kdenlive.devtools
  • lacus
  • lacus.dist
  • libsForQt5.kdenlive (plasma5Packages.kdenlive)
  • soundkonverter (libsForQt5.soundkonverter)
  • midivisualizer
  • monero-gui
  • mpvScripts.autosubsync-mpv
  • open-webui
  • open-webui.dist
  • peek
  • printrun
  • printrun.dist
  • private-gpt
  • private-gpt.dist
  • python312Packages.aigpy
  • python312Packages.aigpy.dist
  • python312Packages.auditok
  • python312Packages.auditok.dist
  • python312Packages.gradio
  • python312Packages.gradio-client
  • python312Packages.gradio-client.dist
  • python312Packages.gradio-pdf
  • python312Packages.gradio-pdf.dist
  • python312Packages.gradio.dist
  • python312Packages.lacuscore
  • python312Packages.lacuscore.dist
  • python312Packages.markitdown
  • python312Packages.markitdown.dist
  • python312Packages.moderngl-window
  • python312Packages.moderngl-window.dist
  • python312Packages.private-gpt
  • python312Packages.private-gpt.dist
  • python312Packages.pydub
  • python312Packages.pydub.dist
  • python312Packages.pyglet
  • python312Packages.pyglet.dist
  • python312Packages.pyrender
  • python312Packages.pyrender.dist
  • python312Packages.pytmx
  • python312Packages.pytmx.dist
  • python313Packages.aigpy
  • python313Packages.aigpy.dist
  • python313Packages.auditok
  • python313Packages.auditok.dist
  • python313Packages.gradio
  • python313Packages.gradio-client
  • python313Packages.gradio-client.dist
  • python313Packages.gradio-pdf
  • python313Packages.gradio-pdf.dist
  • python313Packages.gradio.dist
  • python313Packages.gruut
  • python313Packages.gruut.dist
  • python313Packages.lacuscore
  • python313Packages.lacuscore.dist
  • python313Packages.markitdown
  • python313Packages.markitdown.dist
  • python313Packages.moderngl-window
  • python313Packages.moderngl-window.dist
  • python313Packages.pydub
  • python313Packages.pydub.dist
  • python313Packages.pyglet
  • python313Packages.pyglet.dist
  • python313Packages.pyrender
  • python313Packages.pyrender.dist
  • python313Packages.pytmx
  • python313Packages.pytmx.dist
  • quirc
  • restream
  • rofi-screenshot
  • tidal-dl
  • tidal-dl.dist
  • tone
  • tts
  • tts.dist
  • vokoscreen
  • wlr-layout-ui
  • wlr-layout-ui.dist

@SuperSandro2000
Copy link
Member

I am confused if there is work left to do here or not. LGTM and I would merge it.

@LordGrimmauld
Copy link
Contributor Author

I am confused if there is work left to do here or not. LGTM and I would merge it.

this depends on whether we go emilys route (drop the demos outright), in which case this is ready. Or we go my original route adding a -minimal target to use in ffmpeg. I am happy with either, just personally not sure which one would be better.

@Atemu
Copy link
Member

Atemu commented Mar 12, 2025

the whole point of this is drop the SDL1 dependency going into ffmpeg

Am I missing something? This should not be in ffmpeg, only ffmpeg-full. We don't really care about a little closure bloat in ffmpeg-full; that's the whole point.

Dropping old crufty demos that rely on SDL1 seems like a good idea regardless though.

@LordGrimmauld
Copy link
Contributor Author

Yeah, i only realized after opening the PR this didn't go into ffmpeg, only ffmpeg-full. So this is indeed less impact than i thought initially.

@7c6f434c 7c6f434c merged commit 0d578d7 into NixOS:master Mar 13, 2025
35 checks passed
@GaetanLepage
Copy link
Contributor

This broke quirc on darwin:

Running phase: installPhase
install flags: SHELL=/nix/store/hmffg6n6ylbl4c30pqc9i71mwqzrd0iv-bash-5.2p37/bin/bash PREFIX=\$\(out\) SDL_CFLAGS= SDL_LIBS= -o inspect -o quirc-demo install
clang -Ilib -O3 -Wall -fPIC  -o demo/camera.o -c demo/camera.c
demo/camera.c:29:10: fatal error: 'linux/videodev2.h' file not found
   29 | #include <linux/videodev2.h>
      |          ^~~~~~~~~~~~~~~~~~~
1 error generated.
make: *** [Makefile:90: demo/camera.o] Error 1

@LordGrimmauld LordGrimmauld mentioned this pull request Mar 14, 2025
13 tasks
@LordGrimmauld
Copy link
Contributor Author

This broke quirc on darwin:

Can you run #389753 through a builder? This is a partial revert (which does keep the SDL drop), and should fix it. But i can't really test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants