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

oh-my-zsh: cleanups, don't require perl in pygmalion theme anymore #96532

Merged
merged 4 commits into from Aug 31, 2020

Conversation

flokli
Copy link
Contributor

@flokli flokli commented Aug 28, 2020

Motivation for this change

After switching to latest nixpkgs unstable, I ran into some error messages in my prompt:

prompt_setup_pygmalion:9: command not found: perl
prompt_setup_pygmalion:10: command not found: perl
perl: command not found  

This was due to #91213 removing perl from $PATH.

There's no reason oh-my-zsh needs to use perl for the regexp substitution, so I opened ohmyzsh/ohmyzsh#9210 upstream, and fetch the patch here.

I did some cleanup in the oh-my-zsh derivation before, so patching is actually possible :-)

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

 - use fetchFromGitHub instead of fetchgit
 - indent the `installPhase` properly
 - remove unused `pathsToLink`
 - don't hardcode `phases` to allow patching
 - don't copy from $src, but . to allow patching
@NeQuissimus
Copy link
Member

@flokli Will this patch work with BSD/macOS sed? Not sure about -eE there...

@flokli
Copy link
Contributor Author

flokli commented Aug 28, 2020

There was another (preferrable IMHO) approach proposed in ohmyzsh/ohmyzsh#9210 (comment), which doesn't need to shell out to anything anymore.

@flokli
Copy link
Contributor Author

flokli commented Aug 28, 2020

I pushed updated this PR with the proposed solution, if people want to tinker with it.

@NeQuissimus I'll leave it on you to decide on whether to merge this before it's merged upstream, or wait what happens there.

@ofborg ofborg bot requested a review from NeQuissimus August 28, 2020 19:13
@scolobb
Copy link
Contributor

scolobb commented Aug 28, 2020

Thank you @flokli for the PR. I don't have any particular issues with it.

Upstream for Oh My Zsh seems to move quite quickly and this Nix package is automatically updated, so I'd say that applying the patch won't be necessary very soon. Maybe add a TODO comment reminding to remove the patch application once your change is merged upstream.

Copy link
Contributor

@scolobb scolobb left a comment

Choose a reason for hiding this comment

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

Add a TODO comment reminding to remove the patch application once the change is merged upstream.

NixOS#91213 removed `perl` from $PATH.

This adds a patch to oh-my-zsh, using `sed` instead of `perl` to do the
regexp substitution.
@flokli
Copy link
Contributor Author

flokli commented Aug 28, 2020

I updated the comment linking to the PR to become a TODO once this is merged.

@ofborg ofborg bot requested a review from scolobb August 28, 2020 22:25
@NeQuissimus NeQuissimus merged commit f076cd7 into NixOS:master Aug 31, 2020
@flokli flokli deleted the ohmyzsh-cleanups branch September 5, 2020 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants