Skip to content
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

Refactor postPatch in handheld-daemon and hidapi #309530

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

toast003
Copy link
Contributor

@toast003 toast003 commented May 6, 2024

Refactor discussed in #303846 (comment) and #303846 (comment)

Description of changes

Replace sed with substituteInPlace in handheld-daemon and hidapi's postPatch

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • 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
  • 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
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@ofborg ofborg bot requested a review from appsforartists May 6, 2024 11:06
@ofborg ofborg bot added 11.by: package-maintainer This PR was created by the maintainer of the package it changes 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 10.rebuild-linux: 1 labels May 6, 2024
@ofborg ofborg bot requested review from np and prusnak May 6, 2024 11:18
@appsforartists
Copy link
Contributor

The file that should change in sync with hhd is pkgs/development/python-modules/hid/default.nix.

@toast003
Copy link
Contributor Author

toast003 commented May 6, 2024

oh

@toast003 toast003 force-pushed the hhd-hidapi-patch-refactor branch from 2a71c77 to 4813929 Compare May 6, 2024 17:09
@toast003 toast003 marked this pull request as ready for review May 6, 2024 17:25
@ofborg ofborg bot requested a review from AndersonTorres May 6, 2024 18:00
@ofborg ofborg bot added 10.rebuild-darwin: 1-10 10.rebuild-linux: 1-10 and removed 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 11-100 labels May 6, 2024
# handheld-daemon contains a fork of the python module `hid`, so this hook
# is borrowed from the `hid` derivation.
substituteInPlace src/hhd/controller/lib/hid.py \
--replace-fail libhidapi ${hidapi}/lib/libhidapi

hidapi=${hidapi}/lib/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why isn't the substituteInPlace using this variable?

Copy link
Contributor Author

@toast003 toast003 May 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure since I did this a while ago, but iirc I just copied the substituteInPlace right on top and then changed it.
The check that's under will still work so I think it's fine if we leave it as is

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Except that it's duplicating the path now. If that path ever changed, you could change one and not the other - it would break and you might not realize it.

In some senses, this is just cargo-culted over from hid; however, as long as the variable is there, it should be used in both places. Moreover, since this does mirror the hid build rule, it should keep symmetry with the hid derivation (which does the test before calling subInPlace).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it, just changed subInPlace so that it uses the variable

@toast003
Copy link
Contributor Author

toast003 commented May 7, 2024

@Faupi pls check if this pr fixes #303846 (comment)

@Faupi
Copy link

Faupi commented May 7, 2024

@Faupi pls check if this pr fixes #303846 (comment)

👍
Can confirm HHD works, in fact I've been using the same line-by-line config as here since I posted the linked comment.
Re-tested again anyway to make sure, as an overlay on nixpkgs 7bb2ccd from April 25th

@ofborg ofborg bot requested a review from appsforartists May 8, 2024 07:57
@wegank wegank added the 12.approvals: 1 This PR was reviewed and approved by one reputable person label May 9, 2024
@wegank wegank added the 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in the package label May 9, 2024
@wegank wegank added the 2.status: merge conflict This PR has merge conflicts with the target branch label May 22, 2024
@AndersonTorres
Copy link
Member

This week is very fussy! Too much merge conflicts!

@SuperSandro2000
Copy link
Member

@toast003 can you rebase this PR?

@ofborg ofborg bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Jul 10, 2024
@ofborg ofborg bot requested a review from appsforartists July 10, 2024 12:47
@wegank wegank removed the 12.approvals: 1 This PR was reviewed and approved by one reputable person label Sep 7, 2024
@wegank wegank removed the 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in the package label Oct 29, 2024
@wegank wegank added the 2.status: merge conflict This PR has merge conflicts with the target branch label Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.status: merge conflict This PR has merge conflicts with the target branch 6.topic: python 10.rebuild-darwin: 1-10 10.rebuild-linux: 1-10 11.by: package-maintainer This PR was created by the maintainer of the package it changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants