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

Sorry, something went wrong.

@jwiegley jwiegley requested a review from adisbladis as a code owner October 20, 2019 17:22
@@ -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

@adisbladis adisbladis Oct 20, 2019

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.

@ofborg ofborg bot added the 6.topic: emacs Text editor label Oct 20, 2019
@ofborg ofborg bot requested review from the-kenny, lovek323 and peti October 20, 2019 18:17
@ofborg ofborg bot added 11.by: package-maintainer This PR was created by the maintainer of the package it changes 10.rebuild-darwin: 11-100 10.rebuild-linux: 11-100 labels Oct 20, 2019
@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

@ofborg ofborg bot requested review from Phreedom, thoughtpolice and adisbladis May 10, 2020 22:09
@ofborg ofborg bot added the 2.status: merge conflict This PR has merge conflicts with the target branch label Jun 24, 2020
@ofborg ofborg bot removed 6.topic: emacs Text editor 2.status: merge conflict This PR has merge conflicts with the target branch labels Aug 6, 2020
@ofborg ofborg bot requested review from roconnor, vbgl and Zimmi48 August 6, 2020 23:39
@vbgl vbgl removed their request for review August 7, 2020 08:27
@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