]>
Commit | Line | Data |
---|---|---|
3412ed51 | 1 | #!/bin/sh |
17eb3699 | 2 | |
522c4984 AD |
3 | KMD_DIR=verus-cli |
4 | mkdir ${KMD_DIR} | |
5 | ||
08682464 | 6 | cp src/fiat/verus \ |
522c4984 AD |
7 | src/verusd \ |
8 | doc/man/verus-cli/mac/README.txt \ | |
9 | zcutil/fetch-params.sh \ | |
8eafa6ab | 10 | zcutil/upgrade-agama.sh \ |
522c4984 AD |
11 | verus-cli |
12 | mv verus-cli/fetch-params.sh verus-cli/fetch-params | |
13 | chmod +x ${KMD_DIR}/fetch-params | |
14 | chmod +x ${KMD_DIR}/verus | |
15 | chmod +x ${KMD_DIR}/verusd | |
25b28724 | 16 | chmod +x ${KMD_DIR}/upgrade-agama.sh |
c2d0ef72 | 17 | |
f60687ca | 18 | binaries=("komodo-cli" "komodod") |
c444a898 | 19 | alllibs=() |
f60687ca DD |
20 | for binary in "${binaries[@]}"; |
21 | do | |
c2d0ef72 | 22 | # do the work in the destination directory |
522c4984 | 23 | cp src/${binary} ${KMD_DIR} |
c2d0ef72 | 24 | # find the dylibs to copy for komodod |
522c4984 AD |
25 | DYLIBS=`otool -L ${KMD_DIR}/${binary} | grep "/usr/local" | awk -F' ' '{ print $1 }'` |
26 | echo "copying ${DYLIBS} to ${KMD_DIR}" | |
f60687ca | 27 | # copy the dylibs to the srcdir |
522c4984 | 28 | for dylib in ${DYLIBS}; do cp -rf ${dylib} ${KMD_DIR}; done |
f60687ca | 29 | done |
464a17ce | 30 | |
c1dfcf84 | 31 | libraries=("libgcc_s.1.dylib" "libgomp.1.dylib" "libidn2.0.dylib" "libstdc++.6.dylib") |
464a17ce DD |
32 | |
33 | for binary in "${libraries[@]}"; | |
34 | do | |
7f21e751 | 35 | # find the dylibs to copy for komodod |
522c4984 AD |
36 | DYLIBS=`otool -L ${KMD_DIR}/${binary} | grep "/usr/local" | awk -F' ' '{ print $1 }'` |
37 | echo "copying ${DYLIBS} to ${KMD_DIR}" | |
464a17ce | 38 | # copy the dylibs to the srcdir |
522c4984 | 39 | for dylib in ${DYLIBS}; do cp -rf ${dylib} ${KMD_DIR}; alllibs+=(${dylib}); done |
464a17ce DD |
40 | done |
41 | ||
17eb3699 | 42 | indirectlibraries=("libintl.8.dylib" "libunistring.2.dylib") |
464a17ce | 43 | |
e3938c8e | 44 | for binary in "${indirectlibraries[@]}"; |
464a17ce DD |
45 | do |
46 | # Need to undo this for the dylibs when we are done | |
522c4984 | 47 | chmod 755 src/${binary} |
464a17ce | 48 | # find the dylibs to copy for komodod |
522c4984 AD |
49 | DYLIBS=`otool -L ${KMD_DIR}/${binary} | grep "/usr/local" | awk -F' ' '{ print $1 }'` |
50 | echo "copying indirect ${DYLIBS} to ${KMD_DIR}" | |
c2d0ef72 | 51 | # copy the dylibs to the dest dir |
522c4984 | 52 | for dylib in ${DYLIBS}; do cp -rf ${dylib} ${KMD_DIR}; alllibs+=(${dylib}); done |
c444a898 DD |
53 | done |
54 | ||
55 | for binary in "${binaries[@]}"; | |
56 | do | |
e3938c8e | 57 | # modify komodod to point to dylibs |
522c4984 | 58 | echo "modifying ${binary} to use local libraries" |
c2d0ef72 | 59 | for dylib in "${alllibs[@]}" |
238baa09 | 60 | do |
522c4984 AD |
61 | echo "Next lib is ${dylib} " |
62 | install_name_tool -change ${dylib} @executable_path/`basename ${dylib}` ${KMD_DIR}/${binary} | |
c71c9923 | 63 | done |
522c4984 | 64 | chmod +x ${KMD_DIR}/${binary} |
c71c9923 | 65 | done |
c2d0ef72 | 66 | |
c71c9923 DD |
67 | for binary in "${libraries[@]}"; |
68 | do | |
69 | # modify libraries to point to dylibs | |
522c4984 | 70 | echo "modifying ${binary} to use local libraries" |
c71c9923 DD |
71 | for dylib in "${alllibs[@]}" |
72 | do | |
522c4984 AD |
73 | echo "Next lib is ${dylib} " |
74 | install_name_tool -change ${dylib} @executable_path/`basename ${dylib}` ${KMD_DIR}/${binary} | |
c2d0ef72 | 75 | done |
464a17ce | 76 | done |
c71c9923 DD |
77 | |
78 |