You are not logged in.

#1 2022-06-04 15:39:47

SuperNinja_4965
Member
Registered: 2022-03-21
Posts: 2

Figuring out dependencies of applications

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

#2 2022-06-04 15:42:35

Scimmia
Fellow
Registered: 2012-09-01
Posts: 12,081

Re: Figuring out dependencies of applications

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

#3 2022-06-04 15:44:36

SuperNinja_4965
Member
Registered: 2022-03-21
Posts: 2

Re: Figuring out dependencies of applications

Scimmia wrote:

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

#4 2022-06-04 15:48:17

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,330
Website

Re: Figuring out dependencies of applications

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

Board footer

Powered by FluxBB