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