helloSystem / launch

Command line tool to launch applications, will search for .app bundles and .AppDir directories in various directories, and will show launch errors in the GUI
BSD 2-Clause "Simplified" License
16 stars 6 forks source link

Define further error handlers #1

Open probonopd opened 3 years ago

probonopd commented 3 years ago

Define further error handlers, e.g., for


Implemented so far:

image

image

image

probonopd commented 3 years ago

The launch command is supposed to give users helpful information in case an application cannot be launched. (in a future version, we may want to not only give advice but also offer to do it.)

Exmaple: https://www.cinelerra-gg.org/freebsd-package/

image

It would be neat if we could offer a way for the user to find out which FreeBSD package to install.

https://www.freshports.org/search.php?stype=pkg-plist&method=match&query=libIlmImf&num=1&orderby=category&orderbyupdown=asc&search=Search&format=plaintext&branch=head

tells us: graphics/openexr! (Note that we need to use libIlmImf minus any version numbers or else we don't get any search result.)

...almost.

% find /usr/local/lib/ | grep libIlmImf 
/usr/local/lib/libIlmImfUtil-2_5.so.25
/usr/local/lib/libIlmImf-2_5.so
/usr/local/lib/libIlmImf-2_5.so.25

Turns out that sudo pkg install graphics/openexr installs 25 whereas we need 24.

So we really need a way to search for the full file name, not "minus any version numbers". Ideally across all still-available package branches (maybe we would find 24 in some earlier one?).

Is there a way to do this @dlangille?

(Also, is it a bug that this query returns HTML rather than plaintext?)

probonopd commented 3 years ago

We might even want to run dd proactively to find all missing libraries at once:

% ldd ~/Desktop/Cinelerra\ GG.app/Resources/cin | grep not
        libIlmImf-2_3.so.24 => not found (0)
        libIlmThread-2_3.so.24 => not found (0)
        libIex-2_3.so.24 => not found (0)
        libaom.so.0 => not found (0)
        libdav1d.so.3 => not found (0)
        libx264.so.157 => not found (0)
        libx265.so.176 => not found (0)
grahamperrin commented 3 years ago

https://github.com/helloSystem/launch/issues/1#issuecomment-798869996

Also, for example:

% pkg provides libilmimf
Name    : openexr-2.5.5
Desc    : High dynamic-range (HDR) image file format
Repo    : FreeBSD
Filename: usr/local/lib/libIlmImfUtil.so
        usr/local/lib/libIlmImfUtil-2_5.so.25.0.4
        usr/local/lib/libIlmImfUtil-2_5.so.25
        usr/local/lib/libIlmImfUtil-2_5.so
        usr/local/lib/libIlmImf.so
        usr/local/lib/libIlmImf-2_5.so.25.0.4
        usr/local/lib/libIlmImf-2_5.so.25
        usr/local/lib/libIlmImf-2_5.so

Name    : ampasCTL-1.5.2_11
Desc    : Color Transformation Language interpreter
Repo    : FreeBSD
Filename: usr/local/lib/libIlmImfCtl.so
% 
probonopd commented 3 years ago

pkg provides

Does this work with packages that are not installed as well?

grahamperrin commented 3 years ago

Yes; https://www.freshports.org/ports-mgmt/pkg-provides/

probonopd commented 3 years ago

Wow!

Sounds like what we need. (At least if it keeps track of release_0, release_1, release_2, quarterly, latest and so on packages for each major release of FreeBSD.)

Related: https://github.com/FreshPorts/freshports/issues/219#issuecomment-799616386