-
-
Save fmap/17218faf725ed44dc5b6 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env bash | |
file "$(realpath $1)" | grep -q "shared object" || { | |
echo "Argument error: address a shared object file" >&2 | |
exit 1 | |
}; | |
find $(nix-store -q --referrers "$1") -executable -type f -name '*.so' -exec sh -c ' | |
realpath {} | xargs ldd | grep -o "/nix/store/.* " | xargs realpath | sed "s,^,$(nix-store -q --deriver {}):," | |
' ';' | sort -u | grep "$(realpath $1)" | grep -Po '^.*(?=:)' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment