shoes 3.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (275) hide show
  1. data/.gitignore +12 -0
  2. data/CHANGELOG +29 -0
  3. data/COPYING +30 -0
  4. data/README.md +76 -0
  5. data/README.old +117 -0
  6. data/Rakefile +130 -0
  7. data/Rakefile.bk +651 -0
  8. data/app.yaml +7 -0
  9. data/bin/main.skel +104 -0
  10. data/bugs/issue-012e9468ddc7b0cb7e1503413a8a11c4f8707b67.yaml +21 -0
  11. data/bugs/issue-0711ff8b67baa63586f11d0096fee9dd4436bf58.yaml +23 -0
  12. data/bugs/issue-07f87998d93eb401e22395c11085676389b935c4.yaml +22 -0
  13. data/bugs/issue-0bff2d80008803cbc7efbcdacdc60ef2163664d2.yaml +22 -0
  14. data/bugs/issue-0c66f223d19efbca7b692f3b91961f407ad7abec.yaml +24 -0
  15. data/bugs/issue-183bc3c7a8f575aff2b24e0bf22aa0dfcc8e4fc2.yaml +29 -0
  16. data/bugs/issue-1bad1e60a04cb3adb6a8f3ded128af2e16b56ffe.yaml +18 -0
  17. data/bugs/issue-1f1d43f76bf4de79d7f94adbae6dd506a9d81633.yaml +41 -0
  18. data/bugs/issue-320924117cadb045cc91f2a6fca922b4d81d4bb5.yaml +20 -0
  19. data/bugs/issue-33e5c8355fbf65252ea9e939714651df8bd8cb3b.yaml +25 -0
  20. data/bugs/issue-36f7c8262a72bcd5e28cfa4ed29328b8237ea79b.yaml +20 -0
  21. data/bugs/issue-39bf04ee50c3bef67b89b8e9beb28657805587ce.yaml +18 -0
  22. data/bugs/issue-3e28ba7754f73d02ef416eef989af707a8c00f01.yaml +23 -0
  23. data/bugs/issue-3f638cc03f41f9c3fdf217355321f1563f8fee45.yaml +22 -0
  24. data/bugs/issue-41e48e14f1ef4f6deb69be68165d7dd3ffd99156.yaml +22 -0
  25. data/bugs/issue-4c9408166a2aa5dd333bbb05520deebf4ded08e0.yaml +22 -0
  26. data/bugs/issue-55c687e108ecd5aeb8e0d0aeb4294984f84acd3e.yaml +18 -0
  27. data/bugs/issue-5811d34692cc292717a58ec1df1f8948cf30d826.yaml +28 -0
  28. data/bugs/issue-5a7c1f59a0526f9cea7fb366867cf1e6ed8ef69d.yaml +22 -0
  29. data/bugs/issue-688a2c2566bef6a03efa57a4ae1f7cfa8fc74444.yaml +21 -0
  30. data/bugs/issue-78b16c7988ade2ef96e716fa8cb9a004bd4ced65.yaml +33 -0
  31. data/bugs/issue-804ee49f9800154eddf0650690c7a9bb5626253f.yaml +27 -0
  32. data/bugs/issue-807dd1c610b2e941a5d454e26b2eac27e89a0ab4.yaml +22 -0
  33. data/bugs/issue-822ee33ec11ebd25f90ea86e8438de7891e63aee.yaml +18 -0
  34. data/bugs/issue-82ff7152cebb8a1cb065b864cb4fe22de2328146.yaml +29 -0
  35. data/bugs/issue-856afbdcdd4970ad54b8ce4a6c017fbaab45f49d.yaml +31 -0
  36. data/bugs/issue-8d49e32fb21522651c67490adb4d80076dbb14e1.yaml +24 -0
  37. data/bugs/issue-91583359653a9d530c1e32be72d874d847a306e7.yaml +21 -0
  38. data/bugs/issue-af41a5229613172764e7d3c98431172db337053d.yaml +20 -0
  39. data/bugs/issue-bd9856b3788dd429c998a5af1b2aae8221cb80b7.yaml +28 -0
  40. data/bugs/issue-be22aef5c564fb7b5e9938343136a9cd6a2edb7b.yaml +22 -0
  41. data/bugs/issue-bf8697523c77c326e7e35fc82cf3dd739ae92310.yaml +27 -0
  42. data/bugs/issue-cdd4b4795f34d6ff46e56ece10f8216a4a5456b2.yaml +25 -0
  43. data/bugs/issue-d9bfb5581d745ef9deb3b9b2e08ef74d1cd43082.yaml +20 -0
  44. data/bugs/issue-e0ce2f687cc096f35715d28b0af88589f4ab6cc6.yaml +18 -0
  45. data/bugs/issue-e4b0aca4a10a574b333aeaecaaf221dbc5ed22c6.yaml +38 -0
  46. data/bugs/issue-f263746594b95ba778455730478ee8df60ee639d.yaml +22 -0
  47. data/bugs/project.yaml +72 -0
  48. data/builddeps.sh +102 -0
  49. data/fonts/Coolvetica.ttf +0 -0
  50. data/fonts/Lacuna.ttf +0 -0
  51. data/gemlib/shoes.rb +1 -0
  52. data/lib/shoes.rb +548 -0
  53. data/lib/shoes/cache.rb +54 -0
  54. data/lib/shoes/chipmunk.rb +35 -0
  55. data/lib/shoes/data.rb +39 -0
  56. data/lib/shoes/help.rb +468 -0
  57. data/lib/shoes/image.rb +25 -0
  58. data/lib/shoes/inspect.rb +128 -0
  59. data/lib/shoes/log.rb +48 -0
  60. data/lib/shoes/minitar.rb +986 -0
  61. data/lib/shoes/override.rb +38 -0
  62. data/lib/shoes/pack.rb +543 -0
  63. data/lib/shoes/search.rb +46 -0
  64. data/lib/shoes/setup.rb +329 -0
  65. data/lib/shoes/shy.rb +131 -0
  66. data/lib/shoes/shybuilder.rb +44 -0
  67. data/lib/shoes/version.rb +3 -0
  68. data/make/darwin/deps.vlc +12 -0
  69. data/make/darwin/dylibs.shoes +22 -0
  70. data/make/darwin/dylibs.video +11 -0
  71. data/make/darwin/env.rb +81 -0
  72. data/make/darwin/tasks.rb +105 -0
  73. data/make/linux/env.rb +65 -0
  74. data/make/linux/tasks.rb +61 -0
  75. data/make/make.rb +85 -0
  76. data/make/mingw/dlls +19 -0
  77. data/make/mingw/env.rb +69 -0
  78. data/make/mingw/tasks.rb +70 -0
  79. data/make/rakefile_common.rb +8 -0
  80. data/manual-snapshots/class-book.png +0 -0
  81. data/manual-snapshots/expert-definr.png +0 -0
  82. data/manual-snapshots/expert-funnies.png +0 -0
  83. data/manual-snapshots/expert-irb.png +0 -0
  84. data/manual-snapshots/expert-minesweeper.png +0 -0
  85. data/manual-snapshots/expert-othello.png +0 -0
  86. data/manual-snapshots/expert-pong.png +0 -0
  87. data/manual-snapshots/expert-tankspank.png +0 -0
  88. data/manual-snapshots/good-arc.png +0 -0
  89. data/manual-snapshots/good-clock.png +0 -0
  90. data/manual-snapshots/good-follow.png +0 -0
  91. data/manual-snapshots/good-reminder.png +0 -0
  92. data/manual-snapshots/good-vjot.png +0 -0
  93. data/manual-snapshots/simple-accordion.png +0 -0
  94. data/manual-snapshots/simple-anim-shapes.png +0 -0
  95. data/manual-snapshots/simple-anim-text.png +0 -0
  96. data/manual-snapshots/simple-arc.png +0 -0
  97. data/manual-snapshots/simple-bounce.png +0 -0
  98. data/manual-snapshots/simple-calc.png +0 -0
  99. data/manual-snapshots/simple-chipmunk.png +0 -0
  100. data/manual-snapshots/simple-control-sizes.png +0 -0
  101. data/manual-snapshots/simple-curve.png +0 -0
  102. data/manual-snapshots/simple-dialogs.png +0 -0
  103. data/manual-snapshots/simple-downloader.png +0 -0
  104. data/manual-snapshots/simple-draw.png +0 -0
  105. data/manual-snapshots/simple-editor.png +0 -0
  106. data/manual-snapshots/simple-form.png +0 -0
  107. data/manual-snapshots/simple-mask.png +0 -0
  108. data/manual-snapshots/simple-menu.png +0 -0
  109. data/manual-snapshots/simple-menu1.png +0 -0
  110. data/manual-snapshots/simple-rubygems.png +0 -0
  111. data/manual-snapshots/simple-slide.png +0 -0
  112. data/manual-snapshots/simple-sphere.png +0 -0
  113. data/manual-snapshots/simple-sqlite3.png +0 -0
  114. data/manual-snapshots/simple-timer.png +0 -0
  115. data/manual-snapshots/simple-video.png +0 -0
  116. data/platform/mac/Info.plist +55 -0
  117. data/platform/mac/build-deps.sh +658 -0
  118. data/platform/mac/command-manual.rb +1 -0
  119. data/platform/mac/deps-osx.patch +159 -0
  120. data/platform/mac/dmg_ds_store +0 -0
  121. data/platform/mac/pangorc +2 -0
  122. data/platform/mac/pkg-dmg +1447 -0
  123. data/platform/mac/shoes +31 -0
  124. data/platform/mac/shoes-launch +7 -0
  125. data/platform/mac/stub.m +178 -0
  126. data/platform/mac/version.plist +14 -0
  127. data/platform/msw/base.nsi +644 -0
  128. data/platform/msw/installer-1.bmp +0 -0
  129. data/platform/msw/installer-2.bmp +0 -0
  130. data/platform/msw/shoes.exe.manifest +17 -0
  131. data/platform/msw/shoes.ico +0 -0
  132. data/platform/msw/stub-inject.c +59 -0
  133. data/platform/msw/stub.c +271 -0
  134. data/platform/msw/stub32.h +14 -0
  135. data/platform/msw/stub32.rc +16 -0
  136. data/platform/nix/INSTALL +56 -0
  137. data/platform/nix/Makefile +144 -0
  138. data/platform/nix/shoes.launch +20 -0
  139. data/platform/skel.rb +27 -0
  140. data/rakefile_darwin.rb +7 -0
  141. data/rakefile_linux.rb +3 -0
  142. data/rakefile_mingw.rb +7 -0
  143. data/samples/class-book.rb +43 -0
  144. data/samples/class-book.yaml +387 -0
  145. data/samples/expert-definr.rb +23 -0
  146. data/samples/expert-funnies.rb +51 -0
  147. data/samples/expert-irb.rb +112 -0
  148. data/samples/expert-minesweeper.rb +267 -0
  149. data/samples/expert-othello.rb +319 -0
  150. data/samples/expert-pong.rb +62 -0
  151. data/samples/expert-tankspank.rb +385 -0
  152. data/samples/good-arc.rb +37 -0
  153. data/samples/good-clock.rb +51 -0
  154. data/samples/good-follow.rb +26 -0
  155. data/samples/good-reminder.rb +174 -0
  156. data/samples/good-vjot.rb +56 -0
  157. data/samples/simple-accordion.rb +75 -0
  158. data/samples/simple-anim-shapes.rb +17 -0
  159. data/samples/simple-anim-text.rb +13 -0
  160. data/samples/simple-arc.rb +23 -0
  161. data/samples/simple-bounce.rb +24 -0
  162. data/samples/simple-calc.rb +70 -0
  163. data/samples/simple-chipmunk.rb +26 -0
  164. data/samples/simple-control-sizes.rb +24 -0
  165. data/samples/simple-curve.rb +26 -0
  166. data/samples/simple-dialogs.rb +29 -0
  167. data/samples/simple-downloader.rb +27 -0
  168. data/samples/simple-draw.rb +13 -0
  169. data/samples/simple-editor.rb +28 -0
  170. data/samples/simple-form.rb +28 -0
  171. data/samples/simple-form.shy +0 -0
  172. data/samples/simple-mask.rb +21 -0
  173. data/samples/simple-menu.rb +31 -0
  174. data/samples/simple-menu1.rb +35 -0
  175. data/samples/simple-rubygems.rb +29 -0
  176. data/samples/simple-slide.rb +45 -0
  177. data/samples/simple-sphere.rb +28 -0
  178. data/samples/simple-sqlite3.rb +13 -0
  179. data/samples/simple-timer.rb +13 -0
  180. data/samples/simple-video.rb +13 -0
  181. data/shoes.gemspec +21 -0
  182. data/shoes/app.c +591 -0
  183. data/shoes/app.h +110 -0
  184. data/shoes/appwin32.h +13 -0
  185. data/shoes/appwin32.rc +28 -0
  186. data/shoes/canvas.c +2202 -0
  187. data/shoes/canvas.h +682 -0
  188. data/shoes/code.h +14 -0
  189. data/shoes/config.h +232 -0
  190. data/shoes/effects.c +243 -0
  191. data/shoes/effects.h +7 -0
  192. data/shoes/http.h +44 -0
  193. data/shoes/http/common.h +86 -0
  194. data/shoes/http/curl.c +259 -0
  195. data/shoes/http/nsurl.m +274 -0
  196. data/shoes/http/windownload.c +114 -0
  197. data/shoes/http/winhttp.c +216 -0
  198. data/shoes/http/winhttp.h +19 -0
  199. data/shoes/image.c +1020 -0
  200. data/shoes/internal.c +46 -0
  201. data/shoes/internal.h +63 -0
  202. data/shoes/native.h +110 -0
  203. data/shoes/native/cocoa.h +105 -0
  204. data/shoes/native/cocoa.m +1557 -0
  205. data/shoes/native/gtk.c +1257 -0
  206. data/shoes/native/windows.c +2392 -0
  207. data/shoes/ruby.c +5221 -0
  208. data/shoes/ruby.h +299 -0
  209. data/shoes/world.c +243 -0
  210. data/shoes/world.h +63 -0
  211. data/static/Shoes.icns +0 -0
  212. data/static/avatar.png +0 -0
  213. data/static/code_highlighter.js +188 -0
  214. data/static/code_highlighter_ruby.js +26 -0
  215. data/static/icon-debug.png +0 -0
  216. data/static/icon-error.png +0 -0
  217. data/static/icon-info.png +0 -0
  218. data/static/icon-warn.png +0 -0
  219. data/static/listbox_button1.png +0 -0
  220. data/static/listbox_button2.png +0 -0
  221. data/static/man-app.png +0 -0
  222. data/static/man-builds.png +0 -0
  223. data/static/man-builds1.png +0 -0
  224. data/static/man-editor-notepad.png +0 -0
  225. data/static/man-editor-osx.png +0 -0
  226. data/static/man-ele-background.png +0 -0
  227. data/static/man-ele-border.png +0 -0
  228. data/static/man-ele-button.png +0 -0
  229. data/static/man-ele-check.png +0 -0
  230. data/static/man-ele-editbox.png +0 -0
  231. data/static/man-ele-editline.png +0 -0
  232. data/static/man-ele-image.png +0 -0
  233. data/static/man-ele-listbox.png +0 -0
  234. data/static/man-ele-progress.png +0 -0
  235. data/static/man-ele-radio.png +0 -0
  236. data/static/man-ele-shape.png +0 -0
  237. data/static/man-ele-textblock.png +0 -0
  238. data/static/man-ele-video.png +0 -0
  239. data/static/man-intro-dmg.png +0 -0
  240. data/static/man-intro-exe.png +0 -0
  241. data/static/man-look-tiger.png +0 -0
  242. data/static/man-look-ubuntu.png +0 -0
  243. data/static/man-look-vista.png +0 -0
  244. data/static/man-run-osx.png +0 -0
  245. data/static/man-run-vista.png +0 -0
  246. data/static/man-run-xp.png +0 -0
  247. data/static/man-shot1.png +0 -0
  248. data/static/manual-en.txt +3531 -0
  249. data/static/manual-ja.txt +2825 -0
  250. data/static/manual.css +167 -0
  251. data/static/menu-corner1.png +0 -0
  252. data/static/menu-corner2.png +0 -0
  253. data/static/menu-gray.png +0 -0
  254. data/static/menu-left.png +0 -0
  255. data/static/menu-right.png +0 -0
  256. data/static/menu-top.png +0 -0
  257. data/static/shoes-dmg.jpg +0 -0
  258. data/static/shoes-icon-blue.png +0 -0
  259. data/static/shoes-icon.png +0 -0
  260. data/static/shoes-manual-apps.gif +0 -0
  261. data/static/shoes_main_window.png +0 -0
  262. data/static/stripe.png +0 -0
  263. data/static/stubs/blank.exe +0 -0
  264. data/static/stubs/blank.hfz +0 -0
  265. data/static/stubs/blank.run +375 -0
  266. data/static/stubs/cocoa-install +0 -0
  267. data/static/stubs/sh-install +49 -0
  268. data/static/stubs/shoes-stub-inject.exe +0 -0
  269. data/static/stubs/shoes-stub.exe +0 -0
  270. data/static/tutor-back.png +0 -0
  271. data/test/shoes_test.rb +8 -0
  272. data/test/test_helper.rb +25 -0
  273. data/use-deps +12 -0
  274. data/use-tmp-dep +8 -0
  275. metadata +509 -0
@@ -0,0 +1,44 @@
1
+ # -*- encoding: utf-8 -*-
2
+ # crude shy-building UI; inspired by Jesse's "Shy Makey Thing"
3
+
4
+ require 'shoes/shy'
5
+
6
+ class Shoes
7
+ def self.start_shy_builder(launch_script)
8
+ launch_script = File.expand_path(launch_script)
9
+ top_dir = File.dirname(launch_script)
10
+ launch_script = File.basename(launch_script)
11
+ shy_name = "#{top_dir}.shy"
12
+ Shoes.app do
13
+ background white
14
+ stack do
15
+ para "Almost ready to make #{shy_name}"
16
+ fields = {}
17
+ for label, name in [["Project Name", "name"],
18
+ ["Version", "version"],
19
+ ["Your Name", "creator"]]
20
+ flow :width => 1.0 do
21
+ para "#{label}: "
22
+ fields[name] = edit_line ''
23
+ end
24
+ end
25
+ button "Build .shy" do
26
+ shy_desc = Shy.new
27
+ for name in fields.keys
28
+ shy_desc.send("#{name}=".intern, fields[name].text)
29
+ end
30
+ shy_desc.launch = launch_script
31
+ Shy.c(shy_name, shy_desc, top_dir)
32
+ clear
33
+ background white
34
+ stack do
35
+ para "Built #{shy_name}"
36
+ button "Ok" do
37
+ close
38
+ end
39
+ end
40
+ end
41
+ end
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,3 @@
1
+ class Shoes
2
+ VERSION="3.0.1"
3
+ end
@@ -0,0 +1,12 @@
1
+ libmemcpymmx.a
2
+ libi420_rgb_mmx.a
3
+ libi422_yuy2_mmx.a
4
+ libi420_ymga_mmx.a
5
+ libi420_yuy2_mmx.a
6
+ libmemcpymmxext.a
7
+ libmemcpy3dn.a
8
+ libffmpeg.a
9
+ libstream_out_switcher.a
10
+ libquicktime.a
11
+ libauhal.a
12
+ libmacosx.a
@@ -0,0 +1,22 @@
1
+ lib/libiconv.2.dylib
2
+ lib/libcairo.2.dylib
3
+ lib/libpixman-1.0.dylib
4
+ lib/libgmodule-2.0.0.dylib
5
+ lib/libintl.8.dylib
6
+ lib/libruby.dylib
7
+ lib/libglib-2.0.0.dylib
8
+ lib/libgobject-2.0.0.dylib
9
+ lib/libgthread-2.0.0.dylib
10
+ lib/libpng14.14.dylib
11
+ lib/libpango-1.0.0.dylib
12
+ lib/pango/1.6.0/modules/pango-basic-atsui.la
13
+ lib/libpangocairo-1.0.0.dylib
14
+ lib/pango/1.6.0/modules/pango-basic-atsui.so
15
+ etc/pango/pango.modules
16
+ lib/pango/1.6.0/modules/pango-arabic-lang.so
17
+ lib/pango/1.6.0/modules/pango-arabic-lang.la
18
+ lib/pango/1.6.0/modules/pango-indic-lang.so
19
+ lib/pango/1.6.0/modules/pango-indic-lang.la
20
+ lib/libjpeg.8.dylib
21
+ lib/libgif.4.dylib
22
+ lib/libportaudio.2.dylib
@@ -0,0 +1,11 @@
1
+ [lib/liba52.0.dylib
2
+ lib/libfaac.0.dylib
3
+ lib/libfaad.0.dylib
4
+ lib/libmp3lame.0.dylib
5
+ lib/libvorbis.0.dylib
6
+ lib/libogg.0.dylib
7
+ lib/libvorbisenc.2.dylib
8
+ lib/libpostproc.dylib
9
+ lib/libavformat.dylib
10
+ lib/libavcodec.dylib
11
+ lib/libavutil.dylib
@@ -0,0 +1,81 @@
1
+ EXT_RUBY = File.exists?("deps/ruby") ? "deps/ruby" : Config::CONFIG['prefix']
2
+
3
+ # use the platform Ruby claims
4
+ require 'rbconfig'
5
+
6
+ CC = ENV['CC'] ? ENV['CC'] : "gcc"
7
+ file_list = ["shoes/*.c"] + %w{shoes/native/cocoa.m shoes/http/nsurl.m}
8
+
9
+ SRC = FileList[*file_list]
10
+ OBJ = SRC.map do |x|
11
+ x.gsub(/\.\w+$/, '.o')
12
+ end
13
+
14
+ ADD_DLL = []
15
+
16
+ # Linux build environment
17
+ CAIRO_CFLAGS = ENV['CAIRO_CFLAGS'] || `pkg-config --cflags cairo`.strip
18
+ CAIRO_LIB = ENV['CAIRO_LIB'] ? "-L#{ENV['CAIRO_LIB']}" : `pkg-config --libs cairo`.strip
19
+ PANGO_CFLAGS = ENV['PANGO_CFLAGS'] || `pkg-config --cflags pango`.strip
20
+ PANGO_LIB = ENV['PANGO_LIB'] ? "-L#{ENV['PANGO_LIB']}" : `pkg-config --libs pango`.strip
21
+ png_lib = 'png'
22
+
23
+ # TODO: COPIED FROM LINUX MAKEFILE! FIX!!
24
+ if ENV['VIDEO']
25
+ VLC_CFLAGS = '-I/usr/include/vlc'
26
+ VLC_LIB = '-llibvlc'
27
+ else
28
+ VLC_CFLAGS = VLC_LIB = ''
29
+ end
30
+
31
+ LINUX_CFLAGS = %[-Wall -I#{ENV['SHOES_DEPS_PATH'] || "/usr"}/include #{CAIRO_CFLAGS} #{PANGO_CFLAGS} #{VLC_CFLAGS} -I#{Config::CONFIG['archdir']}]
32
+ if Config::CONFIG['rubyhdrdir']
33
+ LINUX_CFLAGS << " -I#{Config::CONFIG['rubyhdrdir']} -I#{Config::CONFIG['rubyhdrdir']}/#{RUBY_PLATFORM}"
34
+ end
35
+
36
+ LINUX_LIB_NAMES = %W[#{RUBY_SO} cairo pangocairo-1.0 gif]
37
+
38
+ FLAGS.each do |flag|
39
+ LINUX_CFLAGS << " -D#{flag}" if ENV[flag]
40
+ end
41
+
42
+ if ENV['DEBUG']
43
+ LINUX_CFLAGS << " -g -O0 "
44
+ else
45
+ LINUX_CFLAGS << " -O "
46
+ end
47
+ LINUX_CFLAGS << " -DRUBY_1_9" if RUBY_1_9
48
+
49
+ DLEXT = "dylib"
50
+ LINUX_CFLAGS << " -DSHOES_QUARTZ -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -fpascal-strings #{Config::CONFIG["CFLAGS"]} -x objective-c -fobjc-exceptions"
51
+ LINUX_LDFLAGS = "-framework Cocoa -framework Carbon -dynamiclib -Wl,-single_module #{Config::CONFIG["LDFLAGS"]} INSTALL_NAME"
52
+ LINUX_LIB_NAMES << 'pixman-1' << 'jpeg.8'
53
+
54
+ if ENV['VIDEO']
55
+ if VLC_0_8
56
+ LINUX_CFLAGS << " -DVLC_0_8"
57
+ end
58
+ vlc_dir = "./deps/lib/vlc"
59
+ vlc_deps = IO.readlines("make/darwin/deps.vlc").map(&:chomp)
60
+ LINUX_LDFLAGS << " ./deps/lib/libvlc.a "
61
+ LINUX_LDFLAGS << vlc_deps.map {|a| "#{vlc_dir}/#{a}"}.join(" ")
62
+ LINUX_LDFLAGS << " -framework vecLib -lpthread -lm -liconv -lintl -liconv -lc -lpostproc -lavformat -lavcodec -lz -la52 -lfaac -lfaad -lmp3lame -lx264 -lxvidcore -lvorbisenc -lavutil -lvorbis -lm -logg -lm -lavformat -lavcodec -lz -la52 -lfaac -lfaad -lmp3lame -lx264 -lxvidcore -lvorbisenc -lavutil -lvorbis -lm -logg -framework QuickTime -lm -framework CoreAudio -framework AudioUnit -framework AudioToolbox -framework IOKit -lobjc -ObjC -framework OpenGL -framework AGL -read_only_relocs suppress"
63
+ end
64
+ if ENV['UNIVERSAL']
65
+ LINUX_CFLAGS << " -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc"
66
+ LINUX_LDFLAGS << " -arch i386 -arch ppc"
67
+ ENV['MACOSX_DEPLOYMENT_TARGET'] = '10.4'
68
+ elsif ENV['PPC']
69
+ LINUX_CFLAGS << " -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch ppc"
70
+ LINUX_LDFLAGS << " -arch ppc"
71
+ ENV['MACOSX_DEPLOYMENT_TARGET'] = '10.4'
72
+ else
73
+ LINUX_CFLAGS << " -isysroot /Developer/SDKs/MacOSX10.6.sdk -arch x86_64"
74
+ LINUX_LDFLAGS << " -arch x86_64"
75
+ ENV['MACOSX_DEPLOYMENT_TARGET'] = '10.6'
76
+ end
77
+
78
+ LINUX_LIBS = LINUX_LIB_NAMES.map { |x| "-l#{x}" }.join(' ')
79
+
80
+ LINUX_LIBS << " -L#{Config::CONFIG['libdir']} #{CAIRO_LIB} #{PANGO_LIB} #{VLC_LIB}"
81
+
@@ -0,0 +1,105 @@
1
+ require File.expand_path('make/make')
2
+
3
+ include FileUtils
4
+
5
+ class MakeDarwin
6
+ extend Make
7
+
8
+ class << self
9
+ def copy_ext xdir, libdir
10
+ Dir.chdir(xdir) do
11
+ `ruby extconf.rb; make`
12
+ end
13
+ copy_files "#{xdir}/*.bundle", libdir
14
+ end
15
+
16
+ def copy_deps_to_dist
17
+ if ENV['SHOES_DEPS_PATH']
18
+ dylibs = IO.readlines("make/darwin/dylibs.shoes").map(&:chomp)
19
+ if ENV['VIDEO']
20
+ dylibs += IO.readlines("make/darwin/dylibs.video").map(&:chomp)
21
+ end
22
+ dylibs.each do |libn|
23
+ cp "#{ENV['SHOES_DEPS_PATH']}/#{libn}", "dist/"
24
+ end.each do |libn|
25
+ next unless libn =~ %r!^lib/(.+?\.dylib)$!
26
+ libf = $1
27
+ sh "install_name_tool -id /tmp/dep/#{libn} dist/#{libf}"
28
+ ["dist/#{NAME}-bin", *Dir['dist/*.dylib']].each do |lib2|
29
+ sh "install_name_tool -change /tmp/dep/#{libn} @executable_path/#{libf} #{lib2}"
30
+ end
31
+ end
32
+ if ENV['VIDEO']
33
+ mkdir_p "dist/plugins"
34
+ sh "cp -r deps/lib/vlc/**/*.dylib dist/plugins"
35
+ sh "strip -x dist/*.dylib"
36
+ sh "strip -x dist/plugins/*.dylib"
37
+ sh "strip -x dist/ruby/lib/**/*.bundle"
38
+ end
39
+ end
40
+ end
41
+
42
+ def setup_system_resources
43
+ rm_rf "#{APPNAME}.app"
44
+ mkdir "#{APPNAME}.app"
45
+ mkdir "#{APPNAME}.app/Contents"
46
+ cp_r "dist", "#{APPNAME}.app/Contents/MacOS"
47
+ mkdir "#{APPNAME}.app/Contents/Resources"
48
+ mkdir "#{APPNAME}.app/Contents/Resources/English.lproj"
49
+ sh "ditto \"#{APP['icons']['osx']}\" \"#{APPNAME}.app/App.icns\""
50
+ sh "ditto \"#{APP['icons']['osx']}\" \"#{APPNAME}.app/Contents/Resources/App.icns\""
51
+ rewrite "platform/mac/Info.plist", "#{APPNAME}.app/Contents/Info.plist"
52
+ cp "platform/mac/version.plist", "#{APPNAME}.app/Contents/"
53
+ rewrite "platform/mac/pangorc", "#{APPNAME}.app/Contents/MacOS/pangorc"
54
+ cp "platform/mac/command-manual.rb", "#{APPNAME}.app/Contents/MacOS/"
55
+ rewrite "platform/mac/shoes-launch", "#{APPNAME}.app/Contents/MacOS/#{NAME}-launch"
56
+ chmod 0755, "#{APPNAME}.app/Contents/MacOS/#{NAME}-launch"
57
+ chmod 0755, "#{APPNAME}.app/Contents/MacOS/#{NAME}-bin"
58
+ rewrite "platform/mac/shoes", "#{APPNAME}.app/Contents/MacOS/#{NAME}"
59
+ chmod 0755, "#{APPNAME}.app/Contents/MacOS/#{NAME}"
60
+ # cp InfoPlist.strings YourApp.app/Contents/Resources/English.lproj/
61
+ `echo -n 'APPL????' > "#{APPNAME}.app/Contents/PkgInfo"`
62
+ end
63
+
64
+ def make_stub
65
+ ENV['MACOSX_DEPLOYMENT_TARGET'] = '10.4'
66
+ sh "gcc -O -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc -framework Cocoa -o stub platform/mac/stub.m -I."
67
+ end
68
+
69
+ def make_app(name)
70
+ bin = "#{name}-bin"
71
+ rm_f name
72
+ rm_f bin
73
+ sh "#{CC} -Ldist -o #{bin} bin/main.o #{LINUX_LIBS} -lshoes -arch x86_64"
74
+ end
75
+
76
+ def make_so(name)
77
+ ldflags = LINUX_LDFLAGS.sub! /INSTALL_NAME/, "-install_name @executable_path/lib#{SONAME}.#{DLEXT}"
78
+ sh "#{CC} -o #{name} #{OBJ.join(' ')} #{LINUX_LDFLAGS} #{LINUX_LIBS}"
79
+ %w[libpostproc.dylib libavformat.dylib libavcodec.dylib libavutil.dylib libruby.dylib].each do |libn|
80
+ sh "install_name_tool -change /tmp/dep/lib/#{libn} ./deps/lib/#{libn} #{name}"
81
+ end
82
+ end
83
+
84
+ def make_installer
85
+ dmg_ds, dmg_jpg = "platform/mac/dmg_ds_store", "static/shoes-dmg.jpg"
86
+ if APP['dmg']
87
+ dmg_ds, dmg_jpg = APP['dmg']['ds_store'], APP['dmg']['background']
88
+ end
89
+
90
+ mkdir_p "pkg"
91
+ rm_rf "dmg"
92
+ mkdir_p "dmg"
93
+ cp_r "#{APPNAME}.app", "dmg"
94
+ unless ENV['APP']
95
+ mv "dmg/#{APPNAME}.app/Contents/MacOS/samples", "dmg/samples"
96
+ end
97
+ ln_s "/Applications", "dmg/Applications"
98
+ sh "chmod +x dmg/\"#{APPNAME}.app\"/Contents/MacOS/#{NAME}"
99
+ sh "chmod +x dmg/\"#{APPNAME}.app\"/Contents/MacOS/#{NAME}-bin"
100
+ sh "chmod +x dmg/\"#{APPNAME}.app\"/Contents/MacOS/#{NAME}-launch"
101
+ sh "DYLD_LIBRARY_PATH= platform/mac/pkg-dmg --target pkg/#{PKG}.dmg --source dmg --volname '#{APPNAME}' --copy #{dmg_ds}:/.DS_Store --mkdir /.background --copy #{dmg_jpg}:/.background" # --format UDRW"
102
+ rm_rf "dmg"
103
+ end
104
+ end
105
+ end
@@ -0,0 +1,65 @@
1
+ EXT_RUBY = File.exists?("deps/ruby") ? "deps/ruby" : Config::CONFIG['prefix']
2
+
3
+ # use the platform Ruby claims
4
+ require 'rbconfig'
5
+
6
+ CC = ENV['CC'] ? ENV['CC'] : "gcc"
7
+ file_list = ["shoes/*.c"] + %w{shoes/native/gtk.c shoes/http/curl.c}
8
+
9
+ SRC = FileList[*file_list]
10
+ OBJ = SRC.map do |x|
11
+ x.gsub(/\.\w+$/, '.o')
12
+ end
13
+
14
+ ADD_DLL = []
15
+
16
+ # Linux build environment
17
+ CAIRO_CFLAGS = ENV['CAIRO_CFLAGS'] || `pkg-config --cflags cairo`.strip
18
+ CAIRO_LIB = ENV['CAIRO_LIB'] ? "-L#{ENV['CAIRO_LIB']}" : `pkg-config --libs cairo`.strip
19
+ PANGO_CFLAGS = ENV['PANGO_CFLAGS'] || `pkg-config --cflags pango`.strip
20
+ PANGO_LIB = ENV['PANGO_LIB'] ? "-L#{ENV['PANGO_LIB']}" : `pkg-config --libs pango`.strip
21
+ png_lib = 'png'
22
+
23
+ if ENV['VIDEO']
24
+ VLC_CFLAGS = '-I/usr/include/vlc'
25
+ VLC_LIB = '-llibvlc'
26
+ else
27
+ VLC_CFLAGS = VLC_LIB = ''
28
+ end
29
+
30
+ LINUX_CFLAGS = %[-Wall -I#{ENV['SHOES_DEPS_PATH'] || "/usr"}/include #{CAIRO_CFLAGS} #{PANGO_CFLAGS} #{VLC_CFLAGS} -I#{Config::CONFIG['archdir']}]
31
+ if Config::CONFIG['rubyhdrdir']
32
+ LINUX_CFLAGS << " -I#{Config::CONFIG['rubyhdrdir']} -I#{Config::CONFIG['rubyhdrdir']}/#{RUBY_PLATFORM}"
33
+ end
34
+
35
+ LINUX_LIB_NAMES = %W[#{RUBY_SO} cairo pangocairo-1.0 ungif]
36
+
37
+ FLAGS.each do |flag|
38
+ LINUX_CFLAGS << " -D#{flag}" if ENV[flag]
39
+ end
40
+
41
+ if ENV['DEBUG']
42
+ LINUX_CFLAGS << " -g -O0 "
43
+ else
44
+ LINUX_CFLAGS << " -O "
45
+ end
46
+ LINUX_CFLAGS << " -DRUBY_1_9" if RUBY_1_9
47
+
48
+ DLEXT = "so"
49
+ LINUX_CFLAGS << " -DSHOES_GTK -fPIC #{`pkg-config --cflags gtk+-2.0`.strip} #{`curl-config --cflags`.strip}"
50
+ LINUX_LDFLAGS =" #{`pkg-config --libs gtk+-2.0`.strip} #{`curl-config --libs`.strip} -fPIC -shared"
51
+ LINUX_LIB_NAMES << 'jpeg'
52
+ LINUX_LIB_NAMES << 'rt'
53
+
54
+ if ENV['VIDEO']
55
+ if VLC_0_8
56
+ LINUX_CFLAGS << " -DVLC_0_8"
57
+ else
58
+ LINUX_CFLAGS << " -I/usr/include/vlc/plugins"
59
+ end
60
+ LINUX_LIB_NAMES << "vlc"
61
+ end
62
+
63
+ LINUX_LIBS = LINUX_LIB_NAMES.map { |x| "-l#{x}" }.join(' ')
64
+
65
+ LINUX_LIBS << " -L#{Config::CONFIG['libdir']} #{CAIRO_LIB} #{PANGO_LIB} #{VLC_LIB}"
@@ -0,0 +1,61 @@
1
+ require File.expand_path('make/make')
2
+
3
+ include FileUtils
4
+
5
+ class MakeLinux
6
+ extend Make
7
+
8
+ class << self
9
+ def copy_ext xdir, libdir
10
+ Dir.chdir(xdir) do
11
+ unless system "ruby", "extconf.rb" and system "make"
12
+ raise "Extension build failed"
13
+ end
14
+ end
15
+ copy_files "#{xdir}/*.so", libdir
16
+ end
17
+
18
+ def copy_deps_to_dist
19
+ cp "#{::EXT_RUBY}/lib/lib#{::RUBY_SO}.so", "dist/lib#{::RUBY_SO}.so"
20
+ ln_s "lib#{::RUBY_SO}.so", "dist/lib#{::RUBY_SO}.so.#{::RUBY_V[/^\d+\.\d+/]}"
21
+ cp "/usr/lib/libgif.so", "dist/libgif.so.4"
22
+ ln_s "libgif.so.4", "dist/libungif.so.4"
23
+ cp "/usr/lib/libjpeg.so", "dist/libjpeg.so.8"
24
+ cp "/usr/lib/libcurl.so", "dist/libcurl.so.4"
25
+ cp "/usr/lib/libportaudio.so", "dist/libportaudio.so.2"
26
+ cp "/usr/lib/libsqlite3.so", "dist/libsqlite3.so.0"
27
+
28
+ if ENV['VIDEO']
29
+ cp "/usr/lib/libvlc.so", "dist"
30
+ ln_s "libvlc.so", "dist/libvlc.so.0"
31
+ end
32
+
33
+ sh "strip -x dist/*.so.*"
34
+ sh "strip -x dist/*.so"
35
+ end
36
+
37
+ def setup_system_resources
38
+ cp APP['icons']['gtk'], "dist/static/app-icon.png"
39
+ end
40
+
41
+ def make_app(name)
42
+ bin = "#{name}-bin"
43
+ rm_f name
44
+ rm_f bin
45
+ sh "#{CC} -Ldist -o #{bin} bin/main.o #{LINUX_LIBS} -lshoes #{Config::CONFIG['LDFLAGS']}"
46
+ rewrite "platform/nix/shoes.launch", name, %r!/shoes-bin!, "/#{NAME}-bin"
47
+ sh %{echo 'cd "$OLDPWD"\nLD_LIBRARY_PATH=$APPPATH $APPPATH/#{File.basename(bin)} "$@"' >> #{name}}
48
+ chmod 0755, name
49
+ end
50
+
51
+ def make_so(name)
52
+ ldflags = LINUX_LDFLAGS.sub! /INSTALL_NAME/, "-install_name @executable_path/lib#{SONAME}.#{DLEXT}"
53
+ sh "#{CC} -o #{name} #{OBJ.join(' ')} #{LINUX_LDFLAGS} #{LINUX_LIBS}"
54
+ end
55
+
56
+ def make_installer
57
+ mkdir_p "pkg"
58
+ sh "makeself dist pkg/#{PKG}.run '#{APPNAME}' ./#{NAME}"
59
+ end
60
+ end
61
+ end
@@ -0,0 +1,85 @@
1
+ module Make
2
+ include FileUtils
3
+
4
+ def copy_files_to_dist
5
+ if ENV['APP']
6
+ if APP['clone']
7
+ sh APP['clone'].gsub(/^git /, "#{GIT} --git-dir=#{ENV['APP']}/.git ")
8
+ else
9
+ cp_r ENV['APP'], "dist/app"
10
+ end
11
+ if APP['ignore']
12
+ APP['ignore'].each do |nn|
13
+ rm_rf "dist/app/#{nn}"
14
+ end
15
+ end
16
+ end
17
+
18
+ cp_r "fonts", "dist/fonts"
19
+ cp_r "lib", "dist/lib"
20
+ cp_r "samples", "dist/samples"
21
+ cp_r "static", "dist/static"
22
+ cp "README.md", "dist/README.txt"
23
+ cp "CHANGELOG", "dist/CHANGELOG.txt"
24
+ cp "COPYING", "dist/COPYING.txt"
25
+ end
26
+
27
+ def cc(t)
28
+ sh "#{CC} -I. -c -o#{t.name} #{LINUX_CFLAGS} #{t.source}"
29
+ end
30
+
31
+ # Subs in special variables
32
+ def rewrite before, after, reg = /\#\{(\w+)\}/, reg2 = '\1'
33
+ File.open(after, 'w') do |a|
34
+ File.open(before) do |b|
35
+ b.each do |line|
36
+ a << line.gsub(reg) do
37
+ if reg2.include? '\1'
38
+ reg2.gsub(%r!\\1!, Object.const_get($1))
39
+ else
40
+ reg2
41
+ end
42
+ end
43
+ end
44
+ end
45
+ end
46
+ end
47
+
48
+ def copy_files glob, dir
49
+ FileList[glob].each { |f| cp_r f, dir }
50
+ end
51
+
52
+ def common_build
53
+ mkdir_p "dist/ruby"
54
+ cp_r "#{EXT_RUBY}/lib/ruby/#{RUBY_V}", "dist/ruby/lib"
55
+ unless ENV['STANDARD']
56
+ %w[soap wsdl xsd].each do |libn|
57
+ rm_rf "dist/ruby/lib/#{libn}"
58
+ end
59
+ end
60
+ %w[req/ftsearch/lib/* req/rake/lib/*].each do |rdir|
61
+ FileList[rdir].each { |rlib| cp_r rlib, "dist/ruby/lib" }
62
+ end
63
+ %w[req/binject/ext/binject_c req/ftsearch/ext/ftsearchrt req/bloopsaphone/ext/bloops req/chipmunk/ext/chipmunk].
64
+ each { |xdir| copy_ext xdir, "dist/ruby/lib/#{RUBY_PLATFORM}" }
65
+
66
+ gdir = "dist/ruby/gems/#{RUBY_V}"
67
+ {'hpricot' => 'lib', 'json' => 'lib/json/ext', 'sqlite3' => 'lib'}.each do |gemn, xdir|
68
+ spec = eval(File.read("req/#{gemn}/gemspec"))
69
+ mkdir_p "#{gdir}/specifications"
70
+ mkdir_p "#{gdir}/gems/#{spec.full_name}/lib"
71
+ FileList["req/#{gemn}/lib/*"].each { |rlib| cp_r rlib, "#{gdir}/gems/#{spec.full_name}/lib" }
72
+ mkdir_p "#{gdir}/gems/#{spec.full_name}/#{xdir}"
73
+ FileList["req/#{gemn}/ext/*"].each { |elib| copy_ext elib, "#{gdir}/gems/#{spec.full_name}/#{xdir}" }
74
+ cp "req/#{gemn}/gemspec", "#{gdir}/specifications/#{spec.full_name}.gemspec"
75
+ end
76
+ end
77
+
78
+ # Check the environment
79
+ def env(x)
80
+ unless ENV[x]
81
+ abort "Your #{x} environment variable is not set!"
82
+ end
83
+ ENV[x]
84
+ end
85
+ end