Re: Adding runtime dependencies that aren't caught by shlibs:Depends
* Jens Reyer <firstname.lastname@example.org>, 2016-05-27, 20:17:
I think I have it working now in wine to automatically generate a list
of runtime dependencies. I based it on Jakub's suggestions, however I
didn't go for creating a "dependency binary".
For one I did get results this way, but unfortunately I neither really
know python nor perl which is usually used in wine packaging, in order
to cleanly implement it there.
I've attached shell implementation of SONAMEs-to-ELF converter.
sonames=$(shell grep "^\#define SONAME_" include/config.h | cut -d\" -f2)
paths=/usr /usr/lib /lib/$(shell dpkg-architecture -qDEB_HOST_MULTIARCH) /usr/lib/$(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
for soname in $(sonames); do \
for path in $(paths); do \
file=$$(echo $$path/$$soname | sed "s|//|/|g"); \
[ -f $$file ] && dpkg -S $$file | cut -d: -f1 | sed "s/\\(.*\\) */\\1,/" && break || true; \
The problem with $(shell) constructs is that they ignore errors. Please
avoid putting complicated code in them.
set -e -u
if [ $# = 0 ] || tty <&1 >/dev/null
printf 'Usage: %s SONAME... > ELF\n' "$0"
tmpdir=$(mktemp -d -t sonames2elf.XXXXXX)
printf 'INPUT(%s)\n' "$@" > libeverything.so
gcc -shared -nostdlib -Wl,--no-as-needed -L. -leverything -o elf
rm -rf "$tmpdir"