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

emacs: Make the application bundle name configurable #71459

Merged
merged 0 commits into from Aug 23, 2020

Conversation

jwiegley
Copy link
Contributor

Motivation for this change

Up until a few months ago, it was possible to install Emacs under multiple application names while using emacsPackagesFor, because the code that's now in wrapper.nix used to be in a derivation where it could be overridden. The new mechanism does not allow overriding, which broke the scheme I use for separate Emacs and ERC as two different applications (and thus separately customizable in various ways).

This apparently happened due to #22893.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • 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 nix-review --run "nix-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.
Notify maintainers

cc @ @matthewbauer

@@ -33,6 +33,7 @@ stdenv.mkDerivation rec {
name = "emacs-${version}${versionModifier}";
version = "26.3";
versionModifier = "";
appName = "Emacs"; # used by Darwin systems in emacs/wrapper.nix
Copy link
Member

Choose a reason for hiding this comment

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

Wouldn't it be better to accept this as an argument to the function that returns the derivation and stick the attribute in passthru?
That way changing the appName would not cause a rebuild of emacs but just the wrapper.

@adisbladis
Copy link
Member

Ping @jwiegley

@jwiegley
Copy link
Contributor Author

jwiegley commented Nov 5, 2019

@adisbladis I don't know enough to answer that, actually. Would you be up for modifying this PR?

@adisbladis
Copy link
Member

adisbladis commented Nov 24, 2019

@jwiegley I rebased this PR and implemented my suggestion in https://github.com/adisbladis/nixpkgs/tree/emacs-app-bundle.
Could you see if this works for you?
It can be used in the following way:
(emacsPackages.override { darwinAppName = "aoeu"; }).emacsWithPackages(epkgs: [ epkgs.webpaste ])

With my change appName is not an attribute of the emacs derivation and hence you don't need to rebuild emacs, even with a custom bundle name.

If this works feel free to squash my commit with yours.

I also made a minor change renaming appName to darwinAppName to reflect that it's only applicable to a single platform.

@jwiegley
Copy link
Contributor Author

jwiegley commented Dec 17, 2019

@adisbladis No, this did not work for me, since I wasn't able to figure out how to adapt my configuration of Emacs to your solution. It claimed that darwinAppName wasn't a valid argument when I attempted to override my overridden emacsWithPackages here:

https://github.com/jwiegley/nix-config/blob/master/overlays/10-emacs.nix#L1139

@Zimmi48 Zimmi48 removed their request for review August 7, 2020 10:17
@jwiegley jwiegley closed this Aug 23, 2020
@marsam marsam merged commit 9ed4ff1 into NixOS:master Aug 23, 2020
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