-
-
Notifications
You must be signed in to change notification settings - Fork 89
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
Add a way to wrap nix derivations with makeWrapper #133
Open
voidus
wants to merge
2
commits into
nix-community:main
Choose a base branch
from
voidus:nixglwrap-readme
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Why are not using wrapProgram directly?
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.
As far as I know, there's no way to tell
makeShellWrapper
to make an actual wrapper in the sense thatnixGL
wraps stuff, so I overrode it with what we need here.I still wanted to use
wrapProgram
though because it has some logic to correctly deal with multiple layers of wrapping.If you think it would be better I'll inline it.
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.
Double wrapping as you describe it should be avoided as much as possible as it is very hard to get right. I think it would probably be an idea to modify the existing wrappers to fit your usecase to create one wrapped binary.
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.
I might be misinterpreting that, but my reading of the code is that this is what wrapProgram is for. I'm actually wrapping mixxx twice myself (nixGL and adding LD_LIBRARY_PATH for jack), and I'm pretty sure the package adds another wrapper itself.
This is obviously not optimal, but it makes things somewhat composable.
Anyways, I don't think we really have something to argue about here. I just found this solution for myself and thought it would be valuable to share.
I'm personally a bit hesitant to propose using wrapProgram directly because it will not work on packages which use a wrapper internally.
It's your decision what to put in the readme, I'm just offering a suggestion from my personal point of view.
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 should be able to do it the same way that
electron
programs are handled in nixpkgsAlso please use
makeBinaryWrapper
, inherit-argv0 works better with it AFAIK.