Browse Source

Moved mac distribution into scripts

Thomas Buck 11 years ago
parent
commit
44a44a1d9f
5 changed files with 93 additions and 50 deletions
  1. 7
    50
      Makefile
  2. 6
    0
      mac_dist/archive.sh
  3. 13
    0
      mac_dist/bundle.sh
  4. 44
    0
      mac_dist/frameworks.sh
  5. 23
    0
      mac_dist/image.sh

+ 7
- 50
Makefile View File

@@ -115,58 +115,14 @@ auto: $(BUILD_SELECT)
115 115
 targets: $(TARGETS)
116 116
 
117 117
 bundle: release
118
-	mkdir -p bin/OpenRaider.app/Contents/MacOS
119
-	mkdir -p bin/OpenRaider.app/Contents/Resources/defaults
120
-	mkdir -p bin/OpenRaider.app/Contents/Frameworks
121
-	cp mac_dist/Info.plist bin/OpenRaider.app/Contents/Info.plist
122
-	cp mac_dist/openraider.icns bin/OpenRaider.app/Contents/Resources/openraider.icns
123
-	cp mac_dist/OpenRaider bin/OpenRaider.app/Contents/MacOS/OpenRaider
124
-	cp bin/release/OpenRaider bin/OpenRaider.app/Contents/MacOS/OpenRaider-bin
125
-	cp data/* bin/OpenRaider.app/Contents/Resources/defaults/
126
-	cp /opt/local/lib/libalut.0.1.0.dylib bin/OpenRaider.app/Contents/Frameworks/libalut.0.1.0.dylib
127
-	cp /opt/local/lib/libSDL_ttf-2.0.0.dylib bin/OpenRaider.app/Contents/Frameworks/libSDL_ttf-2.0.0.dylib
128
-	cp /opt/local/lib/libz.1.dylib bin/OpenRaider.app/Contents/Frameworks/libz.1.dylib
129
-	cp /opt/local/lib/libSDL-1.2.0.dylib bin/OpenRaider.app/Contents/Frameworks/libSDL-1.2.0.dylib
130
-	cp /opt/local/lib/libbz2.1.0.dylib bin/OpenRaider.app/Contents/Frameworks/libbz2.1.0.dylib
131
-	cp /opt/local/lib/libfreetype.6.dylib bin/OpenRaider.app/Contents/Frameworks/libfreetype.6.dylib
132
-	cp /opt/local/lib/libpng15.15.dylib bin/OpenRaider.app/Contents/Frameworks/libpng15.15.dylib
133
-	# OpenRaider-bin
134
-	install_name_tool -change /opt/local/lib/libalut.0.1.0.dylib @executable_path/../Frameworks/libalut.0.1.0.dylib bin/OpenRaider.app/Contents/MacOS/OpenRaider-bin
135
-	install_name_tool -change /opt/local/lib/libSDL_ttf-2.0.0.dylib @executable_path/../Frameworks/libSDL_ttf-2.0.0.dylib bin/OpenRaider.app/Contents/MacOS/OpenRaider-bin
136
-	install_name_tool -change /opt/local/lib/libz.1.dylib @executable_path/../Frameworks/libz.1.dylib bin/OpenRaider.app/Contents/MacOS/OpenRaider-bin
137
-	install_name_tool -change /opt/local/lib/libSDL-1.2.0.dylib @executable_path/../Frameworks/libSDL-1.2.0.dylib bin/OpenRaider.app/Contents/MacOS/OpenRaider-bin
138
-	install_name_tool -change /opt/X11/lib/libXmu.6.dylib /usr/X11/lib/libXmu.6.dylib bin/OpenRaider.app/Contents/MacOS/OpenRaider-bin
139
-	install_name_tool -change /opt/X11/lib/libXt.6.dylib /usr/X11/lib/libXt.6.dylib bin/OpenRaider.app/Contents/MacOS/OpenRaider-bin
140
-	install_name_tool -change /opt/X11/lib/libSM.6.dylib /usr/X11/lib/libSM.6.dylib bin/OpenRaider.app/Contents/MacOS/OpenRaider-bin
141
-	install_name_tool -change /opt/X11/lib/libICE.6.dylib /usr/X11/lib/libICE.6.dylib bin/OpenRaider.app/Contents/MacOS/OpenRaider-bin
142
-	install_name_tool -change /opt/X11/lib/libXext.6.dylib /usr/X11/lib/libXext.6.dylib bin/OpenRaider.app/Contents/MacOS/OpenRaider-bin
143
-	install_name_tool -change /opt/X11/lib/libX11.6.dylib /usr/X11/lib/libX11.6.dylib bin/OpenRaider.app/Contents/MacOS/OpenRaider-bin
144
-	install_name_tool -change /opt/X11/lib/libXi.6.dylib /usr/X11/lib/libXi.6.dylib bin/OpenRaider.app/Contents/MacOS/OpenRaider-bin
145
-	# libSDL-1.2.0.dylib
146
-	install_name_tool -change /opt/local/lib/libX11.6.dylib /usr/X11/lib/libX11.6.dylib bin/OpenRaider.app/Contents/Frameworks/libSDL-1.2.0.dylib
147
-	install_name_tool -change /opt/local/lib/libXext.6.dylib /usr/X11/lib/libXext.6.dylib bin/OpenRaider.app/Contents/Frameworks/libSDL-1.2.0.dylib
148
-	install_name_tool -change /opt/local/lib/libXrandr.2.dylib /usr/X11/lib/libXrandr.2.dylib bin/OpenRaider.app/Contents/Frameworks/libSDL-1.2.0.dylib
149
-	install_name_tool -change /opt/local/lib/libXrender.1.dylib /usr/X11/lib/libXrender.1.dylib bin/OpenRaider.app/Contents/Frameworks/libSDL-1.2.0.dylib
150
-	# libSDL_ttf-2.0.0.dylib
151
-	install_name_tool -change /opt/local/lib/libSDL-1.2.0.dylib @executable_path/../Frameworks/libSDL-1.2.0.dylib bin/OpenRaider.app/Contents/Frameworks/libSDL_ttf-2.0.0.dylib
152
-	install_name_tool -change /opt/local/lib/libfreetype.6.dylib @executable_path/../Frameworks/libfreetype.6.dylib bin/OpenRaider.app/Contents/Frameworks/libSDL_ttf-2.0.0.dylib
153
-	install_name_tool -change /opt/local/lib/libz.1.dylib @executable_path/../Frameworks/libz.1.dylib bin/OpenRaider.app/Contents/Frameworks/libSDL_ttf-2.0.0.dylib
154
-	install_name_tool -change /opt/local/lib/libbz2.1.0.dylib @executable_path/../Frameworks/libbz2.1.0.dylib bin/OpenRaider.app/Contents/Frameworks/libSDL_ttf-2.0.0.dylib
155
-	# libfreetype.6.dylib
156
-	install_name_tool -change /opt/local/lib/libz.1.dylib @executable_path/../Frameworks/libz.1.dylib bin/OpenRaider.app/Contents/Frameworks/libfreetype.6.dylib
157
-	install_name_tool -change /opt/local/lib/libbz2.1.0.dylib @executable_path/../Frameworks/libbz2.1.0.dylib bin/OpenRaider.app/Contents/Frameworks/libfreetype.6.dylib
158
-	install_name_tool -change /opt/local/lib/libpng15.15.dylib @executable_path/../Frameworks/libpng15.15.dylib bin/OpenRaider.app/Contents/Frameworks/libfreetype.6.dylib
159
-	# libpng15.15.dylib
160
-	install_name_tool -change /opt/local/lib/libz.1.dylib @executable_path/../Frameworks/libz.1.dylib bin/OpenRaider.app/Contents/Frameworks/libpng15.15.dylib
118
+	mac_dist/bundle.sh
119
+	mac_dist/frameworks.sh
161 120
 
162 121
 bundle-image: bundle
163
-	hdiutil create -size 32m -fs HFS+ -volname "OpenRaider" bin/tmp.dmg
164
-	hdiutil attach bin/tmp.dmg
165
-	cp -r bin/OpenRaider.app /Volumes/OpenRaider/OpenRaider.app
166
-	osascript -e 'tell application "Finder" to make alias file to POSIX file "/Applications" at POSIX file "/Volumes/OpenRaider/"'
167
-	hdiutil detach /Volumes/OpenRaider
168
-	hdiutil convert bin/tmp.dmg -format UDZO -o bin/OpenRaider.dmg
169
-	rm -rf bin/tmp.dmg
122
+	mac_dist/image.sh
123
+
124
+bundle-archive: bundle
125
+	mac_dist/archive.sh
170 126
 
171 127
 all: debug release prof
172 128
 
@@ -269,6 +225,7 @@ clean: clean-small clean-dep
269 225
 clean-small: clean-emacs clean-build clean-test clean-obj 
270 226
 	@-rm -rf bin/OpenRaider.app
271 227
 	@-rm -rf bin/OpenRaider.dmg
228
+	@-rm -rf bin/OpenRaider.zip
272 229
 
273 230
 clean-dep:
274 231
 	@-echo "Cleaning dependencies                        "

+ 6
- 0
mac_dist/archive.sh View File

@@ -0,0 +1,6 @@
1
+#!/bin/sh
2
+
3
+echo Creating ZIP file..
4
+cd bin
5
+zip -r OpenRaider.zip OpenRaider.app ../COPYING ../README.md ../README.old
6
+echo Archive ready!

+ 13
- 0
mac_dist/bundle.sh View File

@@ -0,0 +1,13 @@
1
+#!/bin/sh
2
+
3
+echo Creating bundle directory structure
4
+mkdir -p bin/OpenRaider.app/Contents/MacOS
5
+mkdir -p bin/OpenRaider.app/Contents/Resources/defaults
6
+mkdir -p bin/OpenRaider.app/Contents/Frameworks
7
+
8
+echo Moving bundle data in place
9
+cp mac_dist/Info.plist bin/OpenRaider.app/Contents/Info.plist
10
+cp mac_dist/openraider.icns bin/OpenRaider.app/Contents/Resources/openraider.icns
11
+cp mac_dist/OpenRaider bin/OpenRaider.app/Contents/MacOS/OpenRaider
12
+cp bin/release/OpenRaider bin/OpenRaider.app/Contents/MacOS/OpenRaider-bin
13
+cp data/* bin/OpenRaider.app/Contents/Resources/defaults/

+ 44
- 0
mac_dist/frameworks.sh View File

@@ -0,0 +1,44 @@
1
+#!/bin/sh
2
+echo Moving dynamic libraries into place
3
+cp /opt/local/lib/libalut.0.1.0.dylib bin/OpenRaider.app/Contents/Frameworks/libalut.0.1.0.dylib
4
+cp /opt/local/lib/libSDL_ttf-2.0.0.dylib bin/OpenRaider.app/Contents/Frameworks/libSDL_ttf-2.0.0.dylib
5
+cp /opt/local/lib/libz.1.dylib bin/OpenRaider.app/Contents/Frameworks/libz.1.dylib
6
+cp /opt/local/lib/libSDL-1.2.0.dylib bin/OpenRaider.app/Contents/Frameworks/libSDL-1.2.0.dylib
7
+cp /opt/local/lib/libbz2.1.0.dylib bin/OpenRaider.app/Contents/Frameworks/libbz2.1.0.dylib
8
+cp /opt/local/lib/libfreetype.6.dylib bin/OpenRaider.app/Contents/Frameworks/libfreetype.6.dylib
9
+cp /opt/local/lib/libpng15.15.dylib bin/OpenRaider.app/Contents/Frameworks/libpng15.15.dylib
10
+
11
+echo Fixing Paths for OpenRaider-bin
12
+install_name_tool -change /opt/local/lib/libalut.0.1.0.dylib @executable_path/../Frameworks/libalut.0.1.0.dylib bin/OpenRaider.app/Contents/MacOS/OpenRaider-bin
13
+install_name_tool -change /opt/local/lib/libSDL_ttf-2.0.0.dylib @executable_path/../Frameworks/libSDL_ttf-2.0.0.dylib bin/OpenRaider.app/Contents/MacOS/OpenRaider-bin
14
+install_name_tool -change /opt/local/lib/libz.1.dylib @executable_path/../Frameworks/libz.1.dylib bin/OpenRaider.app/Contents/MacOS/OpenRaider-bin
15
+install_name_tool -change /opt/local/lib/libSDL-1.2.0.dylib @executable_path/../Frameworks/libSDL-1.2.0.dylib bin/OpenRaider.app/Contents/MacOS/OpenRaider-bin
16
+install_name_tool -change /opt/X11/lib/libXmu.6.dylib /usr/X11/lib/libXmu.6.dylib bin/OpenRaider.app/Contents/MacOS/OpenRaider-bin
17
+install_name_tool -change /opt/X11/lib/libXt.6.dylib /usr/X11/lib/libXt.6.dylib bin/OpenRaider.app/Contents/MacOS/OpenRaider-bin
18
+install_name_tool -change /opt/X11/lib/libSM.6.dylib /usr/X11/lib/libSM.6.dylib bin/OpenRaider.app/Contents/MacOS/OpenRaider-bin
19
+install_name_tool -change /opt/X11/lib/libICE.6.dylib /usr/X11/lib/libICE.6.dylib bin/OpenRaider.app/Contents/MacOS/OpenRaider-bin
20
+install_name_tool -change /opt/X11/lib/libXext.6.dylib /usr/X11/lib/libXext.6.dylib bin/OpenRaider.app/Contents/MacOS/OpenRaider-bin
21
+install_name_tool -change /opt/X11/lib/libX11.6.dylib /usr/X11/lib/libX11.6.dylib bin/OpenRaider.app/Contents/MacOS/OpenRaider-bin
22
+install_name_tool -change /opt/X11/lib/libXi.6.dylib /usr/X11/lib/libXi.6.dylib bin/OpenRaider.app/Contents/MacOS/OpenRaider-bin
23
+
24
+echo Fixing Paths for libSDL-1.2.0.dylib
25
+install_name_tool -change /opt/local/lib/libX11.6.dylib /usr/X11/lib/libX11.6.dylib bin/OpenRaider.app/Contents/Frameworks/libSDL-1.2.0.dylib
26
+install_name_tool -change /opt/local/lib/libXext.6.dylib /usr/X11/lib/libXext.6.dylib bin/OpenRaider.app/Contents/Frameworks/libSDL-1.2.0.dylib
27
+install_name_tool -change /opt/local/lib/libXrandr.2.dylib /usr/X11/lib/libXrandr.2.dylib bin/OpenRaider.app/Contents/Frameworks/libSDL-1.2.0.dylib
28
+install_name_tool -change /opt/local/lib/libXrender.1.dylib /usr/X11/lib/libXrender.1.dylib bin/OpenRaider.app/Contents/Frameworks/libSDL-1.2.0.dylib
29
+
30
+echo Fixing Paths for libSDL_ttf-2.0.0.dylib
31
+install_name_tool -change /opt/local/lib/libSDL-1.2.0.dylib @executable_path/../Frameworks/libSDL-1.2.0.dylib bin/OpenRaider.app/Contents/Frameworks/libSDL_ttf-2.0.0.dylib
32
+install_name_tool -change /opt/local/lib/libfreetype.6.dylib @executable_path/../Frameworks/libfreetype.6.dylib bin/OpenRaider.app/Contents/Frameworks/libSDL_ttf-2.0.0.dylib
33
+install_name_tool -change /opt/local/lib/libz.1.dylib @executable_path/../Frameworks/libz.1.dylib bin/OpenRaider.app/Contents/Frameworks/libSDL_ttf-2.0.0.dylib
34
+install_name_tool -change /opt/local/lib/libbz2.1.0.dylib @executable_path/../Frameworks/libbz2.1.0.dylib bin/OpenRaider.app/Contents/Frameworks/libSDL_ttf-2.0.0.dylib
35
+
36
+echo Fixing Paths for libfreetype.6.dylib
37
+install_name_tool -change /opt/local/lib/libz.1.dylib @executable_path/../Frameworks/libz.1.dylib bin/OpenRaider.app/Contents/Frameworks/libfreetype.6.dylib
38
+install_name_tool -change /opt/local/lib/libbz2.1.0.dylib @executable_path/../Frameworks/libbz2.1.0.dylib bin/OpenRaider.app/Contents/Frameworks/libfreetype.6.dylib
39
+install_name_tool -change /opt/local/lib/libpng15.15.dylib @executable_path/../Frameworks/libpng15.15.dylib bin/OpenRaider.app/Contents/Frameworks/libfreetype.6.dylib
40
+
41
+echo Fixing Paths for libpng15.15.dylib
42
+install_name_tool -change /opt/local/lib/libz.1.dylib @executable_path/../Frameworks/libz.1.dylib bin/OpenRaider.app/Contents/Frameworks/libpng15.15.dylib
43
+
44
+echo Dynamic libraries are set up!

+ 23
- 0
mac_dist/image.sh View File

@@ -0,0 +1,23 @@
1
+#!/bin/sh
2
+
3
+echo Creating temporary image
4
+hdiutil create -size 32m -fs HFS+ -volname "OpenRaider" bin/tmp.dmg
5
+
6
+echo Mounting image
7
+hdiutil attach bin/tmp.dmg
8
+
9
+echo Moving files
10
+cp -r bin/OpenRaider.app /Volumes/OpenRaider/OpenRaider.app
11
+osascript -e 'tell application "Finder" to make alias file to POSIX file "/Applications" at POSIX file "/Volumes/OpenRaider/"'
12
+cp COPYING /Volumes/OpenRaider/
13
+cp README.md /Volumes/OpenRaider/
14
+cp README.old /Volumes/OpenRaider/
15
+
16
+echo Unmounting image
17
+hdiutil detach /Volumes/OpenRaider
18
+
19
+echo Converting image
20
+hdiutil convert bin/tmp.dmg -format UDZO -o bin/OpenRaider.dmg
21
+rm -rf bin/tmp.dmg
22
+
23
+echo Image ready!

Loading…
Cancel
Save