Skip to content

qtscrcpy: switch to latest ffmpeg#357575

Merged
Aleksanaa merged 1 commit intoNixOS:masterfrom
Aleksanaa:qtscrcpy
Nov 22, 2024
Merged

qtscrcpy: switch to latest ffmpeg#357575
Aleksanaa merged 1 commit intoNixOS:masterfrom
Aleksanaa:qtscrcpy

Conversation

@Aleksanaa
Copy link
Member

Per the request of #340257 (comment). Tested and seems nothing broken.

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.

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.

Thanks. I take it FFmpeg 7 fails? Do you have the error message?

@Aleksanaa
Copy link
Member Author

Thanks. I take it FFmpeg 7 fails? Do you have the error message?

No but the higher the upgrade, the more breaking changes there should be.

@emilazy
Copy link
Member

emilazy commented Nov 20, 2024

We are trying to move away from these old FFmpeg versions entirely. Arch, for instance, ships FFmpeg 4 for compatibility with a few (mostly binary) packages, and FFmpeg 7, but no FFmpeg 6. Old versions should only be pinned where there is a compatibility issue and it is not possible to get a patch from upstream or another distro; please see the advice in pkgs/development/libraries/ffmpeg/default.nix. If it builds with just unversioned ffmpeg, that’s what it should use.

See also the prior work:

@emilazy
Copy link
Member

emilazy commented Nov 21, 2024

This builds:

diff --git a/pkgs/by-name/qt/qtscrcpy/package.nix b/pkgs/by-name/qt/qtscrcpy/package.nix
index 88f13a04d0..88b6f36132 100644
--- a/pkgs/by-name/qt/qtscrcpy/package.nix
+++ b/pkgs/by-name/qt/qtscrcpy/package.nix
@@ -7,7 +7,7 @@
   libsForQt5,
   scrcpy,
   android-tools,
-  ffmpeg_4,
+  ffmpeg,
   makeDesktopItem,
   copyDesktopItems,
 }:
@@ -49,6 +49,8 @@
     substituteInPlace QtScrcpy/sndcpy/sndcpy.sh \
       --replace-fail 'ADB=./adb' "ADB=${lib.getExe' android-tools "adb"}" \
       --replace-fail 'SNDCPY_APK=sndcpy.apk' "SNDCPY_APK=$out/share/qtscrcpy/sndcpy.apk"
+    substituteInPlace QtScrcpy/QtScrcpyCore/src/device/decoder/decoder.cpp \
+      --replace-fail 'avcodec_close(m_codecCtx);' ""
   '';
 
   nativeBuildInputs = [
@@ -61,7 +63,7 @@
   buildInputs =
     [
       scrcpy
-      ffmpeg_4
+      ffmpeg
     ]
     ++ (with libsForQt5; [
       qtbase

The deprecated avcodec_close is unnecessary given the immediately following avcodec_free_context call. Since we’re already patching this a bunch it seems fine to me and better than pinning FFmpeg 6. Of course an actual .patch file would be better but that’s probably true of some of the existing postPatch already.

@Aleksanaa Aleksanaa changed the title qtscrcpy: switch to ffmpeg_6 qtscrcpy: switch to latest ffmpeg Nov 21, 2024
@ofborg ofborg bot requested a review from Daru-san November 22, 2024 02:59
@ofborg ofborg bot added 11.by: package-maintainer This PR was created by a maintainer of all the package it changes. 10.rebuild-darwin: 0 This PR does not cause any 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. labels Nov 22, 2024
@Aleksanaa Aleksanaa merged commit 7cf5fb2 into NixOS:master Nov 22, 2024
@Aleksanaa Aleksanaa deleted the qtscrcpy branch November 22, 2024 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 0 This PR does not cause any 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. 11.by: package-maintainer This PR was created by a maintainer of all the package it changes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments