]>
Commit | Line | Data |
---|---|---|
3412ed51 | 1 | #!/bin/sh |
17eb3699 | 2 | |
761f6b23 A |
3 | DIST_DIR=verus-cli |
4 | mkdir ${DIST_DIR} | |
522c4984 | 5 | |
398d3395 | 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 | |
761f6b23 A |
12 | chmod +x ${DIST_DIR}/fetch-params |
13 | chmod +x ${DIST_DIR}/verus | |
14 | chmod +x ${DIST_DIR}/verusd | |
c2d0ef72 | 15 | |
761f6b23 | 16 | binaries=("verus" "verusd") |
c444a898 | 17 | alllibs=() |
f60687ca DD |
18 | for binary in "${binaries[@]}"; |
19 | do | |
c2d0ef72 | 20 | # do the work in the destination directory |
761f6b23 A |
21 | cp src/${binary} ${DIST_DIR} |
22 | # find the dylibs to copy for verusd | |
23 | DYLIBS=`otool -L ${DIST_DIR}/${binary} | grep "/usr/local" | awk -F' ' '{ print $1 }'` | |
398d3395 | 24 | DYLIBS+=" /usr/local/opt/libidn2/lib/libidn2.0.dylib" |
761f6b23 | 25 | echo "copying ${DYLIBS} to ${DIST_DIR}" |
f60687ca | 26 | # copy the dylibs to the srcdir |
761f6b23 | 27 | for dylib in ${DYLIBS}; do cp -rf ${dylib} ${DIST_DIR}; done |
f60687ca | 28 | done |
464a17ce | 29 | |
398d3395 | 30 | libraries=("libgcc_s.1.dylib" "libgomp.1.dylib" "libidn2.0.dylib" "libstdc++.6.dylib") |
464a17ce DD |
31 | |
32 | for binary in "${libraries[@]}"; | |
33 | do | |
761f6b23 A |
34 | # find the dylibs to copy for verusd |
35 | DYLIBS=`otool -L ${DIST_DIR}/${binary} | grep "/usr/local" | awk -F' ' '{ print $1 }'` | |
36 | echo "copying ${DYLIBS} to ${DIST_DIR}" | |
464a17ce | 37 | # copy the dylibs to the srcdir |
761f6b23 | 38 | for dylib in ${DYLIBS}; do cp -rf ${dylib} ${DIST_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 | |
761f6b23 A |
46 | chmod 755 ${DIST_DIR}/${binary} |
47 | # find the dylibs to copy for verusd | |
48 | DYLIBS=`otool -L ${DIST_DIR}/${binary} | grep "/usr/local" | awk -F' ' '{ print $1 }'` | |
49 | echo "copying indirect ${DYLIBS} to ${DIST_DIR}" | |
c2d0ef72 | 50 | # copy the dylibs to the dest dir |
761f6b23 | 51 | for dylib in ${DYLIBS}; do cp -rf ${dylib} ${DIST_DIR}; alllibs+=(${dylib}); done |
c444a898 DD |
52 | done |
53 | ||
54 | for binary in "${binaries[@]}"; | |
55 | do | |
761f6b23 | 56 | # modify verusd to point to dylibs |
522c4984 | 57 | echo "modifying ${binary} to use local libraries" |
c2d0ef72 | 58 | for dylib in "${alllibs[@]}" |
238baa09 | 59 | do |
522c4984 | 60 | echo "Next lib is ${dylib} " |
761f6b23 | 61 | install_name_tool -change ${dylib} @executable_path/`basename ${dylib}` ${DIST_DIR}/${binary} |
c71c9923 | 62 | done |
761f6b23 | 63 | chmod +x ${DIST_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 | 72 | echo "Next lib is ${dylib} " |
761f6b23 | 73 | install_name_tool -change ${dylib} @executable_path/`basename ${dylib}` ${DIST_DIR}/${binary} |
c2d0ef72 | 74 | done |
464a17ce | 75 | done |
c71c9923 | 76 |