Skip to content

ffmpeg: use drv version for aribcaption configureFlags logic#280784

Merged
Atemu merged 1 commit intoNixOS:masterfrom
Atemu:fix/jellyfin-ffmpeg
Jan 14, 2024
Merged

ffmpeg: use drv version for aribcaption configureFlags logic#280784
Atemu merged 1 commit intoNixOS:masterfrom
Atemu:fix/jellyfin-ffmpeg

Conversation

@Atemu
Copy link
Copy Markdown
Member

@Atemu Atemu commented Jan 13, 2024

withAribcaption would be true because, for the flags in the function argument, ffmpeg_6-full's version is the deciding one. We will likely need a better pattern here.

Fixes #280645

Description of changes

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/)
  • 24.05 Release Notes (or backporting 23.05 and 23.11 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.

`withAribcaption` would be true because, for the flags in the function argument,
ffmpeg_6-full's version is the deciding one. We will likely need a better
pattern here.

Fixes NixOS#280645
@Atemu Atemu requested a review from arthsmn January 13, 2024 18:34
@Atemu
Copy link
Copy Markdown
Member Author

Atemu commented Jan 13, 2024

cc @anund

@arthsmn
Copy link
Copy Markdown
Member

arthsmn commented Jan 13, 2024

@Atemu I think this should also be applied to the patches, otherwise it'll probably not build correctly on darwin.

@Atemu
Copy link
Copy Markdown
Member Author

Atemu commented Jan 13, 2024

For now this only affects jellyfin-ffmpeg where the aribcaption flag makes it break and that package is not needed on Darwin. We need a better pattern for the version anyways that does not have this issue to begin with.

@arthsmn
Copy link
Copy Markdown
Member

arthsmn commented Jan 13, 2024

For now this only affects jellyfin-ffmpeg where the aribcaption flag makes it break and that package is not needed on Darwin. We need a better pattern for the version anyways that does not have this issue to begin with.

How so it's not needed? It is available on darwin.

@Atemu
Copy link
Copy Markdown
Member Author

Atemu commented Jan 13, 2024

jellyfin-ffmpeg is a fork of the regular ffmpeg specifically for use in jellyfin. I don't even know if jellyfin builds on Darwin.

I'd also like to see it fixed but, again, I'd prefer to see that happen using a better pattern for version etc.

@arthsmn
Copy link
Copy Markdown
Member

arthsmn commented Jan 13, 2024

jellyfin-ffmpeg is a fork of the regular ffmpeg specifically for use in jellyfin. I don't even know if jellyfin builds on Darwin.

I'd also like to see it fixed but, again, I'd prefer to see that happen using a better pattern for version etc.

It does build for darwin, but I understand.

@anund
Copy link
Copy Markdown
Contributor

anund commented Jan 13, 2024

Regarding patches I see the generic package doing similar things to withAribcaption

patches = map (patch: fetchpatch patch) (extraPatches
++ (lib.optional (lib.versionAtLeast version "6" && lib.versionOlder version "6.1")
{ # this can be removed post 6.1
name = "fix_aacps_tablegen";
url = "https://git.ffmpeg.org/gitweb/ffmpeg.git/patch/814178f92647be2411516bbb82f48532373d2554";
hash = "sha256-FQV9/PiarPXCm45ldtCsxGHjlrriL8DKpn1LaKJ8owI=";
}
)
++ (lib.optional (stdenv.isDarwin && lib.versionAtLeast version "6.1" && lib.versionOlder version "6.2")
{ # this can be removed post 6.1
name = "fix_build_failure_due_to_PropertyKey_EncoderID";
url = "https://git.ffmpeg.org/gitweb/ffmpeg.git/patch/cb049d377f54f6b747667a93e4b719380c3e9475";
hash = "sha256-Ittka0mId1N/BwJ0FQ0ygpTSS6Y11u2SjWDpbGN+KXo=";
}
));

The first won't apply to jellyfin now and the second should only apply in future.

Likely need a separate change to just swap all version references for finalAttrs.version references. (larger rebuild?)

(enableFeature withAlsa "alsa")
# FIXME: see if jellyfin-ffmpeg is already on a version >= 6.1 to use enableFeature
(optionalString withAribcaption "--enable-libaribcaption")
(optionalString (withAribcaption && lib.versionAtLeast finalAttrs.version "6.1") "--enable-libaribcaption")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Consider duplicating this change on the later buildInputs reference.

++ optionals withAribcaption [ libaribcaption ]

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good point. I'll do that should my refactor preventing this issue in the first place fail. Let's merge this first to unbreak jellyfin.

@anund
Copy link
Copy Markdown
Contributor

anund commented Jan 13, 2024

To be clear: general version changes can be done in a separate PR as building but slightly wrong is better than not building at the moment.

@ofborg ofborg bot added 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Jan 13, 2024
@Atemu Atemu merged commit 836a47d into NixOS:master Jan 14, 2024
@Atemu Atemu deleted the fix/jellyfin-ffmpeg branch January 14, 2024 10:13
@Atemu
Copy link
Copy Markdown
Member Author

Atemu commented Jan 14, 2024

Follow-up and revert: #280904

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

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

jellyfin-ffmpeg fails to build: Unknown option "--enable-libaribcaption".

3 participants