fxruby 1.6.35-x64-mingw32 → 1.6.36-x64-mingw32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,86 +6,18 @@ require 'mkmf'
6
6
  gem 'mini_portile2', '~>2.1'
7
7
  require 'mini_portile2'
8
8
 
9
- def find_installed_fox_version
10
- stddirs = ["/usr/include/fox-1.6",
11
- "/usr/local/include/fox-1.6",
12
- "/sw/include/fox-1.6",
13
- "/opt/local/include/fox-1.6"]
14
- usrdirs = []
15
- ARGV.each do |arg|
16
- if arg =~ /--with-fox-include/
17
- option, value = arg.split('=')
18
- usrdirs = [ value ] + usrdirs
19
- end
20
- end
21
- incdirs = usrdirs + stddirs
22
- incdirs.uniq! # remove duplicates
23
-
24
- incdirs.each do |incdir|
25
- filename = File.join(incdir, "fxver.h")
26
- if FileTest.exist?(filename)
27
- idircflag = "-I" + incdir
28
- $CPPFLAGS += " " + idircflag unless $CPPFLAGS.split.include?(idircflag)
29
- return
30
- end
31
- end
32
-
33
- # Couldn't find it; this should have been caught by the pre-config script
34
- raise RuntimeError, "couldn't find FOX header files"
35
- end
36
-
37
9
  $autodetected_fxscintilla = false
38
10
 
39
- def find_installed_fxscintilla_version
40
- stddirs = ["/usr/include/fxscintilla",
41
- "/usr/local/include/fxscintilla",
42
- "/sw/include/fxscintilla",
43
- "/opt/local/include/fxscintilla"]
44
- usrdirs = []
45
- ARGV.each do |arg|
46
- if arg =~ /--with-fxscintilla-include/
47
- option, value = arg.split('=')
48
- usrdirs = [ value ] + usrdirs
49
- end
50
- end
51
- incdirs = usrdirs + stddirs
52
- incdirs.uniq! # remove duplicates
53
-
54
- incdirs.each do |incdir|
55
- filename = File.join(incdir, "FXScintilla.h")
56
- if FileTest.exist?(filename)
57
- $autodetected_fxscintilla = true
58
- idircflag = "-I" + incdir
59
- $CPPFLAGS += " " + idircflag unless $CPPFLAGS.split.include?(idircflag)
60
- return
61
- end
62
- end
63
- end
64
-
65
11
  def is_fxscintilla_build?
66
12
  # No means no
67
13
  return false if fxscintilla_support_suppressed?
68
14
 
69
15
  # Check arguments
70
- args = ARGV.delete_if { |e| !(e =~ /--with-fxscintilla/) }
71
- (args.length > 0) || $autodetected_fxscintilla
16
+ with_config("fxscintilla", false) || $autodetected_fxscintilla
72
17
  end
73
18
 
74
19
  def fxscintilla_support_suppressed?
75
- ARGV.include? "--without-fxscintilla"
76
- end
77
-
78
- def with_env(hash)
79
- hash.each do |k, v|
80
- ENV[k] = v
81
- end
82
- begin
83
- yield
84
- ensure
85
- hash.each do |k, v|
86
- ENV.delete(k)
87
- end
88
- end
20
+ !with_config("fxscintilla", true)
89
21
  end
90
22
 
91
23
  # Stick at zlib-1.2.7 for compatibility to MSYS1 based RubyInstaller.
@@ -95,7 +27,7 @@ LIBZ_SOURCE_URI = "http://zlib.net/fossils/zlib-#{LIBZ_VERSION}.tar.gz"
95
27
  LIBPNG_VERSION = ENV['LIBPNG_VERSION'] || '1.6.26'
96
28
  LIBPNG_SOURCE_URI = "http://prdownloads.sourceforge.net/libpng/libpng-#{LIBPNG_VERSION}.tar.gz"
97
29
 
98
- LIBJPEG_VERSION = ENV['LIBJPEG_VERSION'] || '8d'
30
+ LIBJPEG_VERSION = ENV['LIBJPEG_VERSION'] || '9b'
99
31
  LIBJPEG_SOURCE_URI = "http://www.ijg.org/files/jpegsrc.v#{LIBJPEG_VERSION}.tar.gz"
100
32
 
101
33
  LIBTIFF_VERSION = ENV['LIBTIFF_VERSION'] || '4.0.7'
@@ -106,17 +38,20 @@ LIBFOX_SOURCE_URI = "http://ftp.fox-toolkit.org/pub/fox-#{LIBFOX_VERSION
106
38
 
107
39
  LIBFXSCINTILLA_VERSION = ENV['LIBFXSCINTILLA_VERSION'] || '2.28.0'
108
40
  LIBFXSCINTILLA_SOURCE_URI = "http://download.savannah.gnu.org/releases/fxscintilla/fxscintilla-#{LIBFXSCINTILLA_VERSION}.tar.gz"
41
+ # LIBFXSCINTILLA_VERSION = ENV['LIBFXSCINTILLA_VERSION'] || '3.5.2'
42
+ # LIBFXSCINTILLA_SOURCE_URI = "https://github.com/yetanothergeek/fxscintilla/archive/FXSCINTILLA-#{LIBFXSCINTILLA_VERSION.gsub(".","_")}.tar.gz"
109
43
 
110
44
 
111
45
  class BuildRecipe < MiniPortile
112
46
  def initialize(name, version, files)
113
47
  super(name, version)
114
48
  self.files = files
115
- self.target = File.expand_path('../../../ports', __FILE__)
49
+ rootdir = File.expand_path('../../..', __FILE__)
50
+ self.target = File.join(rootdir, "ports")
116
51
  # Prefer host_alias over host in order to use i586-mingw32msvc as
117
52
  # correct compiler prefix for cross build, but use host if not set.
118
53
  self.host = consolidated_host(RbConfig::CONFIG["host_alias"].empty? ? RbConfig::CONFIG["host"] : RbConfig::CONFIG["host_alias"])
119
- self.patch_files = Dir[File.join(self.target, "patches", self.name, self.version, "*.diff")].sort
54
+ self.patch_files = Dir[File.join(rootdir, "patches", self.name, self.version, "*.diff")].sort
120
55
  end
121
56
 
122
57
  def consolidated_host(name)
@@ -196,12 +131,11 @@ def do_rake_compiler_setup
196
131
  end
197
132
 
198
133
  libpng_recipe = BuildRecipe.new("libpng", LIBPNG_VERSION, [LIBPNG_SOURCE_URI]).tap do |recipe|
199
- with_env(
200
- 'CPPFLAGS' => "-I#{libz_recipe.path}/include",
201
- 'LDFLAGS' => "-L#{libz_recipe.path}/lib"
202
- ) do
203
- recipe.cook_and_activate
204
- end
134
+ recipe.configure_options += [
135
+ "CPPFLAGS=-I#{libz_recipe.path}/include",
136
+ "LDFLAGS=-L#{libz_recipe.path}/lib",
137
+ ]
138
+ recipe.cook_and_activate
205
139
  end
206
140
 
207
141
  libjpeg_recipe = BuildRecipe.new("libjpeg", LIBJPEG_VERSION, [LIBJPEG_SOURCE_URI]).tap do |recipe|
@@ -213,11 +147,14 @@ def do_rake_compiler_setup
213
147
  end
214
148
 
215
149
  libfox_recipe = BuildRecipe.new("libfox", LIBFOX_VERSION, [LIBFOX_SOURCE_URI]).tap do |recipe|
150
+ debug = enable_config("debug")
216
151
  recipe.configure_options += [
217
152
  "--without-xft",
218
153
  "--without-x",
219
- enable_config("debug") ? "--enable-debug" : "--enable-release",
220
- ]
154
+ debug ? "--enable-debug" : "--enable-release",
155
+ "CPPFLAGS=-I#{libjpeg_recipe.path}/include -I#{libpng_recipe.path}/include -I#{libtiff_recipe.path}/include -I#{libz_recipe.path}/include -DUNICODE=1 #{debug ? "-ggdb" : ""}",
156
+ "LDFLAGS=-L#{libjpeg_recipe.path}/lib -L#{libpng_recipe.path}/lib -L#{libtiff_recipe.path}/lib -L#{libz_recipe.path}/lib #{debug ? "-ggdb" : ""}",
157
+ ]
221
158
  class << recipe
222
159
  def compile
223
160
  # Add param -no-undefined to libtool to build a win32 shared lib
@@ -225,12 +162,7 @@ def do_rake_compiler_setup
225
162
  end
226
163
  end
227
164
 
228
- with_env(
229
- "CPPFLAGS" => "-I#{libjpeg_recipe.path}/include -I#{libpng_recipe.path}/include -I#{libtiff_recipe.path}/include -I#{libz_recipe.path}/include",
230
- "LDFLAGS" => "-L#{libjpeg_recipe.path}/lib -L#{libpng_recipe.path}/lib -L#{libtiff_recipe.path}/lib -L#{libz_recipe.path}/lib"
231
- ) do
232
- recipe.cook_and_activate
233
- end
165
+ recipe.cook_and_activate
234
166
  end
235
167
 
236
168
  libfxscintills_recipe = BuildRecipe.new("libfxscintilla", LIBFXSCINTILLA_VERSION, [LIBFXSCINTILLA_SOURCE_URI]).tap do |recipe|
@@ -240,6 +172,12 @@ def do_rake_compiler_setup
240
172
  "#{ENV['MAKE'] || "make"}"
241
173
  end
242
174
 
175
+ # # This can be uncommented when fxscintilla is used from the source repository.
176
+ # def configure
177
+ # execute "bootstrap", "./bootstrap.sh"
178
+ # super
179
+ # end
180
+
243
181
  def compile
244
182
  execute "compile_lexers", "cd lexers && #{mk}"
245
183
  execute "compile_lexlib", "cd lexlib && #{mk}"
@@ -253,13 +191,11 @@ def do_rake_compiler_setup
253
191
  end
254
192
  recipe.libfox_path = libfox_recipe.path
255
193
 
256
- with_env(
257
- 'PKG_CONFIG_PATH' => "#{libfox_recipe.path}/lib/pkgconfig"
258
- ) do
259
- recipe.cook_and_activate
260
- end
194
+ recipe.configure_options += [
195
+ "PKG_CONFIG_PATH=#{libfox_recipe.path}/lib/pkgconfig",
196
+ ]
197
+ recipe.cook_and_activate
261
198
  end
262
- $autodetected_fxscintilla = true
263
199
 
264
200
  dir_config('libfox', "#{libfox_recipe.path}/include/fox-1.6", "#{libfox_recipe.path}/lib")
265
201
  dir_config('libfxscintilla', "#{libfxscintills_recipe.path}/include/fxscintilla", "#{libfxscintills_recipe.path}/lib")
@@ -277,6 +213,7 @@ def do_rake_compiler_setup
277
213
  CONFIG['CC'] += "\nCXX=#{CONFIG['CXX']}" # Hack CXX into Makefile for cross compilation
278
214
  CONFIG['LDSHARED'].gsub!('gcc', 'g++') # ensure C++ linker is used, so that libstdc++ is linked static
279
215
  $LDFLAGS += " -s" # remove symbol table informations from shared lib
216
+ $libs = append_library($libs, "fxscintilla")
280
217
 
281
218
  elsif RUBY_PLATFORM =~ /mingw/
282
219
  $CFLAGS = $CFLAGS + " -I/usr/local/include"
@@ -306,15 +243,11 @@ def do_rake_compiler_setup
306
243
  $libs = append_library($libs, "FOX-1.6")
307
244
  $INCFLAGS << " -I#{File.join(File.dirname(__FILE__), 'include')}"
308
245
  if is_fxscintilla_build?
309
- FileUtils.move('scintilla_wrap.cpp.bak', 'scintilla_wrap.cpp') if FileTest.exist?('scintilla_wrap.cpp.bak')
310
246
  $CPPFLAGS = $CPPFLAGS + " -DWITH_FXSCINTILLA -DHAVE_FOX_1_6"
311
- find_library("fxscintilla", nil) || find_library(":libfxscintilla.so.19", nil) || ($libs = append_library($libs, "fxscintilla"))
312
- else
313
- FileUtils.move('scintilla_wrap.cpp', 'scintilla_wrap.cpp.bak') if FileTest.exist?('scintilla_wrap.cpp')
314
247
  end
315
248
 
316
249
  checking_for("thread local variables") do
317
- $defs.push( "-DHAVE___THREAD" ) if try_compile(<<-EOT)
250
+ $defs.push( "-DHAVE___THREAD" ) if try_compile <<-EOT
318
251
  __thread int x=1;
319
252
  #if defined(__MINGW32__)
320
253
  #include <windows.h>
@@ -342,7 +275,9 @@ dir_config('fox', '/usr/local/include/fox-1.6', '/usr/local/lib')
342
275
  dir_config('fxscintilla', '/usr/local/include/fxscintilla', '/usr/local/lib')
343
276
 
344
277
  unless enable_config("win32-cross")
345
- find_installed_fox_version
278
+ checking_for "fox per pkg-config" do
279
+ pkg_config("fox")
280
+ end
346
281
 
347
282
  #
348
283
  # Check for FXScintilla header files, unless FXScintilla support has
@@ -350,13 +285,31 @@ unless enable_config("win32-cross")
350
285
  #
351
286
 
352
287
  unless fxscintilla_support_suppressed?
353
- find_installed_fxscintilla_version
288
+ checking_for "fxscintilla per pkg-config" do
289
+ $autodetected_fxscintilla = pkg_config("fxscintilla")
290
+ end
291
+
292
+ unless $autodetected_fxscintilla
293
+ checking_for "fxscintilla on Ubuntu with missing libfxscintilla.so link" do
294
+ if find_library(":libfxscintilla.so.19", nil) && (cflags = RUBY_VERSION>="2.1" ? pkg_config("fxscintilla", "cflags") : `pkg-config --cflags fxscintilla`)
295
+ $CXXFLAGS += " " + cflags
296
+ $autodetected_fxscintilla = true
297
+ end
298
+ end
299
+ end
300
+ end
301
+ checking_for "fxscintilla build" do
302
+ is_fxscintilla_build?
354
303
  end
355
304
  end
356
305
 
357
- unless enable_config("debug")
306
+ if enable_config("debug")
307
+ $CPPFLAGS += " -ggdb"
308
+ $LDFLAGS += " -ggdb"
309
+ else
358
310
  $CPPFLAGS += " -DNDEBUG"
359
311
  end
312
+ $CPPFLAGS += " -Wno-unused-function"
360
313
 
361
314
  # Platform-specific modifications
362
315
  do_rake_compiler_setup
@@ -652,6 +652,8 @@ IMPLEMENT_FXWINDOW_STUBS(FXRbMessageBox)
652
652
  IMPLEMENT_FXTOPWINDOW_STUBS(FXRbMessageBox)
653
653
  IMPLEMENT_FXDIALOGBOX_STUBS(FXRbMessageBox)
654
654
 
655
+ /* Start stub implementations for class FXRbObjRegistry */
656
+
655
657
  /* Start stub implementations for class FXRbObject */
656
658
  IMPLEMENT_FXOBJECT_STUBS(FXRbObject)
657
659
 
@@ -0,0 +1,101 @@
1
+ /***********************************************************************
2
+ * FXRuby -- the Ruby language bindings for the FOX GUI toolkit.
3
+ * Copyright (c) 2017-2017 by Lyle Johnson. All Rights Reserved.
4
+ *
5
+ * This library is free software; you can redistribute it and/or
6
+ * modify it under the terms of the GNU Lesser General Public
7
+ * License as published by the Free Software Foundation; either
8
+ * version 2.1 of the License, or (at your option) any later version.
9
+ *
10
+ * This library is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
+ * Lesser General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Lesser General Public
16
+ * License along with this library; if not, write to the Free Software
17
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18
+ *
19
+ * For further information please contact the author by e-mail
20
+ * at "lars@greiz-reinsdorf.de".
21
+ ***********************************************************************/
22
+
23
+ #ifndef FXRBOBJREGISTRY_H
24
+ #define FXRBOBJREGISTRY_H
25
+
26
+ #include <ruby.h>
27
+ #include "fx.h"
28
+
29
+ extern "C" {
30
+ // Opaque type declaration for SWIG runtime support
31
+ struct swig_type_info;
32
+ }
33
+
34
+ class FXRbObjRegistry {
35
+
36
+ /**
37
+ * The FXRuby_Objects hash table basically maps C++ objects to Ruby instances.
38
+ * Each key in the table is a pointer to a C++ object we've seen before, and
39
+ * the corresponding value is an FXRubyObjDesc struct (see below) that tells
40
+ * us which Ruby instance corresponds to that C++ object.
41
+ */
42
+
43
+ st_table * FXRuby_Objects;
44
+
45
+ /**
46
+ * Each value in the FXRuby_Objects hash table is an instance of this
47
+ * struct. It identifies the Ruby instance associated with a C++ object.
48
+ * It also indicates whether this is merely a "borrowed" reference to
49
+ * some C++ object (i.e. it's not one we need to destroy later).
50
+ *
51
+ * in_gc is set for FXWindows that are in garbage collection and must
52
+ * not call ruby code anymore.
53
+ */
54
+
55
+ enum ObjType { own, borrowed, callback };
56
+
57
+ struct ObjDesc {
58
+ VALUE obj;
59
+ enum ObjType type;
60
+ bool in_gc;
61
+ };
62
+
63
+ const char * safe_rb_obj_classname(VALUE obj);
64
+
65
+ public:
66
+
67
+ FXRbObjRegistry();
68
+
69
+ /**
70
+ * NewBorrowedObj() is a wrapper around SWIG_Ruby_NewPointerObj() that also
71
+ * registers this C++ object & Ruby instance pair in our FXRuby_Objects
72
+ * hash table. This function should only get called for methods that return
73
+ * a reference to an already-existing C++ object (i.e. one that FOX "owns")
74
+ * and for that reason we mark these objects as "borrowed".
75
+ */
76
+ VALUE NewBorrowedObj(void *ptr,swig_type_info* ty);
77
+
78
+ // Register this Ruby class instance
79
+ void RegisterRubyObj(VALUE rubyObj,const void* foxObj);
80
+
81
+ void UnregisterRubyObj(const void* foxObj, bool alsoOwned);
82
+
83
+ /**
84
+ * Return the registered Ruby class instance associated with this
85
+ * FOX object, or Qnil if not found.
86
+ */
87
+ VALUE GetRubyObj(const void *foxObj,bool alsoBorrowed, bool in_gc_mark=false);
88
+
89
+ /**
90
+ * FXRbIsBorrowed() returns true if the specified C++ object is one that
91
+ * FOX owns (i.e. it's borrowed).
92
+ */
93
+ bool IsBorrowed(void* ptr);
94
+
95
+ bool SetInGC(const void* ptr, bool enabled);
96
+ bool IsInGC(const void* ptr);
97
+
98
+ static FXRbObjRegistry main;
99
+ };
100
+
101
+ #endif
@@ -86,7 +86,6 @@ void FXRbRegisterRubyObj(VALUE rubyObj, const void* foxObj);
86
86
  // Remove mapping for this FOX object and zero out any pointers
87
87
  // to this (now dead) C++ object held by any Ruby object
88
88
  void FXRbUnregisterRubyObj(const void* foxObj);
89
- void FXRbUnregisterRubyObj2(const void* foxObj, bool alsoOwned=true);
90
89
  void FXRbUnregisterBorrowedRubyObj(const void* foxObj);
91
90
  void FXRbUnregisterBorrowedRubyObj(FXlong foxObj);
92
91
  void FXRbUnregisterBorrowedRubyObj(FXString& foxObj);
@@ -110,7 +109,7 @@ void FXRbDestroyAppSensitiveObjects();
110
109
  * FOX object (if any). If searchBoth is false, only considers the
111
110
  * Ruby-owned objects; otherwise considers all outstanding references.
112
111
  */
113
- VALUE FXRbGetRubyObj(const void *foxObj, bool searchBoth, bool in_gc=false);
112
+ VALUE FXRbGetRubyObj(const void *foxObj, bool searchBoth, bool in_gc_mark=false);
114
113
 
115
114
  /**
116
115
  * Return the registered Ruby class instance associated with this
@@ -531,7 +531,6 @@ void FXRbTableItem::freefunc(FXTableItem* self){
531
531
 
532
532
 
533
533
  void FXRbTable::markfunc(FXTable* self){
534
- register FXTableItem* item;
535
534
  FXRbScrollArea::markfunc(self);
536
535
  if(self){
537
536
  FXRbGcMark(self->FXTable::getFont());
@@ -539,7 +538,7 @@ void FXRbTable::markfunc(FXTable* self){
539
538
  FXRbGcMark(self->FXTable::getColumnHeaderFont());
540
539
  for(FXint row=0;row<self->FXTable::getNumRows();row++){
541
540
  for(FXint col=0;col<self->FXTable::getNumColumns();col++){
542
- item=self->FXTable::getItem(row,col);
541
+ FXTableItem* item=self->FXTable::getItem(row,col);
543
542
  FXRbGcMark(item);
544
543
  }
545
544
  }
@@ -0,0 +1,53 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'fox16/version'
5
+
6
+ SWIG_MODULES = {
7
+ "core.i" => "core_wrap.cpp",
8
+ "dcmodule.i" => "dc_wrap.cpp",
9
+ "dialogs.i" => "dialogs_wrap.cpp",
10
+ "framesmodule.i" => "frames_wrap.cpp",
11
+ "iconlistmodule.i" => "iconlist_wrap.cpp",
12
+ "icons.i" => "icons_wrap.cpp",
13
+ "image.i" => "image_wrap.cpp",
14
+ "labelmodule.i" => "label_wrap.cpp",
15
+ "layout.i" => "layout_wrap.cpp",
16
+ "listmodule.i" => "list_wrap.cpp",
17
+ "mdi.i" => "mdi_wrap.cpp",
18
+ "menumodule.i" => "menu_wrap.cpp",
19
+ "fx3d.i" => "fx3d_wrap.cpp",
20
+ "scintilla.i" => "scintilla_wrap.cpp",
21
+ "table-module.i" => "table_wrap.cpp",
22
+ "text-module.i" => "text_wrap.cpp",
23
+ "treelist-module.i" => "treelist_wrap.cpp",
24
+ "ui.i" => "ui_wrap.cpp"
25
+ }
26
+
27
+ Gem::Specification.new do |spec|
28
+ spec.name = "fxruby"
29
+ spec.version = Fox.fxrubyversion
30
+ spec.authors = ["Lyle Johnson", "Lars Kanis"]
31
+ spec.email = ["lyle@lylejohnson.name", "lars@greiz-reinsdorf.de"]
32
+
33
+ spec.summary = %q{FXRuby is the Ruby binding to the FOX GUI toolkit.}
34
+ spec.homepage = "http://fxruby.org/"
35
+ spec.license = 'LGPL-2.1'
36
+
37
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
38
+ f=~/^fox-includes|^web/
39
+ end
40
+ spec.files += SWIG_MODULES.values.map{|f| File.join("ext/fox16_c", f) }
41
+ spec.files << 'ext/fox16_c/include/inlinestubs.h'
42
+ spec.files << 'ext/fox16_c/swigruby.h'
43
+ spec.files << 'doap.rdf'
44
+ spec.files << 'lib/fox16/kwargs.rb'
45
+
46
+ spec.bindir = "exe"
47
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
48
+ spec.require_paths = ["lib"]
49
+ spec.extensions = ["ext/fox16_c/extconf.rb"]
50
+ spec.metadata['msys2_mingw_dependencies'] = 'fox'
51
+
52
+ spec.add_runtime_dependency 'mini_portile2', '~> 2.1'
53
+ end