kodi: make overrideAttrs and withPackages composable - #304097
Merged
Merged
Conversation
ofborg
Bot
requested review from
aanderse,
cpages,
dschrempf,
edwtjo,
minijackson,
peterhoeg and
sephalon
April 14, 2024 19:44
nvmd
force-pushed
the
master+kodi-composable
branch
from
April 17, 2024 16:02
cb5f8d4 to
b08af64
Compare
nvmd
force-pushed
the
master+kodi-composable
branch
from
April 17, 2024 16:04
b08af64 to
0be3972
Compare
This pattern allows for easier overriding of the derivations attributes like described and discussed in NixOS#119942. In this context - adapt the handling of the version and revision handling so overriding it gets reflected in the version string that kodi displays in the UI - make the bundled dependencies available for overriding - make some of the existing compilation flags to be overridable consistently with existing options
Using withPackage on a kodi derivation that was modified with overrideAttrs lead to the modifications being discarded. With the previous adaptions to the kodi derivation we can now modify the wrapper that allows using both overrideAttrs and withPackage to form a custom kodi derivation with plugins.
nvmd
force-pushed
the
master+kodi-composable
branch
from
April 17, 2024 16:04
0be3972 to
a55f8bd
Compare
Member
Author
|
Updated for Kodi 21.0 (#303497) |
Member
|
@SuperSandro2000 - any chance you can take a look at this as well? ❤️ |
2 of 13 tasks
Member
Author
|
Even though this has nothing to do with this PR, it now rather unfortunately weakly depends on #304845, because |
3 of 13 tasks
3 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of changes
This work is an up-to-date version of #209580 which has been stale for a long time already. Last time it was postponed due to an upcoming Kodi release, hopefully, we could merge it this time.
I've been using those changes and supporting them for about 2 years in my Nixos configuration with zero problems.
I've also improved it in a couple of places regarding the ability to override, and consistent handling of existing configuration parameters (
opticalSupport,vdpauSupport).finalAttrspatternWhen using a kodi derivation modified with overrideAttrs and adding extensions to it with withPackages the changes were discarded and the original unmodified kodi derivation was wrapped together with the extensions.
Fix this by switching kodi to use the mkDerivation with finalAttrs pattern (described in stdenv.mkDerivation: overlay style overridable recursive attributes #119942 and https://nixos.org/manual/nixpkgs/stable/#mkderivation-recursive-attributes).
This will make customizing Kodi for other platforms (e.g. Raspberry Pi, which require custom
ffmpeg,libcecand other optimizations) much easier when all ofoverrideAttrs,override, andwithPackagesare needed at the same time.Could be tested with something along these lines: (there is also test flake example in the original PR)
Things done
nix.conf? (See Nix manual)sandbox = relaxedsandbox = truenix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)Add a 👍 reaction to pull requests you find important.