Last active
December 6, 2017 03:11
-
-
Save faustinoaq/9c0288007be86dc1b908f031b4a1dc37 to your computer and use it in GitHub Desktop.
Extract binary dependencies (dynamic libraries) for crystal compiled program
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
executable = "bin/critter" | |
deps = [] of String | |
output = `ldd #{executable}`.scan(/(\/.*)\s\(/) do |m| | |
library = m[1] | |
deps << library | |
real_lib = File.real_path(library) | |
deps << real_lib if real_lib != library | |
end | |
deps.each do |dep| | |
`cp -v #{dep} deps/` | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment