forked from CSReviser/CS-English
-
Notifications
You must be signed in to change notification settings - Fork 0
/
_framework_osx_i386.sh
executable file
·36 lines (31 loc) · 3.96 KB
/
_framework_osx_i386.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
#Qtのフレームワークをコピーしてアプリケーション内に設置する
#このスクリプトと同じ場所に.appを作成する
cd $(dirname $0)
mkdir -p CaptureStream.app/Contents/Frameworks
cp -R /Library/Frameworks/{QtCore,QtGui,QtNetwork,QtScript,QtXml,QtXmlPatterns}.framework CaptureStream.app/Contents/Frameworks
#ここで各フレームワーク内のファイル名にdebugが入っているファイルを消す
find CaptureStream.app/Contents/Frameworks -name \*debug\* -delete
#ここで各フレームワーク内のHeadersディレクトリとHeadersへのシンボリックリンクを消す
find CaptureStream.app/Contents/Frameworks -name Headers -delete
#フレームワークのバイナリを32ビット(i386)のみにする
(cd CaptureStream.app/Contents/Frameworks/QtCore.framework/Versions/4; lipo QtCore -extract_family i386 -output QtCore.i386; mv QtCore.i386 QtCore)
(cd CaptureStream.app/Contents/Frameworks/QtGui.framework/Versions/4; lipo QtGui -extract_family i386 -output QtGui.i386; mv QtGui.i386 QtGui)
(cd CaptureStream.app/Contents/Frameworks/QtNetwork.framework/Versions/4; lipo QtNetwork -extract_family i386 -output QtNetwork.i386; mv QtNetwork.i386 QtNetwork)
(cd CaptureStream.app/Contents/Frameworks/QtScript.framework/Versions/4; lipo QtScript -extract_family i386 -output QtScript.i386; mv QtScript.i386 QtScript)
(cd CaptureStream.app/Contents/Frameworks/QtXml.framework/Versions/4; lipo QtXml -extract_family i386 -output QtXml.i386; mv QtXml.i386 QtXml)
(cd CaptureStream.app/Contents/Frameworks/QtXmlPatterns.framework/Versions/4; lipo QtXmlPatterns -extract_family i386 -output QtXmlPatterns.i386; mv QtXmlPatterns.i386 QtXmlPatterns)
#フレームワークのid設定
install_name_tool -id @executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore CaptureStream.app/Contents/Frameworks/QtCore.framework/Versions/4/QtCore
install_name_tool -id @executable_path/../Frameworks/QtGui.framework/Versions/4/QtGui CaptureStream.app/Contents/Frameworks/QtGui.framework/Versions/4/QtGui
install_name_tool -id @executable_path/../Frameworks/QtNetwork.framework/Versions/4/QtNetwork CaptureStream.app/Contents/Frameworks/QtNetwork.framework/Versions/4/QtNetwork
install_name_tool -id @executable_path/../Frameworks/QtScript.framework/Versions/4/QtScript CaptureStream.app/Contents/Frameworks/QtScript.framework/Versions/4/QtScript
install_name_tool -id @executable_path/../Frameworks/QtXml.framework/Versions/4/QtXml CaptureStream.app/Contents/Frameworks/QtXml.framework/Versions/4/QtXml
install_name_tool -id @executable_path/../Frameworks/QtXmlPatterns.framework/Versions/4/QtXmlPatterns CaptureStream.app/Contents/Frameworks/QtXmlPatterns.framework/Versions/4/QtXmlPatterns
#各フレームワーク相互の依存の修正
install_name_tool -change QtCore.framework/Versions/4/QtCore @executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore CaptureStream.app/Contents/Frameworks/QtGui.framework/Versions/4/QtGui
install_name_tool -change QtCore.framework/Versions/4/QtCore @executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore CaptureStream.app/Contents/Frameworks/QtNetwork.framework/Versions/4/QtNetwork
install_name_tool -change QtCore.framework/Versions/4/QtCore @executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore CaptureStream.app/Contents/Frameworks/QtScript.framework/Versions/4/QtScript
install_name_tool -change QtCore.framework/Versions/4/QtCore @executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore CaptureStream.app/Contents/Frameworks/QtXml.framework/Versions/4/QtXml
install_name_tool -change QtCore.framework/Versions/4/QtCore @executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore CaptureStream.app/Contents/Frameworks/QtXmlPatterns.framework/Versions/4/QtXmlPatterns
install_name_tool -change QtNetwork.framework/Versions/4/QtNetwork @executable_path/../Frameworks/QtNetwork.framework/Versions/4/QtNetwork CaptureStream.app/Contents/Frameworks/QtXmlPatterns.framework/Versions/4/QtXmlPatterns