~ubuntu-branches/ubuntu/vivid/psi/vivid

« back to all changes in this revision

Viewing changes to mac/Makefile

  • Committer: Bazaar Package Importer
  • Author(s): Jan Niehusmann
  • Date: 2008-08-28 18:46:52 UTC
  • mfrom: (1.2.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20080828184652-iiik12dl91nq7cdi
Tags: 0.12-2
Uploading to unstable (Closes: Bug#494352)

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
#       * BUILD: Set this to 'no' if you do not want to build the source tree or
14
14
#               check dependencies of the 'disk' dir when building the DMG.
15
15
#
16
 
# Remko Troncon <remko@psi-im.org>
 
16
# Remko Troncon 
 
17
# http://el-tramo.be
17
18
#
18
19
 
19
20
# Change these according to your own setup
20
 
QTDIR=/usr/local/Trolltech/Qt-4.3.1
21
21
QCADIR=/usr/local
22
22
GROWLDIR=/Library/Frameworks
23
23
PSI_DIR=..
24
24
 
 
25
EXECUTABLE_NAME=psi
25
26
NAME=Psi
26
 
#VERSION=0.11-devel_$(shell date +"%Y%m%d")_debug
27
 
VERSION=0.11
28
 
FILES=Psi.app 
 
27
VOLUME_NAME=$(NAME)
 
28
#VERSION=0.12-devel_$(shell date +"%Y%m%d")
 
29
VERSION=0.12
 
30
 
 
31
APPFILE_NAME=Psi.app
 
32
FILES=$(APPFILE_NAME)
29
33
DISK_DIR=disk
30
34
ifneq ($(BUILD),no)
31
35
DISK_FILES=$(foreach f,$(FILES), $(addprefix $(DISK_DIR)/,$(f)))
36
40
# Other variables
37
41
QT_FRAMEWORK_VERSION=4
38
42
QT_FRAMEWORKS=QtCore QtXml QtNetwork QtGui QtSql Qt3Support
 
43
QT_PLUGINS=imageformats/libqjpeg.dylib imageformats/libqgif.dylib
39
44
 
40
45
# The rules
41
46
.PHONY: buildall
74
79
################################################################################
75
80
 
76
81
# The binary
77
 
$(DISK_DIR)/Psi.app: $(PSI_DIR)/src/psi.app
 
82
$(DISK_DIR)/$(APPFILE_NAME): $(PSI_DIR)/src/$(EXECUTABLE_NAME).app
78
83
        @echo
79
84
        @echo --------------------- Packaging Binary --------------------
80
85
        rm -rf "$@"
81
86
        ditto -rsrc "$<" "$@"
82
87
        mkdir -p "$@/Contents/Frameworks"
83
88
        -ditto -rsrc "$(GROWLDIR)/Growl.framework" "$@/Contents/Frameworks/Growl.framework"
84
 
        #strip "$@/Contents/MacOS/psi"
 
89
        #strip "$@/Contents/MacOS/$(EXECUTABLE_NAME)"
85
90
        #
86
91
        #@echo
87
92
        #@echo Installing QCA ...
88
93
        #cp -f "$(QCADIR)/lib/libqca.2.dylib" "$@/Contents/Frameworks/"
89
94
        #install_name_tool -id "@executable_path/../Frameworks/libqca.2.dylib" "$@/Contents/Frameworks/libqca.2.dylib"
90
 
        #install_name_tool -change "libqca.2.dylib" "@executable_path/../Frameworks/libqca.2.dylib" "$@/Contents/MacOS/psi"
91
 
        #install_name_tool -change "$(QCADIR)/lib/libqca.2.dylib" "@executable_path/../Frameworks/libqca.2.dylib" "$@/Contents/MacOS/psi"
 
95
        #install_name_tool -change "libqca.2.dylib" "@executable_path/../Frameworks/libqca.2.dylib" "$@/Contents/MacOS/$(EXECUTABLE_NAME)"
 
96
        #install_name_tool -change "$(QCADIR)/lib/libqca.2.dylib" "@executable_path/../Frameworks/libqca.2.dylib" "$@/Contents/MacOS/$(EXECUTABLE_NAME)"
92
97
        #mkdir -p "$@/Contents/Resources/crypto"
93
98
        #cp -f "$(QTDIR)/plugins/crypto/libqca-openssl.dylib" "$@/Contents/Resources/crypto/"
94
99
        #install_name_tool -change "$(QCADIR)/lib/libqca.2.dylib" "@executable_path/../Frameworks/libqca.2.dylib" "$@/Contents/Resources/crypto/libqca-openssl.dylib"
95
100
        #install_name_tool -change "libqca.2.dylib" "@executable_path/../Frameworks/libqca.2.dylib" "$@/Contents/Resources/crypto/libqca-openssl.dylib"
96
 
        mkdir -p "$@/Contents/Resources/imageformats"
97
 
        cp -f "$(QTDIR)/plugins/imageformats/libqjpeg.dylib" "$@/Contents/Resources/imageformats/"
 
101
        for f in $(QT_PLUGINS); do \
 
102
                mkdir -p "$@/Contents/Plugins/`dirname $$f`"; \
 
103
                cp -f "$(QTDIR)/plugins/$$f" "$@/Contents/Plugins/`dirname $$f`"; \
 
104
        done; \
98
105
        #
99
106
        @echo
100
107
        @echo Installing Qt Frameworks ...
110
117
                for g in $(QT_FRAMEWORKS); do \
111
118
                        install_name_tool -change "$(QTDIR)/lib/$$g.framework/Versions/$(QT_FRAMEWORK_VERSION)/$$g" "@executable_path/../Frameworks/$$g.framework/Versions/$(QT_FRAMEWORK_VERSION)/$$g" "$@/Contents/Frameworks/$$f.framework/Versions/$(QT_FRAMEWORK_VERSION)/$$f"; \
112
119
                done; \
 
120
                for g in $(QT_PLUGINS); do \
 
121
                        install_name_tool -change "$(QTDIR)/lib/$$f.framework/Versions/$(QT_FRAMEWORK_VERSION)/$$f" "@executable_path/../Frameworks/$$f.framework/Versions/$(QT_FRAMEWORK_VERSION)/$$f" "$@/Contents/Plugins/$$g"; \
 
122
                done; \
113
123
                \# install_name_tool -change "$(QTDIR)/lib/$$f.framework/Versions/$(QT_FRAMEWORK_VERSION)/$$f" "@executable_path/../Frameworks/$$f.framework/Versions/$(QT_FRAMEWORK_VERSION)/$$f" "$@/Contents/Frameworks/libqca.2.dylib"; \
114
124
                \# install_name_tool -change "$(QTDIR)/lib/$$f.framework/Versions/$(QT_FRAMEWORK_VERSION)/$$f" "@executable_path/../Frameworks/$$f.framework/Versions/$(QT_FRAMEWORK_VERSION)/$$f" "$@/Contents/Resources/crypto/libqca-openssl.dylib"; \
115
 
                install_name_tool -change "$(QTDIR)/lib/$$f.framework/Versions/$(QT_FRAMEWORK_VERSION)/$$f" "@executable_path/../Frameworks/$$f.framework/Versions/$(QT_FRAMEWORK_VERSION)/$$f" "$@/Contents/Resources/imageformats/libqjpeg.dylib"; \
116
 
                install_name_tool -change "$(QTDIR)/lib/$$f.framework/Versions/$(QT_FRAMEWORK_VERSION)/$$f" "@executable_path/../Frameworks/$$f.framework/Versions/$(QT_FRAMEWORK_VERSION)/$$f" "$@/Contents/MacOS/psi"; \
 
125
                install_name_tool -change "$(QTDIR)/lib/$$f.framework/Versions/$(QT_FRAMEWORK_VERSION)/$$f" "@executable_path/../Frameworks/$$f.framework/Versions/$(QT_FRAMEWORK_VERSION)/$$f" "$@/Contents/MacOS/$(EXECUTABLE_NAME)"; \
117
126
        done
118
127
 
119
128
# The rest
136
145
        @echo
137
146
        @echo --------------------- Generating empty template --------------------
138
147
        mkdir template
139
 
        hdiutil create -size 80m "$(TEMPLATE_DMG)" -srcfolder template -format UDRW -volname "$(NAME)" -quiet
 
148
        hdiutil create -size 80m "$(TEMPLATE_DMG)" -srcfolder template -format UDRW -volname "$(VOLUME_NAME)" -quiet
140
149
        rmdir template
141
150
        bzip2 "$(TEMPLATE_DMG)"
142
151
        @echo
156
165
        done
157
166
        #rm -f "$@"
158
167
        #hdiutil create -srcfolder "$(WC_DIR)" -format UDZO -imagekey zlib-level=9 "$@" -volname "$(NAME) $(VERSION)" -scrub -quiet
159
 
        WC_DEV=`hdiutil info | grep "$(WC_DIR)" | grep "Apple_HFS" | awk '{print $$1}'` && \
160
 
        hdiutil detach $$WC_DEV -quiet -force
 
168
        diskutil eject `diskutil list | grep "$(VOLUME_NAME)" | grep "Apple_HFS" | awk '{print $$6}'`
161
169
        rm -f "$(MASTER_DMG)"
162
170
        hdiutil convert "$(WC_DMG)" -quiet -format UDZO -imagekey zlib-level=9 -o "$@"
163
171
        rm -rf $(WC_DIR)