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
handbrake: 1.0.7 -> 1.1.0, according changes #39512
Conversation
patches = [] | ||
patches = [ | ||
# From Handbrake | ||
./A21-mp4-sdtp.patch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a link to where the patch comes from, or even better use fetchurl
to obtain it. Additionally, could you link to a libav issue tracking the merge of the patch into upstream libav?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jtojnar
I searched and could not find a LibAV upstream issue about this patch.
I can ask HandBrake upstream about this if needed.
Is it better to use URL and hash of master
branch of upstream, or a URL or that commit tree?
In first case it would fail with hash error on any patch change. But error would be clear.
On second case - it would work until it is going to not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could not find anything either. Asked about it on the PR: HandBrake/HandBrake#1006
Without an upstream bug report, it definitely should not be applied to main libav package. Nixpkgs tries to be as close to upstream as possible to simplify maintenance, adding random patches is widely frowned upon.
You could use (libav.overrideAttrs (super: {patches = (super.patches or []) ++ [(fetchurl {url = https://github.com/HandBrake/HandBrake/raw/7a49ab6e54a1fe6f33cf1e1ccbf46c8dd59015d1/contrib/ffmpeg/A21-mp4-sdtp.patch; sha256 = "xxx"; })];}))
, but personally, I find it more acceptable to be on Handbrake developers’ bad side than have one more libav package with dubious patches to please abhorrent upstream policies.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or add patch to libav but disable it by default similarly to the fdk_aac codec:
patches = stdenv.lib.optionals withRandomHandbreakPatches [
# taken from: https://github.com/HandBrake/HandBrake/pull/1006
# upstream bug: xxx
(fetchurl {
url = https://github.com/HandBrake/HandBrake/raw/7a49ab6e54a1fe6f33cf1e1ccbf46c8dd59015d1/contrib/ffmpeg/A21-mp4-sdtp.patch;
sha256 = "xxx";
})
];
and use it with (libav.override { withRandomHandbreakPatches = true; })
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jtojnar
Ok. I would parse that line tomorrow.
I thought to use fetchpatch
. But since filename is the same - fetchurl
.
Also I can gather HandBrake patches into this package overrides.
For example: https://github.com/NixOS/nixpkgs/search?utf8=%E2%9C%93&q=handbrake+patch&type=
And also find patches from HandBrake upstream itself.
I saw how other HandBrake patches was done in NixPkgs and did the same way.
I am learning.
Thank you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, not everything you see in nixpkgs is a good code. The patches in particular were often randomly added by someone in the past and nobody knows why were they added in the first place. I personally looked up and removed or added upstream links to almost a hundred patches.
fetchpatch
is the same as fetchurl
, only it also filters the patches using filterdiff
. It needs to be used on patches that are generated by a web service and their layout is not static (e.g. GitHub commit patches). It is not needed for a static files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jtojnar
Also HandBrake in the next stable (1.2.0
) would switch to FFMPEG, ETA is unknown.
So. Do I try to gather some of the patches originated from HandBrake and scattered across NixPkgs in overrides to package of origin in the next PRs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool.
It would be nice, if you can spare the time.
18a507d
to
20c3ccc
Compare
20c3ccc
to
f3ff2b1
Compare
Chromium on Hydra fails the checks:
|
It all builds locally perfectly. And my package builds only |
Thank you Jan Tojnar @jtojnar for teaching and guidance. |
This is ready to be merged. |
@Mic92 |
@GrahamcOfBorg build handbrake |
No attempt on x86_64-darwin (full log) The following builds were skipped because they don't evaluate on x86_64-darwin: handbrake Partial log (click to expand)
|
Success on x86_64-linux (full log) Attempted: handbrake Partial log (click to expand)
|
Success on aarch64-linux (full log) Attempted: handbrake Partial log (click to expand)
|
Thank you. |
Motivation for this change
fetchFromGitHub
tofetchurl
due to upstream change of storage and usage of metadata of versions.Instead of just version, current
version.txt
now stores:GitHub tarball does not have this file. And upstream leaves to package managers to populate this information. So during discussion I and upstream saw getting tarball from official site (
fetchurl
) as a more convenient way for now.movenc
. Compilation of1.1.0
relies on this patch.substituteInPlace make/configure.py
since it is no longer needed, now date information seems to be taken fromversion.txt
1.1.0
Things done
nix-shell -p nox --run "nox-review wip"
./result/bin/
)