use-package icon indicating copy to clipboard operation
use-package copied to clipboard

Use system-packages-get-info to test if system package is installed

Open ncsalgado opened this issue 6 years ago • 1 comments

I have the following command: (use-package pdf-tools :ensure-system-package (libpng-dev zlib1g-dev libpoppler-glib-dev libpoppler-private-dev imagemagick) ) Every time I start emacs it asks me to install all system packages mentioned above. "(use-package-ensure-system-package-exists? PACKAGE-NAME)" also fails. Why not use the "(system-packages-get-info PACKAGE-NAME)" to test if a system package is already installed instead of testing the existence of a file? - I tried that but its to early for me to know how to do it...

ncsalgado avatar Feb 10 '19 11:02 ncsalgado

Under the hood (use-package-ensure-system-package-exists?) uses (executable-find) in your example which means those packages are not available on Emacs' exec-path, at least by the time that (use-package) declaration is evaluated. You'll need to copy/import your shell's path to Emacs. (exec-path-from-shell) is what I use to do this on macOS for example.

(system-packages-get-info) only works on some package managers, and since use-package-ensure-system-package can also accept paths to files as strings and alternate installation methods as strings, it doesn't make sense for that to be used to determine whether the "system package" is installed or not.

waymondo avatar Feb 12 '19 16:02 waymondo