NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
16.59k stars 13.07k forks source link

Installing multiple Eclipse packages leads to collisions and only one XDG desktop item available for app launchers that support XDG desktop items #173162

Open yuuyins opened 2 years ago

yuuyins commented 2 years ago

Describe the bug

Installing multiple Eclipse packages leads to collisions and only one XDG desktop item available for app launchers that support XDG desktop items.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Install eclipses.eclipse-java, eclipses.eclipse-modeling, eclipses.eclipse-platform.
  2. See collisions, and that only one eclipse binary is available to $PATH, and only one XDG desktop item will be shown by an app launcher like rofi

Expected behavior

No collisions. Have different binaries available in $PATH for running for each package, e.g. eclipse-java, eclipse-modeling, eclipse-platform. Each with its desktop item having different values for the parameters.

Screenshots

If applicable, add screenshots to help explain your problem.

Additional context

https://github.com/NixOS/nixpkgs/tree/master/pkgs/applications/editors/eclipse https://github.com/NixOS/nixpkgs/blob/fe8d073af7723da7b981c593e6b4399757aa1b0c/pkgs/applications/editors/eclipse/build-eclipse.nix#L41-L46 https://github.com/NixOS/nixpkgs/blob/fe8d073af7723da7b981c593e6b4399757aa1b0c/pkgs/applications/editors/eclipse/build-eclipse.nix#L10-L18 https://github.com/NixOS/nixpkgs/blob/fe8d073af7723da7b981c593e6b4399757aa1b0c/pkgs/applications/editors/eclipse/build-eclipse.nix#L48-L52

Notify maintainers

There's no meta.maitainers... So I'm @ according to git blame on the makewrapper and/or desktop item bits

@muradu @jerith666 @Nervengift @c0bw3b @rycee

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 5.15.34, NixOS, 22.05 (Quokka), 22.05.20220415.5181d59`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.7.0`
 - channels(root): `"nixos-22.05pre343944.ff377a78794"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
jerith666 commented 2 years ago

I see how this could be annoying, but this isn't a use case for me, so I probably won't spend time on a fix.

In theory one could even install multiple versions of eclipse-platform with different sets of plugins -- not sure how those could be disambiguated either.

yuuyins commented 2 years ago

i was wondering if, at least for the existing eclipse packages, would it be as easy as adding a ${pname} to the wrapper name and desktop item? i'll try experimenting with this later.

$ fd eclipse /run/current-system/sw/
/run/current-system/sw/bin/eclipse
/run/current-system/sw/share/applications/Eclipse.desktop
/run/current-system/sw/share/pixmaps/eclipse.xpm
jerith666 commented 2 years ago

Adding it to the wrapper name should be easy. I'm less certain about the desktop item. Happy to review a PR though! :)