-
-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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
Documentation for how to create patch files #31684
Comments
It's a pretty standard unix program: https://en.wikipedia.org/wiki/Patch_%28Unix%29 |
We can put this or a similar link to the docs, possibly with a couple examples. The |
Please, no. A link to Wikipedia never constitutes documentation. |
Wikipedia says to do this: diff -u oldFile newFile > mods.diff So let's try that. default.nix { stdenv }:
stdenv.mkDerivation {
name = "patch-demo";
src = ./.;
patches = [ ./demo.diff ];
} foo.txt
Let's pretend
So that creates a diff that looks like this: demo.diff
So far so good, I made a patch file! But it looks like I did something wrong, because most of the patches in nixpkgs have a header that looks something like this
Mine doesn't and I don't know why it's different. I'm not sure how it will know which file to apply the patch to. Indeed it doesn't work:
So I guess I need to edit the diff file to fix the file name? demo.diff
Nope, still doesn't work. Not sure why. |
The patch header is optional. The problem with your patch is that by default file names are expected to be prefixed with one arbitrary directory, e.g. I'd recommend this method of generating patches:
|
This addresses NixOS#31684.
I know this is a long time since, but there must be a better and easier way by now. |
The firefox codebase is what, mercurial? I would suggest that instead. Or just making a copy before modifying the file and using |
You can |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/how-to-deal-with-pip-install-in-makefile/22531/5 |
The manual sections The patch phase and Patches ought to describe how to make a
.patch
file.All it says right now is
and I'm not sure what that means.
The text was updated successfully, but these errors were encountered: