Ticket #37331: install.sh

File install.sh, 1.1 KB (added by ChristianFrisson (Christian Frisson), 10 years ago)

to be located in the 'files' folder

Line 
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
12for i in $1$2/Library/Frameworks/Qt*framework/Versions/*/Qt*; 
13        do echo $i; 
14        install_name_tool -id $2/${i#$1$2} $i;
15done
16
17# Adjust the frameworks dependencies paths
18for 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;
24done
25
26# Adjust the dynamic libraries ids
27for i in $(find $1$2 -name "*.dylib"); 
28        do echo $i; install_name_tool -id $2${i#$1$2} $i;
29done
30
31# Adjust the dynamic libraries dependencies paths
32for 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;
38done
39