system-packages icon indicating copy to clipboard operation
system-packages copied to clipboard

How to support different package names on different distros?

Open jave opened this issue 7 years ago • 3 comments

Hello,

I'm using system-packages via use-package.

Is it possible to support different package names for the same binary on different distros?

For instance, the "go" binary would be supplied by the pkg "golang-binary" on Fedora, and "golang-go" on Ubuntu.

jave avatar Mar 31 '18 10:03 jave

This is something I've thought a little about and haven't come up with a good way yet. For now, probably the easiest way is just to specify it multiple times:

(use-package foo :ensure-system-package (; Ubuntu (go . golang-go)) ; Fedora (go . golang-binary))

Hope that helps!

On Sat 31 Mar 2018 at 05:25, joakim verona [email protected] wrote:

Hello,

I'm using system-packages via use-package.

Is it possible to support different package names for the same binary on different distros?

For instance, the "go" binary would be supplied by the pkg "golang-binary" on Fedora, and "golang-go" on Ubuntu.

jabranham avatar Mar 31 '18 16:03 jabranham

cool, but how does it work?

jave avatar Apr 01 '18 23:04 jave

From the use-package README, it sounds like you can supply a list of (binary . package-name) to :ensure-system-package where it will try to install package-name if binary isn't found.

https://github.com/jwiegley/use-package#use-package-ensure-system-package

jabranham avatar Apr 02 '18 14:04 jabranham