-
-
Save 0x715C/8414f2f5f5ef2a5ceb3bfc737325b9f6 to your computer and use it in GitHub Desktop.
Determine libraries needed by a binary and output in format for snapcraft.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
TMPDIR=$(mktemp -d) | |
LDD=$TMPDIR/LDD | |
PACKAGES=$TMPDIR/PACKAGES | |
ldd $1 | awk -F ' ' '{print $3}' | sed '/^$/d' | sed '/^(/d' | grep -v '^not' > $LDD | |
while read p; do | |
echo -n . | |
package=$(pacman -Fq $p | sed 's/.*\///') | |
echo " - "$package >> $PACKAGES | |
done < $LDD | |
echo " " | |
sort $PACKAGES | uniq | |
rm -rf $TMPDIR |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment