1 | #!/bin/bash |
---|
2 | # |
---|
3 | # Install the compiled Qt framework from the dmg installer, for OSX and MacPorts. |
---|
4 | # |
---|
5 | # Arguments: |
---|
6 | # $1 destroot |
---|
7 | # $2 prefix |
---|
8 | # |
---|
9 | # by Christian Frisson |
---|
10 | |
---|
11 | # Adjust the frameworks ids |
---|
12 | for i in $1$2/Library/Frameworks/Qt*framework/Versions/*/Qt*; |
---|
13 | do echo $i; |
---|
14 | install_name_tool -id $2/${i#$1$2} $i; |
---|
15 | done |
---|
16 | |
---|
17 | # Adjust the frameworks dependencies paths |
---|
18 | for i in $1$2/Library/Frameworks/Qt*framework/Versions/*/Qt*; |
---|
19 | do echo $i; |
---|
20 | list=`otool -L $i | grep -v $2 | grep Qt | grep framework | cut -d' ' -f1` ; |
---|
21 | for l in $list; |
---|
22 | do install_name_tool -change $l $2/Library/Frameworks/Qt${l#*lib/Qt} $i; |
---|
23 | done; |
---|
24 | done |
---|
25 | |
---|
26 | # Adjust the dynamic libraries ids |
---|
27 | for i in $(find $1$2 -name "*.dylib"); |
---|
28 | do echo $i; install_name_tool -id $2${i#$1$2} $i; |
---|
29 | done |
---|
30 | |
---|
31 | # Adjust the dynamic libraries dependencies paths |
---|
32 | for i in $(find $1$2 -name "*.dylib") $(find $1$2/bin -type f ! -name "*.*"); |
---|
33 | do echo $i; |
---|
34 | list=`otool -L $i | grep -v $2 | grep Qt | grep framework | cut -d' ' -f1` ; |
---|
35 | for l in $list; |
---|
36 | do install_name_tool -change $l $2/Library/Frameworks/Qt${l#*lib/Qt} $i; |
---|
37 | done; |
---|
38 | done |
---|
39 | |
---|