-
-
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
openbox: Use python3 instead of python2 #87846
Conversation
Could you show a diff please of the changes `2to3 does to the file? I'm thinking it might be more reliable to add a static patch that would do that. Arch Linux has such patches: https://git.archlinux.org/svntogit/community.git/tree/trunk?h=packages/openbox |
Sure, I'm also fine with a static patch. The autogenerated changes are pretty much the same as in Arch (comparing to https://git.archlinux.org/svntogit/community.git/tree/trunk/py3.patch?h=packages/openbox). They modify the first chunk of the python script slightly differently, and they also patch some autoconfig files, which we won't need to do because we rewrite the shebangs anyway. Just let me know what you prefer, I'll just be happy to get rid of the last python2 thing in my nix store. (Note that I got this diff by diffing the old and the new version in my nix store, so the line numbers in this example will be off because of Nix's path shenanigans; I will make a proper patch if we move in this direction.)
|
I feel you body :) I also had some PRs motivated by getting rid of Python2. Not all of them have even reached the approval state. Also, note I'm only a member of My personal opinion, also judging from other PRs I saw that added patches similar to or based on patches from other distros (#84072 ), I think it'll be best to download that patch from Arch and put in |
@FRidh Could you maybe weigh in on this and add it to the Python 2 deprecation project? |
Upstream PR Mikachu/openbox#9
Please use |
@veprbl I tried to implement your requested change but I ran into two problems
|
@SFrijters Does this not work? fetchpatch {
name = "openbox-py3.patch";
url = "https://git.archlinux.org/svntogit/community.git/plain/trunk/py3.patch?h=packages/openbox&id=147b9734e4bbdf5558e3f7d11c6541e2c429203c";
sha256 = "019q8yq334wfrhmbh58wsh3cfpbj48pf08s5nlp51nak7dkn0hgi";
} |
@veprbl Yes, that patch does apply. But I'm still left with a The build log does say
In this case we would also need to use autoconf again to make sure the file is configured correctly, but then we're still left with the problem that the renaming of the file |
9bc0c89
to
5516772
Compare
Pushed a new attempt. It uses fetchpatch, but then also includes a workaround to rename the required files and an autoconf step so they are actually configured. And since the tarball src is already autoconfed I switched to the github source. At least the patch is now a PR on the actual src. |
5516772
to
17442c3
Compare
17442c3
to
c4d7bd9
Compare
@veprbl Thanks for shepherding this; I hope I have done it correctly this time around, with minimal changes. |
c4d7bd9
to
f1da952
Compare
f1da952
to
e38ef6f
Compare
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.
Looks good. Thank you!
Motivation for this change
Openbox contains a single python script that is trivially convertible to python3 (print statements to print functions). With an automatic conversion in the patch phase we can drop the python2 dependency.
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)