diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 0edf023..0000000 --- a/.gitignore +++ /dev/null @@ -1,26 +0,0 @@ -doap.rdf -*.tmproj -doc/api -users_guide/*.html -ext/fox16_c/*_wrap.cpp -ext/fox16_c/*.o -ext/fox16_c/conftest.dSYM -ext/fox16_c/include/inlinestubs.h -ext/fox16_c/extconf.h -ext/fox16_c/swigruby.h -ext/fox16_c/fox16.bundle -ext/fox16_c/mkmf.log -lib/fox16/kwargs.rb -lib/[0-9].[0-9] -lib/*.so -fox-includes/diffs.py -fox-includes/diffs.txt -pkg -tmp -vendor -*.orig -*.rej -/Gemfile.lock -/ports -/.bundle -/.yardoc diff --git a/History.md b/History.md index dfa9dbd..f773bb4 100755 --- a/History.md +++ b/History.md @@ -1,3 +1,8 @@ +## 1.6.45 / 2022-01-14 + +* Add binary gem support for ruby-3.1 on platform x64-mingw-ucrt and drop ruby-2.3. +* Update to libz-1.2.11, libjpeg-turbo-2.1.2, libtiff-4.3.0 for Windows binary gems. + ## 1.6.44 / 2020-12-31 * Add binary gem support for ruby-3.0. #66 diff --git a/README.rdoc b/README.rdoc index 1e0fcea..7757f77 100644 --- a/README.rdoc +++ b/README.rdoc @@ -3,9 +3,7 @@ * http://github.com/larskanis/fxruby * Full API-description: http://rubydoc.info/gems/fxruby/frames or https://larskanis.github.io/fxruby/ * Latest fxruby {Gem Version}[http://badge.fury.io/rb/fxruby] -* Status on Linux: {Build Status on Linux}[https://travis-ci.com/larskanis/fxruby] - on Windows: {Build Status on Windows}[https://ci.appveyor.com/project/larskanis/fxruby/branch/1.6] - +* CI-Status: {Build Status}[https://github.com/larskanis/fxruby/actions/workflows/ci.yml] and on Windows: {Build Status on Windows}[https://ci.appveyor.com/project/larskanis/fxruby/branch/1.6] == DESCRIPTION: @@ -34,11 +32,16 @@ FXRuby runs on Linux, Windows and OS-X with Ruby-2.2 or newer. Installation on Unix requires FOX development headers and libraries installed: * on Debian/Ubuntu: sudo apt-get install g++ libxrandr-dev libfox-1.6-dev +* on Mac: sudo port install rb-fxruby OR brew install fox && brew install xquartz +* on Windows: the binary fxruby gems already contain all required libraries * see also detailed installation instructions in the {Wiki}[https://github.com/lylejohnson/fxruby/wiki] -* on Windows: the binary fxruby gems already contain all required libararies Then, install the gem: * gem install fxruby + +On Mac, before running applications, you must also run: open -a /Applications/Utilities/XQuartz.app + +(otherwise, you end up getting this message when running applications on Mac: FXRbApp::openDisplay: unable to open display :0.0) == DIRECTORIES The directory structure is: diff --git a/Rakefile b/Rakefile index 8e3b7ae..2f8cf5a 100755 --- a/Rakefile +++ b/Rakefile @@ -92,7 +92,7 @@ ext_task = Rake::ExtensionTask.new("fox16_c", gem_spec) do |ext| ext.cross_compile = true - ext.cross_platform = ['x86-mingw32', 'x64-mingw32'] + ext.cross_platform = ['x86-mingw32', 'x64-mingw-ucrt', 'x64-mingw32'] # Enable FXTRACE and FXASSERT for 'rake compile' ext.config_options << "--enable-debug" @@ -109,6 +109,7 @@ platform_host_map = { 'x86-mingw32' => ['i686-w64-mingw32'], + 'x64-mingw-ucrt' => ['x86_64-w64-mingw32'], 'x64-mingw32' => ['x86_64-w64-mingw32'], } @@ -117,7 +118,7 @@ gcc_shared_dlls = %w[libwinpthread-1.dll libgcc_s_dw2-1.dll libgcc_s_sjlj-1.dll libgcc_s_seh-1.dll libstdc++-6.dll] - dlls = gcc_shared_dlls.select{|dll| File.exist?("ports/#{host}/bin/#{dll}") } + dlls = gcc_shared_dlls.select{|dll| File.exist?("ports/#{gemplat}/bin/#{dll}") } dlls += [ "libfxscintilla-20.dll", "libFOX-1.6-0.dll", @@ -127,11 +128,11 @@ "zlib1.dll", ] - spec.files += dlls.map{|dll| "ports/#{host}/bin/#{dll}" } + spec.files += dlls.map{|dll| "ports/#{gemplat}/bin/#{dll}" } unless ENV['FXRUBY_MINGW_DEBUG'] dlls.each do |dll| - task "ports/#{host}/bin/#{dll}" do |t| + task "ports/#{gemplat}/bin/#{dll}" do |t| sh "#{host}-strip", t.name end end @@ -204,6 +205,21 @@ line.gsub! /rb_ensure\(VALUEFUNC\((.*)\), self, VALUEFUNC\((.*)\), self\);/, 'rb_ensure(RUBY_VALUE_METHOD_FUNC(\\1), self, RUBY_VALUE_METHOD_FUNC(\\2), self);' line.gsub! /rb_rescue\(RUBY_METHOD_FUNC\((.*)\), \(VALUE\)a, RUBY_METHOD_FUNC\((.*)\), 0\)/, 'rb_rescue(RUBY_VALUE_METHOD_FUNC(\\1), (VALUE)a, RUBY_VALUE_METHOD_FUNC(\\2), 0)' + # Allow Truffleruby-22.1.0 to compile the sources without fxscintilla. + # Unfortunately Truffleruby still fails with various runtime errors. + if RUBY_ENGINE == "truffleruby" + line.gsub! '#include ', <<-EOT + #include + #define rb_define_virtual_variable(x,y,z) + EOT + line.gsub!('rb_define_class("swig_runtime_data", rb_cObject);', 'rb_define_class("SWIG_RUNTIME_DATA", rb_cObject);') + line.gsub! 'rb_define_readonly_variable("$swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, &swig_runtime_data_type_pointer);', <<-EOT + if (rb_gv_get("$swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME) == RUBY_Qnil) { + rb_gv_set("$swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, swig_runtime_data_type_pointer); + } + EOT + end + line end diff --git a/appveyor.yml b/appveyor.yml index cb6d0dc..3b91cb6 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -3,8 +3,7 @@ clone_depth: 1 init: - - SET PATH=c:/Ruby%ruby_version%/bin;c:/msys64/%MSYSTEM%/bin;%PATH% - - SET RAKEOPT=-rdevkit + - SET PATH=c:/Ruby%ruby_version%/bin;%PATH% install: - ps: | if ($env:ruby_version -like "*head*") { @@ -14,11 +13,13 @@ - ruby --version - gem --version - ridk version + - ridk enable # Remove gcc-ada and gcc-objc, since they are no longer supported by msys2 and therefore cause a dependency issue - c:/msys64/usr/bin/bash -lc "pacman --noconfirm --remove mingw-w64-i686-gcc-ada mingw-w64-i686-gcc-objc mingw-w64-x86_64-gcc-ada mingw-w64-x86_64-gcc-objc" - c:/msys64/usr/bin/bash -lc "pacman -Syu --noconfirm --ask 20" - c:/msys64/usr/bin/bash -lc "pacman -Su --noconfirm" - - c:/msys64/usr/bin/bash -lc "pacman -S --noconfirm --needed ${MINGW_PACKAGE_PREFIX}-fox ${MINGW_PACKAGE_PREFIX}-swig" + - c:/msys64/usr/bin/bash -lc "pacman -S --noconfirm --needed ${MINGW_PACKAGE_PREFIX}-fox ${MINGW_PACKAGE_PREFIX}-swig ${MINGW_PACKAGE_PREFIX}-gcc" + - gcc -v - swig -version - gem install bundler --conservative - bundle config set force_ruby_platform true @@ -30,8 +31,4 @@ environment: matrix: - ruby_version: "head-x64" - MINGW_PACKAGE_PREFIX: "mingw-w64-x86_64" - MSYSTEM: "MINGW64" - ruby_version: "24" - MINGW_PACKAGE_PREFIX: "mingw-w64-i686" - MSYSTEM: "MINGW32" diff --git a/ext/fox16_c/extconf.rb b/ext/fox16_c/extconf.rb index 5b13f97..0920590 100755 --- a/ext/fox16_c/extconf.rb +++ b/ext/fox16_c/extconf.rb @@ -20,8 +20,7 @@ !with_config("fxscintilla", true) end -# Stick at zlib-1.2.7 for compatibility to MSYS1 based RubyInstaller. -LIBZ_VERSION = ENV['LIBZ_VERSION'] || '1.2.7.3' +LIBZ_VERSION = ENV['LIBZ_VERSION'] || '1.2.11' LIBZ_SOURCE_URI = "http://zlib.net/fossils/zlib-#{LIBZ_VERSION}.tar.gz" LIBPNG_VERSION = ENV['LIBPNG_VERSION'] || '1.6.37' @@ -30,10 +29,10 @@ # LIBJPEG_VERSION = ENV['LIBJPEG_VERSION'] || '9b' # LIBJPEG_SOURCE_URI = "http://www.ijg.org/files/jpegsrc.v#{LIBJPEG_VERSION}.tar.gz" -LIBJPEG_VERSION = ENV['LIBJPEG_VERSION'] || '2.0.6' +LIBJPEG_VERSION = ENV['LIBJPEG_VERSION'] || '2.1.2' LIBJPEG_SOURCE_URI = "https://downloads.sourceforge.net/libjpeg-turbo/libjpeg-turbo-#{LIBJPEG_VERSION}.tar.gz" -LIBTIFF_VERSION = ENV['LIBTIFF_VERSION'] || '4.1.0' +LIBTIFF_VERSION = ENV['LIBTIFF_VERSION'] || '4.3.0' LIBTIFF_SOURCE_URI = "http://download.osgeo.org/libtiff/tiff-#{LIBTIFF_VERSION}.tar.gz" LIBFOX_VERSION = ENV['LIBFOX_VERSION'] || '1.6.57' @@ -55,7 +54,7 @@ end def port_path - "#{target}/#{host}" + "#{target}/#{RUBY_PLATFORM}" end # When using rake-compiler-dock on Windows, the underlying Virtualbox shared @@ -69,7 +68,7 @@ end def cook_and_activate - checkpoint = File.join(self.target, "#{self.name}-#{self.version}-#{self.host}.installed") + checkpoint = File.join(self.target, "#{self.name}-#{self.version}-#{RUBY_PLATFORM}.installed") unless File.exist?(checkpoint) chdir_for_build do self.cook @@ -178,7 +177,7 @@ "--without-xft", "--without-x", debug ? "--enable-debug" : "--enable-release", - "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" : ""}", + "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" : ""} -D__USE_MINGW_ANSI_STDIO=1 -DHAVE_VSSCANF", "LDFLAGS=-L#{libjpeg_recipe.path}/lib -L#{libpng_recipe.path}/lib -L#{libtiff_recipe.path}/lib -L#{libz_recipe.path}/lib #{debug ? "-ggdb" : ""}", ] recipe.cook_and_activate diff --git a/fxruby.gemspec b/fxruby.gemspec index f32945b..7ee4a66 100644 --- a/fxruby.gemspec +++ b/fxruby.gemspec @@ -33,6 +33,8 @@ spec.summary = %q{FXRuby is the Ruby binding to the FOX GUI toolkit.} spec.homepage = "https://github.com/larskanis/fxruby" spec.license = 'LGPL-2.1' + spec.metadata["changelog_uri"] = "https://github.com/larskanis/fxruby/blob/1.6/History.md" + spec.metadata["documentation_uri"] = "https://rubydoc.info/gems/fxruby/frames" spec.files = `git ls-files -z`.split("\x0").reject do |f| f=~/^fox-includes|^web/ @@ -51,4 +53,10 @@ spec.required_ruby_version = [">= 2.3", "< 4"] spec.add_runtime_dependency 'mini_portile2', '~> 2.1' + + yardopts = File.read(".yardopts") + spec.rdoc_options = ["--main", "README.rdoc", + "--title", "FXRuby API Documentation"] + docfiles = yardopts.lines.map(&:strip).select{|r| r=~/^[^-]/ } + spec.extra_rdoc_files = `git ls-files -z #{docfiles.join(" ")}`.split("\x0") end diff --git a/lib/fox16/version.rb b/lib/fox16/version.rb index 8ab7dd9..df8d3df 100644 --- a/lib/fox16/version.rb +++ b/lib/fox16/version.rb @@ -1,5 +1,5 @@ module Fox def Fox.fxrubyversion - "1.6.44" + "1.6.45" end end diff --git a/lib/fox16.rb b/lib/fox16.rb index d3a5786..a7edcc0 100644 --- a/lib/fox16.rb +++ b/lib/fox16.rb @@ -18,11 +18,9 @@ end end + ruby_plat = RUBY_PLATFORM.gsub("i386", "x86") # Temporary add this directory for DLL search, so that bundled DLLs can be found. - ports_dir = RbConfig::CONFIG["host"].gsub('i686-pc-mingw32') do - major_minor < '2.0' ? 'i586-mingw32msvc' : 'i686-w64-mingw32' - end - ports_bin = File.expand_path("../../ports/#{ports_dir}/bin", __FILE__) + ports_bin = File.expand_path("../../ports/#{ruby_plat}/bin", __FILE__) add_dll_path.call(ports_bin) do require "#{major_minor}/fox16_c" end diff --git a/test/TC_FXDCPrint.rb b/test/TC_FXDCPrint.rb index d24af26..40441d1 100755 --- a/test/TC_FXDCPrint.rb +++ b/test/TC_FXDCPrint.rb @@ -45,7 +45,7 @@ def assert_same_file_contents(expected, actual) expected_contents, actual_contents = nil, nil - File.open(expected, 'rb') { |f| expected_contents = f.read } + File.open(expected, 'rb') { |f| expected_contents = crlf_to_lf(f.read) } File.open(actual, 'rb') { |f| actual_contents = crlf_to_lf(f.read) } assert_equal(expected_contents, actual_contents) end