Closed devurandom closed 6 years ago
Quick test on my Mac says No.
[] ➜ ldd $(which profanity)|grep -oP "^\slibpython\K(\d.\d)"
usage: grep [-abcDEFGHhIiJLlmnOoqRSsUVvwxZ] [-A num] [-B num] [-C[num]]
[-e pattern] [-f file] [--binary-files=value] [--color=when]
[--context[=num]] [--directories=action] [--label] [--line-buffered]
[--null] [pattern] [file ...]
-bash: ldd: command not found
Same goes for
[] ➜ scanelf
-bash: scanelf: command not found
A native solution on OSX might be:
otool -L $(which profanity) | grep python | sed -ne 's/.*\/\([0-9].[0-9]\).*$/\1/p'
Please feel free to improve 😸
Or… Two alternatives:
All the different approaches (scanelf, otool, ldd, etc) sound way too error prone to me, to be actually reliable and portable across all operating systems Profanity can be built on. So how about just asking for the PATH / Python Version the plugin should be built against?
profanity --version
We could file an issue over at boothj5/profanity to have profanity --version
report the version of Python it was built against. I guess @boothj5 won't oppose.
@bascht: The profanity --version
alternative would have been my choice, too (see my original post). I second it: boothj5/profanity#956
Upstream added support to master: boothj5/profanity@17b4e45c5795ed191d06964feeb2d20ae7ec6e94
python
might not be of the same version thatprofanity
was linked against.profanity -v
does not output the version of Python it was linked against, hence we look at its DT_NEEDED to determine the correct Python version.Fixes: #20