nixpkgs icon indicating copy to clipboard operation
nixpkgs copied to clipboard

autorandr: Fix distutils import warning

Open rski opened this issue 2 years ago • 3 comments

Because autorandr still imports distutils, it produces a bunch of deprecation warnings. we need to add packaging to propagatedBuildInputs, but because this wasn't wrapped, the wrapper hood did not take care of adjusting the system path.

The easiest way I could find to fix this was to actually wrap autorandr. Then I also had to add a patch to disable autorandr using sys.executable to fork itself in --batch mode. Otherwise it tries to use python to run the bash wrapper, which doesn't work. This should be fine in a nixpkgs environment, since nixpkgs sets the shebang explicitly.

Description of changes
Things done
  • Built on platform(s)
    • [x] x86_64-linux
    • [ ] aarch64-linux
    • [ ] x86_64-darwin
    • [ ] aarch64-darwin
  • [ ] For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • [x] 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
  • [x] Tested basic functionality of all binary files (usually in ./result/bin/)
  • 22.11 Release Notes (or backporting 22.05 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
    • [ ] (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • [ ] Fits CONTRIBUTING.md.

rski avatar Jun 28 '22 03:06 rski

It's a draft because I haven't managed to get the patch to apply, I always get the git incantations wrong. I'll get back to this later today

rski avatar Jun 28 '22 03:06 rski

gentle bump

rski avatar Jul 13 '22 20:07 rski

I have tested this. Fixes the warning, batch works when tested as

$ sudo su
$ unset DISPLAY
$ autorandr --batch <profile_that_only_exits_for_user>

anund avatar Aug 13 '22 05:08 anund