-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
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
auto-cpufreq: 1.9.9 -> 2.2.0 #258684
auto-cpufreq: 1.9.9 -> 2.2.0 #258684
Conversation
Closes #258208 |
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.
Running auto-cpufreq-gtk
in a nix-shell results in an error:
Traceback (most recent call last):
File "/nix/store/m6c995hay2sa1wh0yjsp3c6mmp7w0r2j-python3.10-auto-cpufreq-2.0.0/bin/..auto-cpufreq-gtk-wrapped-wrapped", line 15, in <module>
win = ToolWindow()
File "/nix/store/m6c995hay2sa1wh0yjsp3c6mmp7w0r2j-python3.10-auto-cpufreq-2.0.0/lib/python3.10/site-packages/auto_cpufreq/gui/app.py", line 30, in __init__
self.load_css()
File "/nix/store/m6c995hay2sa1wh0yjsp3c6mmp7w0r2j-python3.10-auto-cpufreq-2.0.0/lib/python3.10/site-packages/auto_cpufreq/gui/app.py", line 92, in load_css
self.gtk_provider.load_from_file(Gio.File.new_for_path(CSS_FILE))
gi.repository.GLib.GError: gtk-css-provider-error-quark: <broken file>:1:0Failed to import: Error opening file /usr/local/share/auto-cpufreq/scripts/style.css: No such file or directory (2)
postPatch = '' | ||
substituteInPlace auto_cpufreq/core.py --replace '/opt/auto-cpufreq/override.pickle' /var/run/override.pickle | ||
substituteInPlace scripts/org.auto-cpufreq.pkexec.policy --replace "/opt/auto-cpufreq/venv/bin/auto-cpufreq" $out/bin/auto-cpufreq | ||
''; |
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.
postPatch = '' | |
substituteInPlace auto_cpufreq/core.py --replace '/opt/auto-cpufreq/override.pickle' /var/run/override.pickle | |
substituteInPlace scripts/org.auto-cpufreq.pkexec.policy --replace "/opt/auto-cpufreq/venv/bin/auto-cpufreq" $out/bin/auto-cpufreq | |
''; | |
postPatch = '' | |
substituteInPlace auto_cpufreq/core.py --replace '/opt/auto-cpufreq/override.pickle' /var/run/override.pickle | |
substituteInPlace auto_cpufreq/gui/app.py --replace '/usr/local/share/auto-cpufreq/images/icon.png' $out/share/auto-cpufreq/images/icon.png | |
substituteInPlace auto_cpufreq/gui/app.py --replace '/usr/local/share/auto-cpufreq/scripts/style.css' $out/share/auto-cpufreq/scripts/style.css | |
substituteInPlace scripts/org.auto-cpufreq.pkexec.policy --replace "/opt/auto-cpufreq/venv/bin/auto-cpufreq" $out/bin/auto-cpufreq | |
''; |
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.
You can now use --replace-fail
in case of unforeseen upstream changes.
# desktop icon | ||
mkdir -p $out/share/applications | ||
mkdir $out/share/pixmaps |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
Sorry about that. We actually identified the same issue on our repo and somebody ended up fixing it, but I forgot to include the same fix here. I just took it from the file I linked. You don't need to copy the image again since it is already copied into |
is there any way we can get the attention of someone who can merge this? |
Yes, for example I just added the approvals label (forgot that after my last review...) Other than that, the best place to ask for a merge would be one of the channels on Matrix. |
Need to update this to 2.1.0 and also squash this into one commit with this message EDIT: Also a way to disable AdnanHodzic/auto-cpufreq#587 would be very nice as well. |
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.
Hi !
Thanks for your first contribution! Welcome to the Nix family.
I've left some comments, let me know if this is clear enough.
# patch to prevent update | ||
./prevent-update.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.
This change was not necessary since the patch was already there, please revert.
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.
What I mean is that there is no need to move this patch before ./prevent-install-and-copy.patch
.
Please leave it where it was initially.
This PR should only contain the changes relevant for the update, nothing else.
Sorry for my absence. I have been quite busy with uni finals and whatnot and just got around to this. Bumped to version 2.1.0 and fixed the patches to work with it. @drupol I passed each dependency from pkgs, but didn't understand your second comment about the patch. All I did was move it up. I can't remember why I originally did that but I think it might be because of the order the patches needed to be applied in. I don't know, I'm not great at all the patch stuff haha. |
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.
No problem for the delay, thanks for letting us know.
I added a comment for the patch, hope it's ok.
# patch to prevent update | ||
./prevent-update.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.
What I mean is that there is no need to move this patch before ./prevent-install-and-copy.patch
.
Please leave it where it was initially.
This PR should only contain the changes relevant for the update, nothing else.
|
||
# polkit policy | ||
mkdir -p $out/share/polkit-1/actions | ||
cp scripts/org.auto-cpufreq.pkexec.policy $out/share/polkit-1/actions |
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.
Do we need a specific NixOS module for this ? I guess just enabling auto-cpufreq
(in environment.packages
) is not enough?
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.
Well, auto-cpufreq usually runs as a daemon/background process, so just installing the package should only provide the binaries etc. I like that it's a service.
Also, the autocpufreq-service clashes with gnome3's power management (even with the service, sadly), so automatically running the service after installing the package would maybe also not be super nice.
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.
My question was merely how to make sure that the polkit policy is correctly used.
As an example using custom udev
rules, is projecteur
, as you can see, it provides an udev
rule and services.udev.packages
need to be enabled.
Do we need to do something similar with auto-cpufreq
?
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.
Ah ok, sorry, then I got the question wrong, can't help in this case 🙈
Is there a reason sometimes |
auto-cpufreq 2.2.0 is out. Does a new request need to be opened? |
I think someone should probably open a new pr seeing as this one is a bit stale. |
No, you can update this one. |
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.
Hello, I made further comments, let me know if you plan continue working on this PR. Close it otherwise.
pname = "auto-cpufreq"; | ||
version = "1.9.9"; | ||
version = "2.1.0"; | ||
|
||
src = fetchFromGitHub { | ||
owner = "AdnanHodzic"; | ||
repo = pname; |
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.
Please don't use this.
repo = pname;
is nice for DRY but creates a binding that goes too far.
See further information about this here: nix-community/nixpkgs-lint#21
Made requested changes and once again bumped versions. |
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 like the build is broken now.
I see. It builds the package on my system, but I assume it can't be installed because in this Nix package, we have patched out the |
If I understand correctly, it doesn't build on the CI, but it builds on your machine, right ? How can such a thing could be possible? |
I can can confirm this does not build. Result of 2 packages blacklisted:
2 packages failed to build:
|
Closed per #315383 |
Description of changes
Closes #258208
Changelog
This update introduces a GTK gui, so several new build inputs were added to make this work, as well as copying the desktop entry file and polkit policy to the Nix store
Also adds small subtituteInPlace patches and fixed the
prevent-update.patch
file to work with this new update.Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)