fxruby 1.6.22-x86-mingw32 → 1.6.23-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (203) hide show
  1. data/.gitignore +14 -0
  2. data/.yardopts +8 -0
  3. data/History.txt +6 -0
  4. data/Manifest.txt +317 -24
  5. data/README.git +3 -0
  6. data/README.rdoc +537 -0
  7. data/Rakefile +62 -46
  8. data/Rakefile.cross +397 -0
  9. data/doap.rdf +3 -3
  10. data/doap.rdf.erb +87 -0
  11. data/examples/WhatAQuietStiff.rb +356 -0
  12. data/examples/canvasdemo.rb +88 -0
  13. data/examples/gdchart.rb +76 -0
  14. data/examples/gembrowser.rb +289 -0
  15. data/examples/rmagick.rb +44 -0
  16. data/lib/1.8/fox16.so +0 -0
  17. data/lib/1.9/fox16.so +0 -0
  18. data/lib/fox16/canvas.rb +606 -0
  19. data/lib/fox16/irb.rb +1 -0
  20. data/lib/fox16/splashscreen.rb +1 -0
  21. data/lib/fox16/tkcompat.rb +56 -0
  22. data/lib/fox16/version.rb +1 -1
  23. data/rdoc-sources/FX4Splitter.rb +44 -44
  24. data/rdoc-sources/FX7Segment.rb +3 -3
  25. data/rdoc-sources/FXAccelTable.rb +1 -1
  26. data/rdoc-sources/FXApp.rb +51 -51
  27. data/rdoc-sources/FXArrowButton.rb +6 -6
  28. data/rdoc-sources/FXBMPIcon.rb +12 -12
  29. data/rdoc-sources/FXBMPImage.rb +6 -6
  30. data/rdoc-sources/FXBitmap.rb +9 -9
  31. data/rdoc-sources/FXBitmapFrame.rb +3 -3
  32. data/rdoc-sources/FXBitmapView.rb +12 -12
  33. data/rdoc-sources/FXButton.rb +5 -5
  34. data/rdoc-sources/FXCanvas.rb +4 -4
  35. data/rdoc-sources/FXCheckButton.rb +7 -7
  36. data/rdoc-sources/FXChoiceBox.rb +16 -16
  37. data/rdoc-sources/FXColorBar.rb +9 -9
  38. data/rdoc-sources/FXColorDialog.rb +4 -4
  39. data/rdoc-sources/FXColorList.rb +1 -1
  40. data/rdoc-sources/FXColorRing.rb +4 -4
  41. data/rdoc-sources/FXColorSelector.rb +38 -38
  42. data/rdoc-sources/FXColorWell.rb +15 -15
  43. data/rdoc-sources/FXColorWheel.rb +8 -8
  44. data/rdoc-sources/FXComboBox.rb +24 -24
  45. data/rdoc-sources/FXCursor.rb +12 -12
  46. data/rdoc-sources/FXDC.rb +176 -176
  47. data/rdoc-sources/FXDCPrint.rb +20 -20
  48. data/rdoc-sources/FXDCWindow.rb +2 -2
  49. data/rdoc-sources/FXDataTarget.rb +1 -1
  50. data/rdoc-sources/FXDebugTarget.rb +1 -1
  51. data/rdoc-sources/FXDelegator.rb +2 -2
  52. data/rdoc-sources/FXDial.rb +9 -9
  53. data/rdoc-sources/FXDialogBox.rb +3 -3
  54. data/rdoc-sources/FXDict.rb +2 -3
  55. data/rdoc-sources/FXDirBox.rb +2 -2
  56. data/rdoc-sources/FXDirList.rb +14 -14
  57. data/rdoc-sources/FXDirSelector.rb +14 -14
  58. data/rdoc-sources/FXDockBar.rb +35 -35
  59. data/rdoc-sources/FXDockHandler.rb +2 -2
  60. data/rdoc-sources/FXDockSite.rb +11 -11
  61. data/rdoc-sources/FXDockTitle.rb +2 -2
  62. data/rdoc-sources/FXDocument.rb +2 -2
  63. data/rdoc-sources/FXDragCorner.rb +2 -2
  64. data/rdoc-sources/FXDrawable.rb +5 -5
  65. data/rdoc-sources/FXDriveBox.rb +3 -3
  66. data/rdoc-sources/FXFileDialog.rb +24 -24
  67. data/rdoc-sources/FXFileDict.rb +11 -11
  68. data/rdoc-sources/FXFileList.rb +25 -25
  69. data/rdoc-sources/FXFileSelector.rb +31 -31
  70. data/rdoc-sources/FXFileStream.rb +3 -3
  71. data/rdoc-sources/FXFoldingList.rb +76 -76
  72. data/rdoc-sources/FXFont.rb +133 -133
  73. data/rdoc-sources/FXFontDialog.rb +1 -1
  74. data/rdoc-sources/FXFontSelector.rb +14 -14
  75. data/rdoc-sources/FXFrame.rb +5 -5
  76. data/rdoc-sources/FXGIFCursor.rb +6 -6
  77. data/rdoc-sources/FXGIFIcon.rb +6 -6
  78. data/rdoc-sources/FXGIFImage.rb +5 -5
  79. data/rdoc-sources/FXGLContext.rb +1 -1
  80. data/rdoc-sources/FXGLObject.rb +8 -8
  81. data/rdoc-sources/FXGLShape.rb +23 -23
  82. data/rdoc-sources/FXGLViewer.rb +51 -51
  83. data/rdoc-sources/FXGLVisual.rb +1 -0
  84. data/rdoc-sources/FXGradientBar.rb +31 -31
  85. data/rdoc-sources/FXGroupBox.rb +6 -6
  86. data/rdoc-sources/FXHeader.rb +30 -33
  87. data/rdoc-sources/FXHorizontalFrame.rb +12 -12
  88. data/rdoc-sources/FXICOIcon.rb +14 -14
  89. data/rdoc-sources/FXICOImage.rb +5 -5
  90. data/rdoc-sources/FXIcon.rb +7 -7
  91. data/rdoc-sources/FXIconDict.rb +1 -0
  92. data/rdoc-sources/FXIconList.rb +60 -60
  93. data/rdoc-sources/FXId.rb +1 -1
  94. data/rdoc-sources/FXImage.rb +49 -49
  95. data/rdoc-sources/FXImageFrame.rb +12 -12
  96. data/rdoc-sources/FXImageView.rb +10 -10
  97. data/rdoc-sources/FXInputDialog.rb +4 -4
  98. data/rdoc-sources/FXJPGIcon.rb +13 -13
  99. data/rdoc-sources/FXJPGImage.rb +5 -5
  100. data/rdoc-sources/FXKnob.rb +12 -12
  101. data/rdoc-sources/FXLabel.rb +3 -3
  102. data/rdoc-sources/FXList.rb +31 -31
  103. data/rdoc-sources/FXListBox.rb +7 -7
  104. data/rdoc-sources/FXMDIChild.rb +24 -24
  105. data/rdoc-sources/FXMDIClient.rb +1 -1
  106. data/rdoc-sources/FXMatrix.rb +2 -2
  107. data/rdoc-sources/FXMemoryBuffer.rb +1 -1
  108. data/rdoc-sources/FXMemoryStream.rb +1 -1
  109. data/rdoc-sources/FXMenuButton.rb +20 -19
  110. data/rdoc-sources/FXMenuCaption.rb +9 -9
  111. data/rdoc-sources/FXMenuCascade.rb +1 -1
  112. data/rdoc-sources/FXMenuCheck.rb +2 -2
  113. data/rdoc-sources/FXMenuCommand.rb +1 -1
  114. data/rdoc-sources/FXMenuRadio.rb +2 -2
  115. data/rdoc-sources/FXMenuSeparator.rb +2 -2
  116. data/rdoc-sources/FXMenuTitle.rb +5 -5
  117. data/rdoc-sources/FXMessageBox.rb +16 -16
  118. data/rdoc-sources/FXOptionMenu.rb +14 -14
  119. data/rdoc-sources/FXPCXIcon.rb +12 -12
  120. data/rdoc-sources/FXPCXImage.rb +5 -5
  121. data/rdoc-sources/FXPNGIcon.rb +12 -12
  122. data/rdoc-sources/FXPNGImage.rb +5 -5
  123. data/rdoc-sources/FXPPMIcon.rb +6 -6
  124. data/rdoc-sources/FXPPMImage.rb +5 -5
  125. data/rdoc-sources/FXPacker.rb +4 -4
  126. data/rdoc-sources/FXPopup.rb +5 -5
  127. data/rdoc-sources/FXPrintDialog.rb +21 -21
  128. data/rdoc-sources/FXProgressBar.rb +10 -10
  129. data/rdoc-sources/FXProgressDialog.rb +3 -3
  130. data/rdoc-sources/FXQuatd.rb +19 -19
  131. data/rdoc-sources/FXQuatf.rb +23 -23
  132. data/rdoc-sources/FXRGBIcon.rb +13 -13
  133. data/rdoc-sources/FXRGBImage.rb +5 -5
  134. data/rdoc-sources/FXRadioButton.rb +10 -10
  135. data/rdoc-sources/FXRanged.rb +2 -2
  136. data/rdoc-sources/FXRangef.rb +2 -2
  137. data/rdoc-sources/FXRealSlider.rb +33 -33
  138. data/rdoc-sources/FXRealSpinner.rb +31 -31
  139. data/rdoc-sources/FXRecentFiles.rb +14 -14
  140. data/rdoc-sources/FXRectangle.rb +22 -22
  141. data/rdoc-sources/FXRegistry.rb +3 -3
  142. data/rdoc-sources/FXReplaceDialog.rb +20 -20
  143. data/rdoc-sources/FXRootWindow.rb +2 -2
  144. data/rdoc-sources/FXRuler.rb +28 -28
  145. data/rdoc-sources/FXRulerView.rb +5 -5
  146. data/rdoc-sources/FXScrollArea.rb +27 -27
  147. data/rdoc-sources/FXScrollBar.rb +26 -26
  148. data/rdoc-sources/FXScrollPane.rb +3 -3
  149. data/rdoc-sources/FXScrollWindow.rb +6 -6
  150. data/rdoc-sources/FXSearchDialog.rb +8 -8
  151. data/rdoc-sources/FXSeparator.rb +24 -24
  152. data/rdoc-sources/FXSettings.rb +44 -44
  153. data/rdoc-sources/FXShutter.rb +35 -35
  154. data/rdoc-sources/FXSize.rb +14 -14
  155. data/rdoc-sources/FXSlider.rb +33 -33
  156. data/rdoc-sources/FXSphered.rb +2 -2
  157. data/rdoc-sources/FXSpheref.rb +2 -2
  158. data/rdoc-sources/FXSpinner.rb +30 -30
  159. data/rdoc-sources/FXSplashWindow.rb +5 -5
  160. data/rdoc-sources/FXSplitter.rb +18 -18
  161. data/rdoc-sources/FXSpring.rb +15 -15
  162. data/rdoc-sources/FXStatusBar.rb +14 -14
  163. data/rdoc-sources/FXStatusLine.rb +7 -7
  164. data/rdoc-sources/FXStream.rb +20 -20
  165. data/rdoc-sources/FXSwitcher.rb +23 -23
  166. data/rdoc-sources/FXTGAIcon.rb +12 -12
  167. data/rdoc-sources/FXTGAImage.rb +5 -5
  168. data/rdoc-sources/FXTIFIcon.rb +13 -13
  169. data/rdoc-sources/FXTIFImage.rb +5 -5
  170. data/rdoc-sources/FXTabBar.rb +31 -31
  171. data/rdoc-sources/FXTabBook.rb +13 -13
  172. data/rdoc-sources/FXTabItem.rb +22 -22
  173. data/rdoc-sources/FXTable.rb +148 -148
  174. data/rdoc-sources/FXText.rb +91 -91
  175. data/rdoc-sources/FXTextField.rb +39 -39
  176. data/rdoc-sources/FXToggleButton.rb +32 -32
  177. data/rdoc-sources/FXToolBar.rb +25 -25
  178. data/rdoc-sources/FXToolBarGrip.rb +12 -12
  179. data/rdoc-sources/FXToolBarShell.rb +13 -13
  180. data/rdoc-sources/FXToolBarTab.rb +16 -16
  181. data/rdoc-sources/FXTopWindow.rb +18 -18
  182. data/rdoc-sources/FXTranslator.rb +1 -1
  183. data/rdoc-sources/FXTreeList.rb +66 -66
  184. data/rdoc-sources/FXTreeListBox.rb +20 -20
  185. data/rdoc-sources/FXTriStateButton.rb +23 -23
  186. data/rdoc-sources/FXVec2d.rb +1 -1
  187. data/rdoc-sources/FXVec2f.rb +1 -1
  188. data/rdoc-sources/FXVec3d.rb +1 -1
  189. data/rdoc-sources/FXVec3f.rb +1 -1
  190. data/rdoc-sources/FXVec4d.rb +1 -1
  191. data/rdoc-sources/FXVec4f.rb +1 -1
  192. data/rdoc-sources/FXVerticalFrame.rb +12 -12
  193. data/rdoc-sources/FXVisual.rb +19 -19
  194. data/rdoc-sources/FXWindow.rb +96 -96
  195. data/rdoc-sources/FXWizard.rb +9 -9
  196. data/rdoc-sources/FXXBMIcon.rb +7 -7
  197. data/rdoc-sources/FXXBMImage.rb +6 -6
  198. data/rdoc-sources/FXXPMIcon.rb +13 -13
  199. data/rdoc-sources/FXXPMImage.rb +5 -5
  200. data/rdoc-sources/Makefile +3 -3
  201. metadata +44 -31
  202. data/README +0 -39
  203. data/README.txt +0 -483
data/Rakefile CHANGED
@@ -5,15 +5,53 @@ require 'rake/extensiontask'
5
5
  require './lib/fox16/version.rb'
6
6
  load 'Rakefile.cross'
7
7
 
8
+ # Use forked process for chdir'ed environment, to allow parallel execution with drake
9
+ module FileUtils
10
+ alias old_fileutils_cd cd
11
+ def cd(dir, options={}, &block)
12
+ raise "forked_chdir called without block" unless block_given?
13
+ Process.waitpid(fork{ old_fileutils_cd(dir, options, &block) })
14
+ end
15
+ module_function :cd
16
+ alias chdir cd
17
+ module_function :chdir
18
+ end
19
+
8
20
  # Some constants we'll need
9
21
  PKG_VERSION = Fox.fxrubyversion
10
22
  FXSCINTILLA_INSTALL_DIR = Pathname( "build/builds/fxscintilla-#{LIBFXSCINTILLA_VERSION}" ).expand_path
11
23
 
24
+ SWIG = (RUBY_PLATFORM =~ /mingw/) ? "swig-1.3.22.exe" : "swig-1.3.22"
25
+ SWIGFLAGS = "-fcompact -noruntime -c++ -ruby -no_default -I../fox-includes"
26
+ SWIG_LIB = `#{SWIG} -swiglib`.chomp
27
+ SWIG_MODULES = {
28
+ "core.i" => "core_wrap.cpp",
29
+ "dcmodule.i" => "dc_wrap.cpp",
30
+ "dialogs.i" => "dialogs_wrap.cpp",
31
+ "framesmodule.i" => "frames_wrap.cpp",
32
+ "iconlistmodule.i" => "iconlist_wrap.cpp",
33
+ "icons.i" => "icons_wrap.cpp",
34
+ "image.i" => "image_wrap.cpp",
35
+ "labelmodule.i" => "label_wrap.cpp",
36
+ "layout.i" => "layout_wrap.cpp",
37
+ "listmodule.i" => "list_wrap.cpp",
38
+ "mdi.i" => "mdi_wrap.cpp",
39
+ "menumodule.i" => "menu_wrap.cpp",
40
+ "fx3d.i" => "fx3d_wrap.cpp",
41
+ "scintilla.i" => "scintilla_wrap.cpp",
42
+ "table-module.i" => "table_wrap.cpp",
43
+ "text-module.i" => "text_wrap.cpp",
44
+ "treelist-module.i" => "treelist_wrap.cpp",
45
+ "ui.i" => "ui_wrap.cpp"
46
+ }
47
+
48
+
12
49
  hoe = Hoe.spec "fxruby" do
13
50
  # ... project specific data ...
14
51
  self.blog_categories = %w{FXRuby}
15
52
  self.clean_globs = [".config", "ext/fox16/Makefile", "ext/fox16/*.o", "ext/fox16/*.bundle", "ext/fox16/mkmf.log", "ext/fox16/conftest.dSYM", "ext/fox16/include/swigrubyrun.h"]
16
53
  developer("Lyle Johnson", "lyle@lylejohnson.name")
54
+ developer("Lars Kanis", "kanis@comcard.de")
17
55
  self.extra_rdoc_files = ["rdoc-sources", File.join("rdoc-sources", "README.rdoc")]
18
56
  self.remote_rdoc_dir = "doc/api"
19
57
  self.spec_extras = {
@@ -25,6 +63,15 @@ hoe = Hoe.spec "fxruby" do
25
63
  }
26
64
  self.test_globs = ["test/**/TC_*.rb"]
27
65
  self.version = PKG_VERSION
66
+ self.readme_file = 'README.rdoc'
67
+ self.extra_rdoc_files << self.readme_file
68
+
69
+ spec_extras[:files] = File.read_utf("Manifest.txt").split(/\r?\n\r?/).reject{|f| f=~/^fox-includes|^web/ }
70
+ spec_extras[:files] += SWIG_MODULES.values.map{|f| File.join("ext/fox16", f) }
71
+ spec_extras[:files] << 'ext/fox16/include/inlinestubs.h'
72
+ spec_extras[:files] << 'ext/fox16/librb.c'
73
+ spec_extras[:files] << 'doap.rdf'
74
+ spec_extras[:files] << 'lib/fox16/kwargs.rb'
28
75
  end
29
76
 
30
77
  # Make sure extension is built before tests are run
@@ -58,34 +105,6 @@ end
58
105
  # c:/ruby-1.8.6-p383-preview2/devkit/msys/1.0.11/usr/local/share/swig/1.3.22
59
106
  # before running swig on MinGW.
60
107
  namespace :swig do
61
- SWIG = (RUBY_PLATFORM =~ /mingw/) ? "swig-1.3.22.exe" : "swig-1.3.22"
62
- SWIGFLAGS = "-fcompact -noruntime -c++ -ruby -no_default -I../fox-includes"
63
- SWIG_LIB = `#{SWIG} -swiglib`.chomp
64
- SWIG_MODULES = {
65
- "core.i" => "core_wrap.cpp",
66
- "dcmodule.i" => "dc_wrap.cpp",
67
- "dialogs.i" => "dialogs_wrap.cpp",
68
- "framesmodule.i" => "frames_wrap.cpp",
69
- "iconlistmodule.i" => "iconlist_wrap.cpp",
70
- "icons.i" => "icons_wrap.cpp",
71
- "image.i" => "image_wrap.cpp",
72
- "labelmodule.i" => "label_wrap.cpp",
73
- "layout.i" => "layout_wrap.cpp",
74
- "listmodule.i" => "list_wrap.cpp",
75
- "mdi.i" => "mdi_wrap.cpp",
76
- "menumodule.i" => "menu_wrap.cpp",
77
- "fx3d.i" => "fx3d_wrap.cpp",
78
- "scintilla.i" => "scintilla_wrap.cpp",
79
- "table-module.i" => "table_wrap.cpp",
80
- "text-module.i" => "text_wrap.cpp",
81
- "treelist-module.i" => "treelist_wrap.cpp",
82
- "ui.i" => "ui_wrap.cpp"
83
- }
84
-
85
- def wrapper_src_file_path(wrapper_src_file_name)
86
- File.join("..", "ext", "fox16", wrapper_src_file_name)
87
- end
88
-
89
108
  def sed(wrapper_src_file_name)
90
109
  results = []
91
110
  IO.readlines(wrapper_src_file_name).each do |line|
@@ -104,20 +123,21 @@ namespace :swig do
104
123
  end
105
124
 
106
125
  def swig(swig_interface_file_name, wrapper_src_file_name)
107
- system "#{SWIG} #{SWIGFLAGS} -o #{wrapper_src_file_path(wrapper_src_file_name)} #{swig_interface_file_name}"
108
- sed wrapper_src_file_path(wrapper_src_file_name)
126
+ cmd = "#{SWIG} #{SWIGFLAGS} -o #{wrapper_src_file_name} #{swig_interface_file_name}"
127
+ puts cmd
128
+ system cmd
129
+ sed wrapper_src_file_name
109
130
  end
110
131
 
111
132
  task :swig_librb => ["ext/fox16/librb.c"]
112
- file "ext/fox16/librb.c" do
113
- Dir.chdir "swig-interfaces" do
114
- File.open(wrapper_src_file_path("librb.c"), "w") do |io|
115
- io.puts "#define SWIG_GLOBAL 1"
116
- io.write(IO.read(File.join(SWIG_LIB, "ruby", "precommon.swg")))
117
- io.write(IO.read(File.join(SWIG_LIB, "common.swg")))
118
- io.write(IO.read(File.join(SWIG_LIB, "ruby", "rubyhead.swg")))
119
- io.write(IO.read(File.join(SWIG_LIB, "ruby", "rubydef.swg")))
120
- end
133
+ file "ext/fox16/librb.c" do |task|
134
+ puts "generate #{task.name}"
135
+ File.open(task.name, "w") do |io|
136
+ io.puts "#define SWIG_GLOBAL 1"
137
+ io.write(IO.read(File.join(SWIG_LIB, "ruby", "precommon.swg")))
138
+ io.write(IO.read(File.join(SWIG_LIB, "common.swg")))
139
+ io.write(IO.read(File.join(SWIG_LIB, "ruby", "rubyhead.swg")))
140
+ io.write(IO.read(File.join(SWIG_LIB, "ruby", "rubydef.swg")))
121
141
  end
122
142
  end
123
143
 
@@ -130,10 +150,8 @@ namespace :swig do
130
150
 
131
151
  file cppfile_path => [ifile, 'macros.i', 'common.i', 'fxdefs.i', 'ruby-typemaps.i',
132
152
  'markfuncs.i', 'exceptions.i', 'freefuncs.i', 'macros.i', 'handlers.i'
133
- ].map{|f| File.join("swig-interfaces", f) } do
134
- Dir.chdir "swig-interfaces" do
135
- swig(ifile, cppfile)
136
- end
153
+ ].map{|f| File.join("swig-interfaces", f) } do |task|
154
+ swig(File.join("swig-interfaces", ifile), cppfile_path)
137
155
  end
138
156
  end
139
157
  end
@@ -171,9 +189,7 @@ namespace :fxruby do
171
189
  end
172
190
 
173
191
  def make_impl
174
- Dir.chdir "ext/fox16" do
175
- ruby "make_impl.rb"
176
- end
192
+ ruby '-Cext/fox16', "make_impl.rb"
177
193
  end
178
194
 
179
195
  task :configure => [:scintilla, :setversions, :generate_kwargs_lib]
data/Rakefile.cross ADDED
@@ -0,0 +1,397 @@
1
+ # -*- coding: utf-8 -*-
2
+ # -*- ruby -*-
3
+
4
+ require 'rubygems'
5
+ require 'hoe'
6
+ require 'rake/extensiontask'
7
+ require 'rake/extensioncompiler'
8
+ require 'uri'
9
+ require 'rbconfig'
10
+ require 'pathname'
11
+
12
+ ENV['RUBY_CC_VERSION'] ||= '1.8.7:1.9.2'
13
+
14
+ # Cross-compilation constants
15
+ COMPILE_HOME = Pathname( "build" ).expand_path
16
+ STATIC_SOURCESDIR = COMPILE_HOME + 'sources'
17
+ STATIC_BUILDDIR = COMPILE_HOME + 'builds'
18
+ STATIC_INSTALLDIR = COMPILE_HOME + 'install'
19
+ RUBY_BUILD = RbConfig::CONFIG["host"]
20
+ CROSS_PREFIX = begin
21
+ Rake::ExtensionCompiler.mingw_host
22
+ rescue => err
23
+ $stderr.puts "Cross-compilation disabled -- %s" % [ err.message ]
24
+ 'unknown'
25
+ end
26
+
27
+ NUM_CPUS = if File.exist?('/proc/cpuinfo')
28
+ File.read('/proc/cpuinfo').scan('processor').length
29
+ elsif RUBY_PLATFORM.include?( 'darwin' )
30
+ `system_profiler SPHardwareDataType | grep 'Cores' | awk '{print $5}'`.chomp
31
+ else
32
+ 1
33
+ end
34
+
35
+
36
+ # Fetch zlib tarball
37
+ LIBZ_VERSION = ENV['LIBZ_VERSION'] || '1.2.5'
38
+ LIBZ_SOURCE_URI = URI( "http://downloads.sourceforge.net/project/libpng/zlib/#{LIBZ_VERSION}/zlib-#{LIBZ_VERSION}.tar.bz2" )
39
+ LIBZ_TARBALL = STATIC_SOURCESDIR + File.basename( LIBZ_SOURCE_URI.path )
40
+ STATIC_LIBZ_BUILDDIR = STATIC_BUILDDIR + LIBZ_TARBALL.basename(".tar.bz2")
41
+ LIBZ_MAKEFILE = STATIC_LIBZ_BUILDDIR + 'Makefile'
42
+ LIBZ_A = STATIC_INSTALLDIR + 'lib' + 'libz.a'
43
+
44
+ # Fetch libpng tarball
45
+ LIBPNG_VERSION = ENV['LIBPNG_VERSION'] || '1.5.4'
46
+ LIBPNG_SOURCE_URI = URI( "http://prdownloads.sourceforge.net/libpng/libpng-#{LIBPNG_VERSION}.tar.gz?download" )
47
+ LIBPNG_TARBALL = STATIC_SOURCESDIR + File.basename( LIBPNG_SOURCE_URI.path )
48
+ STATIC_LIBPNG_BUILDDIR = STATIC_BUILDDIR + LIBPNG_TARBALL.basename(".tar.gz")
49
+ LIBPNG_MAKEFILE = STATIC_LIBPNG_BUILDDIR + 'Makefile'
50
+ LIBPNG_A = STATIC_INSTALLDIR + 'lib' + 'libpng.a'
51
+
52
+
53
+ # Fetch libjpeg tarball
54
+ LIBJPEG_VERSION = ENV['LIBJPEG_VERSION'] || '8c'
55
+ LIBJPEG_SOURCE_URI = URI( "http://www.ijg.org/files/jpegsrc.v#{LIBJPEG_VERSION}.tar.gz" )
56
+ LIBJPEG_TARBALL = STATIC_SOURCESDIR + File.basename( LIBJPEG_SOURCE_URI.path )
57
+ STATIC_LIBJPEG_BUILDDIR = STATIC_BUILDDIR + "jpeg-#{LIBJPEG_VERSION}"
58
+ LIBJPEG_MAKEFILE = STATIC_LIBJPEG_BUILDDIR + 'Makefile'
59
+ LIBJPEG_A = STATIC_INSTALLDIR + 'lib' + 'libjpeg.a'
60
+
61
+
62
+ # Fetch libtiff tarball
63
+ LIBTIFF_VERSION = ENV['LIBTIFF_VERSION'] || '3.9.5'
64
+ LIBTIFF_SOURCE_URI = URI( "http://download.osgeo.org/libtiff/tiff-#{LIBTIFF_VERSION}.tar.gz" )
65
+ LIBTIFF_TARBALL = STATIC_SOURCESDIR + File.basename( LIBTIFF_SOURCE_URI.path )
66
+ STATIC_LIBTIFF_BUILDDIR = STATIC_BUILDDIR + LIBTIFF_TARBALL.basename(".tar.gz")
67
+ LIBTIFF_MAKEFILE = STATIC_LIBTIFF_BUILDDIR + 'Makefile'
68
+ LIBTIFF_A = STATIC_INSTALLDIR + 'lib' + 'libtiff.a'
69
+
70
+
71
+ # Fetch libfox tarball
72
+ LIBFOX_VERSION = ENV['LIBFOX_VERSION'] || '1.6.44'
73
+ LIBFOX_SOURCE_URI = URI( "http://ftp.fox-toolkit.org/pub/fox-#{LIBFOX_VERSION}.tar.gz" )
74
+ LIBFOX_TARBALL = STATIC_SOURCESDIR + File.basename( LIBFOX_SOURCE_URI.path )
75
+ STATIC_LIBFOX_BUILDDIR = STATIC_BUILDDIR + LIBFOX_TARBALL.basename(".tar.gz")
76
+ LIBFOX_MAKEFILE = STATIC_LIBFOX_BUILDDIR + 'Makefile'
77
+ LIBFOX_A = STATIC_INSTALLDIR + 'lib' + 'libfox.a'
78
+
79
+ # Fetch fxscintilla tarball
80
+ LIBFXSCINTILLA_VERSION = ENV['LIBFXSCINTILLA_VERSION'] || '2.28.0'
81
+ LIBFXSCINTILLA_SOURCE_URI = URI( "http://download.savannah.gnu.org/releases/fxscintilla/fxscintilla-#{LIBFXSCINTILLA_VERSION}.tar.gz" )
82
+ LIBFXSCINTILLA_TARBALL = STATIC_SOURCESDIR + File.basename( LIBFXSCINTILLA_SOURCE_URI.path )
83
+ STATIC_LIBFXSCINTILLA_BUILDDIR = STATIC_BUILDDIR + LIBFXSCINTILLA_TARBALL.basename(".tar.gz")
84
+ LIBFXSCINTILLA_MAKEFILE = STATIC_LIBFXSCINTILLA_BUILDDIR + 'Makefile'
85
+ LIBFXSCINTILLA_A = STATIC_INSTALLDIR + 'lib' + 'libfxscintilla.a'
86
+
87
+
88
+
89
+ # clean intermediate files and folders
90
+ CLEAN.include( STATIC_BUILDDIR.to_s )
91
+
92
+ #####################################################################
93
+ ### C R O S S - C O M P I L A T I O N - T A S K S
94
+ #####################################################################
95
+
96
+ directory STATIC_SOURCESDIR.to_s
97
+
98
+ #
99
+ # Static libz build tasks
100
+ #
101
+ directory STATIC_LIBZ_BUILDDIR.to_s
102
+
103
+ # libz source file should be stored there
104
+ file LIBZ_TARBALL => STATIC_SOURCESDIR do |t|
105
+ # download the source file using wget or curl
106
+ chdir File.dirname(t.name) do
107
+ sh "wget '#{LIBZ_SOURCE_URI}' -O #{LIBZ_TARBALL}"
108
+ end
109
+ end
110
+
111
+ # Extract the libz builds
112
+ file STATIC_LIBZ_BUILDDIR => LIBZ_TARBALL do |t|
113
+ sh 'tar', '-xjf', LIBZ_TARBALL.to_s, '-C', STATIC_LIBZ_BUILDDIR.parent.to_s
114
+ rm LIBZ_MAKEFILE
115
+ end
116
+
117
+ LIBZ_ENV = [
118
+ "CC=#{CROSS_PREFIX}-gcc",
119
+ "AR=#{CROSS_PREFIX}-ar",
120
+ "RANLIB=#{CROSS_PREFIX}-ranlib",
121
+ ]
122
+
123
+ # generate the makefile in a clean build location
124
+ file LIBZ_MAKEFILE => [STATIC_LIBZ_BUILDDIR] do |t|
125
+ chdir( STATIC_LIBZ_BUILDDIR ) do
126
+ options = [
127
+ "--prefix=#{STATIC_INSTALLDIR}",
128
+ ]
129
+
130
+ configure_path = STATIC_LIBZ_BUILDDIR + 'configure'
131
+ sh "env #{[LIBZ_ENV, configure_path.to_s, *options].join(" ")}"
132
+ end
133
+ end
134
+
135
+ # generate the makefile in a clean build location
136
+ task LIBZ_A => LIBZ_MAKEFILE do |t|
137
+ chdir( STATIC_LIBZ_BUILDDIR ) do
138
+ sh "make -j#{NUM_CPUS} install 'LDSHAREDLIBC=-lmsvcrt'"
139
+ end
140
+ end
141
+
142
+ #
143
+ # Static libpng build tasks
144
+ #
145
+ directory STATIC_LIBPNG_BUILDDIR.to_s
146
+
147
+ # libpng source file should be stored there
148
+ file LIBPNG_TARBALL => STATIC_SOURCESDIR do |t|
149
+ # download the source file using wget or curl
150
+ chdir File.dirname(t.name) do
151
+ sh "wget '#{LIBPNG_SOURCE_URI}' -O #{LIBPNG_TARBALL}"
152
+ end
153
+ end
154
+
155
+ # Extract the libpng builds
156
+ file STATIC_LIBPNG_BUILDDIR => LIBPNG_TARBALL do |t|
157
+ sh 'tar', '-xzf', LIBPNG_TARBALL.to_s, '-C', STATIC_LIBPNG_BUILDDIR.parent.to_s
158
+ end
159
+
160
+ LIBPNG_ENV = [
161
+ "'CPPFLAGS=-I#{STATIC_INSTALLDIR}/include'",
162
+ "'LDFLAGS=-L#{STATIC_INSTALLDIR}/lib'",
163
+ ]
164
+ # generate the makefile in a clean build location
165
+ file LIBPNG_MAKEFILE => [STATIC_LIBPNG_BUILDDIR, LIBZ_A] do |t|
166
+ chdir( STATIC_LIBPNG_BUILDDIR ) do
167
+ options = [
168
+ "--target=#{CROSS_PREFIX}",
169
+ "--host=#{CROSS_PREFIX}",
170
+ "--build=#{RUBY_BUILD}",
171
+ "--prefix=#{STATIC_INSTALLDIR}",
172
+ "--disable-shared",
173
+ ]
174
+
175
+ configure_path = STATIC_LIBPNG_BUILDDIR + 'configure'
176
+ sh "env #{[LIBPNG_ENV, configure_path.to_s, *options].join(" ")}"
177
+ end
178
+ end
179
+
180
+ # generate the makefile in a clean build location
181
+ task LIBPNG_A => [LIBPNG_MAKEFILE, LIBZ_A] do |t|
182
+ chdir( STATIC_LIBPNG_BUILDDIR ) do
183
+ sh "make -j#{NUM_CPUS} install"
184
+ end
185
+ end
186
+
187
+ #
188
+ # Static libjpeg build tasks
189
+ #
190
+ directory STATIC_LIBJPEG_BUILDDIR.to_s
191
+
192
+ # libjpeg source file should be stored there
193
+ file LIBJPEG_TARBALL => STATIC_SOURCESDIR do |t|
194
+ # download the source file using wget or curl
195
+ chdir File.dirname(t.name) do
196
+ sh "wget '#{LIBJPEG_SOURCE_URI}' -O #{LIBJPEG_TARBALL}"
197
+ end
198
+ end
199
+
200
+ # Extract the libjpeg builds
201
+ file STATIC_LIBJPEG_BUILDDIR => LIBJPEG_TARBALL do |t|
202
+ sh 'tar', '-xzf', LIBJPEG_TARBALL.to_s, '-C', STATIC_LIBJPEG_BUILDDIR.parent.to_s
203
+ end
204
+
205
+ # generate the makefile in a clean build location
206
+ file LIBJPEG_MAKEFILE => STATIC_LIBJPEG_BUILDDIR do |t|
207
+ chdir( STATIC_LIBJPEG_BUILDDIR ) do
208
+ options = [
209
+ "--target=#{CROSS_PREFIX}",
210
+ "--host=#{CROSS_PREFIX}",
211
+ "--build=#{RUBY_BUILD}",
212
+ "--prefix=#{STATIC_INSTALLDIR}",
213
+ "--disable-shared",
214
+ ]
215
+
216
+ configure_path = STATIC_LIBJPEG_BUILDDIR + 'configure'
217
+ cmd = [ configure_path.to_s, *options ]
218
+ sh *cmd
219
+ end
220
+ end
221
+
222
+ # build libjpeg.a
223
+ task LIBJPEG_A => [LIBJPEG_MAKEFILE] do |t|
224
+ chdir( STATIC_LIBJPEG_BUILDDIR ) do
225
+ sh "make -j#{NUM_CPUS} install"
226
+ end
227
+ end
228
+
229
+ #
230
+ # Static libtiff build tasks
231
+ #
232
+ directory STATIC_LIBTIFF_BUILDDIR.to_s
233
+
234
+ # libtiff source file should be stored there
235
+ file LIBTIFF_TARBALL => STATIC_SOURCESDIR do |t|
236
+ # download the source file using wget or curl
237
+ chdir File.dirname(t.name) do
238
+ sh "wget '#{LIBTIFF_SOURCE_URI}' -O #{LIBTIFF_TARBALL}"
239
+ end
240
+ end
241
+
242
+ # Extract the libtiff builds
243
+ file STATIC_LIBTIFF_BUILDDIR => LIBTIFF_TARBALL do |t|
244
+ sh 'tar', '-xzf', LIBTIFF_TARBALL.to_s, '-C', STATIC_LIBTIFF_BUILDDIR.parent.to_s
245
+ end
246
+
247
+ LIBTIFF_ENV = [
248
+ "'CPPFLAGS=-I#{STATIC_INSTALLDIR}/include'",
249
+ "'LDFLAGS=-L#{STATIC_INSTALLDIR}/lib'",
250
+ ]
251
+
252
+ # generate the makefile in a clean build location
253
+ file LIBTIFF_MAKEFILE => [STATIC_LIBTIFF_BUILDDIR, LIBJPEG_A, LIBZ_A] do |t|
254
+ chdir( STATIC_LIBTIFF_BUILDDIR ) do
255
+ options = [
256
+ "--target=#{CROSS_PREFIX}",
257
+ "--host=#{CROSS_PREFIX}",
258
+ "--build=#{RUBY_BUILD}",
259
+ "--prefix=#{STATIC_INSTALLDIR}",
260
+ "--disable-shared",
261
+ "--with-zlib-include-dir=#{STATIC_LIBZ_BUILDDIR}",
262
+ "--with-zlib-lib-dir=#{File.dirname(LIBZ_A)}",
263
+ "--with-jpeg-include-dir=#{STATIC_LIBJPEG_BUILDDIR}",
264
+ "--with-jpeg-lib-dir=#{File.dirname(LIBJPEG_A)}",
265
+ ]
266
+
267
+ configure_path = STATIC_LIBTIFF_BUILDDIR + 'configure'
268
+ sh "env #{[LIBTIFF_ENV, configure_path.to_s, *options].join(" ")}"
269
+ end
270
+ end
271
+
272
+ # build libtiff.a
273
+ task LIBTIFF_A => [LIBTIFF_MAKEFILE] do |t|
274
+ chdir( STATIC_LIBTIFF_BUILDDIR ) do
275
+ sh "make -j#{NUM_CPUS} install"
276
+ end
277
+ end
278
+
279
+
280
+ #
281
+ # Static libfox build tasks
282
+ #
283
+ directory STATIC_LIBFOX_BUILDDIR.to_s
284
+
285
+ # libfox source file should be stored there
286
+ file LIBFOX_TARBALL => STATIC_SOURCESDIR do |t|
287
+ # download the source file using wget or curl
288
+ chdir File.dirname(t.name) do
289
+ sh "wget '#{LIBFOX_SOURCE_URI}' -O #{LIBFOX_TARBALL}"
290
+ end
291
+ end
292
+
293
+ # Extract the libfox builds
294
+ file STATIC_LIBFOX_BUILDDIR => LIBFOX_TARBALL do |t|
295
+ sh 'tar', '-xzf', LIBFOX_TARBALL.to_s, '-C', STATIC_LIBFOX_BUILDDIR.parent.to_s
296
+ end
297
+
298
+ LIBFOX_ENV = [
299
+ "'CPPFLAGS=-I#{STATIC_INSTALLDIR}/include'",
300
+ "'LDFLAGS=-L#{STATIC_INSTALLDIR}/lib'",
301
+ ]
302
+
303
+ # generate the makefile in a clean build location
304
+ file LIBFOX_MAKEFILE => [STATIC_LIBFOX_BUILDDIR, LIBJPEG_A, LIBZ_A] do |t|
305
+ chdir( STATIC_LIBFOX_BUILDDIR ) do
306
+ options = [
307
+ "--target=#{CROSS_PREFIX}",
308
+ "--host=#{CROSS_PREFIX}",
309
+ "--build=#{RUBY_BUILD}",
310
+ "--prefix=#{STATIC_INSTALLDIR}",
311
+ "--disable-shared",
312
+ "--without-xft",
313
+ "--without-x",
314
+ ]
315
+
316
+ configure_path = STATIC_LIBFOX_BUILDDIR + 'configure'
317
+ sh "env #{[LIBFOX_ENV, configure_path.to_s, *options].join(" ")}"
318
+ end
319
+ end
320
+
321
+ # build libfox.a
322
+ task LIBFOX_A => [LIBFOX_MAKEFILE] do |t|
323
+ chdir( STATIC_LIBFOX_BUILDDIR ) do
324
+ sh "make -j#{NUM_CPUS} #{FOX_ENV.join(" ")} install"
325
+ end
326
+ end
327
+
328
+
329
+ #
330
+ # Static libfxscintilla build tasks
331
+ #
332
+ directory STATIC_LIBFXSCINTILLA_BUILDDIR.to_s
333
+
334
+ # libfxscintilla source file should be stored there
335
+ file LIBFXSCINTILLA_TARBALL => STATIC_SOURCESDIR do |t|
336
+ # download the source file using wget or curl
337
+ chdir File.dirname(t.name) do
338
+ sh "wget '#{LIBFXSCINTILLA_SOURCE_URI}' -O #{LIBFXSCINTILLA_TARBALL}"
339
+ end
340
+ end
341
+
342
+ # Extract the libfxscintilla builds
343
+ file STATIC_LIBFXSCINTILLA_BUILDDIR => LIBFXSCINTILLA_TARBALL do |t|
344
+ sh 'tar', '-xzf', LIBFXSCINTILLA_TARBALL.to_s, '-C', STATIC_LIBFXSCINTILLA_BUILDDIR.parent.to_s
345
+ end
346
+
347
+ FOX_ENV = [
348
+ "'CFLAGS=-I#{STATIC_INSTALLDIR}/include'",
349
+ "'CPPFLAGS=-I#{STATIC_INSTALLDIR}/include'",
350
+ "'LDFLAGS=-L#{STATIC_INSTALLDIR}/lib'",
351
+ "'FOX_CFLAGS=-I#{STATIC_INSTALLDIR}/include/fox-1.6 -DFOX_1_6'",
352
+ "'FOX_LIBS=-L#{STATIC_INSTALLDIR}/lib -lFOX-1.6'",
353
+ ]
354
+
355
+ # generate the makefile in a clean build location
356
+ file LIBFXSCINTILLA_MAKEFILE => [STATIC_LIBFXSCINTILLA_BUILDDIR, LIBFOX_A] do |t|
357
+ chdir( STATIC_LIBFXSCINTILLA_BUILDDIR ) do
358
+ options = [
359
+ "--target=#{CROSS_PREFIX}",
360
+ "--host=#{CROSS_PREFIX}",
361
+ "--build=#{RUBY_BUILD}",
362
+ "--prefix=#{STATIC_INSTALLDIR}",
363
+ "--disable-shared",
364
+ ]
365
+
366
+ configure_path = STATIC_LIBFXSCINTILLA_BUILDDIR + 'configure'
367
+ sh "env #{[FOX_ENV, configure_path.to_s, *options].join(" ")}"
368
+ end
369
+ end
370
+
371
+ # build libfxscintilla.a
372
+ task LIBFXSCINTILLA_A => [LIBFXSCINTILLA_MAKEFILE] do |t|
373
+ chdir( STATIC_LIBFXSCINTILLA_BUILDDIR ) do
374
+ sh "make -j#{NUM_CPUS} #{FOX_ENV.join(" ")} install"
375
+ end
376
+ end
377
+
378
+
379
+
380
+ desc "compile static libz libraries"
381
+ task :static_libs => [ LIBZ_A, LIBPNG_A, LIBJPEG_A, LIBTIFF_A, LIBFOX_A, LIBFXSCINTILLA_A ]
382
+
383
+ desc 'cross compile required libs for win32'
384
+ task :cross => [ :mingw32, :static_libs ]
385
+
386
+ task :mingw32 do
387
+ # Use Rake::ExtensionCompiler helpers to find the proper host
388
+ unless Rake::ExtensionCompiler.mingw_host then
389
+ warn "You need to install mingw32 cross compile functionality to be able to continue."
390
+ warn "Please refer to your distribution/package manager documentation about installation."
391
+ fail
392
+ end
393
+ ENV['CROSS_PREFIX'] = Rake::ExtensionCompiler.mingw_host
394
+ end
395
+
396
+
397
+ # vim: syntax=ruby