Refactor flashprog
Description of changes
Flashprog is a fork of flashrom. It would be nice for users to be able to choose which of them they would like to use. Also flashprog has some features flashrom does not have (yet) like support for multiple SPI chip selects.
based on pkgs/tools/misc/flashrom/default.nix can also be used with the nixos option
programs.flashrom = {
enable = true;
package = pkgs.flashprog;
};
Things done
- Built on platform(s)
- [X] x86_64-linux
- [ ] aarch64-linux
- [X] x86_64-darwin
- [ ] aarch64-darwin
- For non-Linux: Is sandboxing enabled in
nix.conf? (See Nix manual)- [X]
sandbox = relaxed - [X]
sandbox = true
- [X]
- [ ] Tested, as applicable:
- NixOS test(s) (look inside nixos/tests)
- and/or package tests
- or, for functions and "core" functionality, tests in lib/tests or pkgs/test
- made sure NixOS tests are linked to the relevant packages
- [ ] 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/) - 24.05 Release Notes (or backporting 23.05 and 23.11 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
- [X] Fits CONTRIBUTING.md.
Add a :+1: reaction to pull requests you find important.
With the force-push things seem to have broken with some now missing dependencies. Somehow managed to build the code before the force-push. Will review again once that's fixed
Could this package be backported once its added?
This pull request has been mentioned on NixOS Discourse. There might be relevant details there:
https://discourse.nixos.org/t/prs-already-reviewed/2617/1483
Could this package be backported once its added?
Yes. Let's set the backport Github flag.
I added the suggested changes. Please check if everything is okay now.
Build was failing now as libgpiod is not available on darwin. Added check stdenv.isLinux to fix that.
This pull request has been mentioned on NixOS Discourse. There might be relevant details there:
https://discourse.nixos.org/t/prs-already-reviewed/2617/1493
As someone else opened a pull request to add flashprog (https://github.com/NixOS/nixpkgs/pull/292592) while this one was already open which got merged earlier I rebased my changes on the current master and added the improvments of this pull request like configurable support for jlink and gpio to the now existing package.
I applied your suggested changes. Hopefully the changelog looks a bit cleaner now. Please have a look if everything is fine now :)
Added the suggested changes. Please have a look if everything is fine now.
Could someone restart the failed job as it seems to be an problem with ofborg instead of my package.
@ofborg build flashprog
Could someone restart the failed job as it seems to be an problem with ofborg instead of my package.
You can trick ofborg by rebasing with master and force-pushing.
P.S.: fixup meta.license
P.S.: fixup meta.license
what should be fixed? the current license was requested by @felixsinger and I think it is correct:
flashprog is mainly GPLv2 licensed. So change it back to what it was before.
"GPL2" is ambiguous, it can refer to GPL2-Only or GPL2-Plus. Then it makes few to no sense to make a list containing the ambiguous GPL2 and the inambiguous GPL2Plus.
https://www.gnu.org/licenses/identify-licenses-clearly.html.en
Either the gpl2 should be removed or it should be changed to gpl2Only.
But I will not pursue this minor issue now.
Clarified license in #298706. Let's try to fix the Ofborg issues and then let's get this in.
I rebased on current master and changed the license to gpl2Plus as flashprog is licensed with gpl2Plus. From flashprogs COPYING:
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
Ofborg was failing because it was using an outdated nix version. Lets see if the rebase to the current master fixed it or if further action is required.
OfBorg complains on ARM64-Linux:
The following features are unavailable on your machine: CONFIG_INTERNAL_X86=yes CONFIG_INTERNAL_X86=yes CONFIG_RAYER_SPI=yes
Fingers crossing that it passes the CI now! :crossed_fingers:
Yo, all checks green! Let's get this in! 🥳
I just can't merge...
This pull request has been mentioned on NixOS Discourse. There might be relevant details there:
https://discourse.nixos.org/t/prs-already-reviewed/2617/1551
Backport failed for release-23.11, because it was unable to cherry-pick the commit(s).
Please cherry-pick the changes locally and resolve any conflicts.
git fetch origin release-23.11
git worktree add -d .worktree/backport-291897-to-release-23.11 origin/release-23.11
cd .worktree/backport-291897-to-release-23.11
git switch --create backport-291897-to-release-23.11
git cherry-pick -x 5ba311a026ad3e6f3ad210e82428d222fdb4eca8 306fe56f63d8b14e7e50a5abc4a527032f2538b2