You are not logged in.
Pages: 1
So this might be a stupid question.
but when writing a PKGBUILD for an application how do you figure out what dependencies are required for the application?
Is there something im missing when looking at a project.
Take for example gnome-control-center how would one find the dependencies for that app?
Offline
You start with what upstream tells you. If we're talking about compiled binaries, you can also look at what libs it's linked to. The build system failing because it can't find a lib is another huge clue.
Offline
If we're talking about compiled binaries, you can also look at what libs it's linked to.
how would you go about finding this out?
Offline
This is a tiny script I use to find the packages required to satisfy all of a binary's linked library dependencies (assuming you've successfully built the binary and it will run on your machine):
#!/bin/sh
readelf -d $1 \
| sed -n 's|.*Shared library: \[\([^\]*\)\]|/usr/lib/\1|p' \
| pacman -Qqo - \
| sort -u
Note that this should not produce any false positives (everything it lists is a dependency). But some of what it lists may be in base-devel and should then not be listed in the PKGBUILD. Additionally this may miss some dependencies as it only detects actual linked-library dependencies: software can also depend on other tools at run-time in order to function as intended, and this script will not detect this.
EDIT: to use the script, run it with the binary executable as the first / only command line parameter.
Last edited by Trilby (2022-06-04 15:51:33)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Pages: 1