4 $0 <path to unpacked binary distribution directory>
6 This program return the list of libraries and where to find them based on
7 your currently installed programs.
12 if test $# -ne 1; then
19 for bin
in $
(find $binaryDist -executable -type f
) :; do
20 if test $bin = ":"; then
22 echo "No patchable found in this directory."
32 for lib
in $
(strings $bin |
grep '^\(/\|\)lib.*\.so' |
sort |
uniq) :; do
33 if test $lib = ":"; then
35 echo " This program is a script or it is statically linked."
45 #versionLessLib=$(echo $lib | sed 's,[.][.0-9]*$,,')
48 find /nix/store/*/lib* \( -type f -or -type l \) -name $lib |
49 grep -v '\(bootstrap-tools\|system-path\|user-environment\|extra-utils\)'
53 sed 's,^/nix/store/[a-z0-9]*-\([^/]*\)/.*/\([^/]*\)$, \1 -> \2,' |
59 sed 's,^/nix/store/[a-z0-9]*-\([^/]*\)-[.0-9]*/.*$,\1,' |
64 if test "$names" = "glibc"; then names
="glibc"; fi
65 if echo $names |
grep -c "gcc" &> /dev
/null
; then names
="stdenv.cc.cc"; fi
67 if test $lib != $libPath; then
68 interpreter
="--interpreter \${$names}/lib/$lib"
69 elif echo $addRPath |
grep -c "$names" &> /dev
/null
; then
72 addRPath
=${addRPath+$addRPath:}"\${$names}/lib"
79 patchelf $interpreter \\
80 ${addRPath+--set-rpath $addRPath \\