Skip to content
Snippets Groups Projects
Commit a4d9d5a1 authored by Lars Kanis's avatar Lars Kanis
Browse files

Merge branch '1.6' of github.com:larskanis/fxruby into 1.6

parents 9efcc3f3 43362262
No related branches found
No related tags found
No related merge requests found
...@@ -21,7 +21,6 @@ PKG_VERSION = Fox.fxrubyversion ...@@ -21,7 +21,6 @@ PKG_VERSION = Fox.fxrubyversion
SWIG = (RUBY_PLATFORM =~ /mingw/) ? "swig.exe" : "swig" SWIG = (RUBY_PLATFORM =~ /mingw/) ? "swig.exe" : "swig"
SWIGFLAGS = "-c++ -ruby -nodefaultdtor -nodefaultctor -w302 -features compactdefaultargs -I../fox-includes" SWIGFLAGS = "-c++ -ruby -nodefaultdtor -nodefaultctor -w302 -features compactdefaultargs -I../fox-includes"
SWIG_LIB = `#{SWIG} -swiglib`.chomp
SWIG_MODULES = { SWIG_MODULES = {
"core.i" => "core_wrap.cpp", "core.i" => "core_wrap.cpp",
"dcmodule.i" => "dc_wrap.cpp", "dcmodule.i" => "dc_wrap.cpp",
...@@ -63,6 +62,7 @@ hoe = Hoe.spec "fxruby" do ...@@ -63,6 +62,7 @@ hoe = Hoe.spec "fxruby" do
self.version = PKG_VERSION self.version = PKG_VERSION
self.readme_file = 'README.rdoc' self.readme_file = 'README.rdoc'
self.extra_rdoc_files << self.readme_file self.extra_rdoc_files << self.readme_file
self.extra_deps << ['mini_portile', '~> 0.6']
spec_extras[:files] = File.read_utf("Manifest.txt").split(/\r?\n\r?/).reject{|f| f=~/^fox-includes|^web/ } spec_extras[:files] = File.read_utf("Manifest.txt").split(/\r?\n\r?/).reject{|f| f=~/^fox-includes|^web/ }
spec_extras[:files] += SWIG_MODULES.values.map{|f| File.join("ext/fox16_c", f) } spec_extras[:files] += SWIG_MODULES.values.map{|f| File.join("ext/fox16_c", f) }
...@@ -126,6 +126,12 @@ ENV['RUBY_CC_VERSION'].to_s.split(':').each do |ruby_version| ...@@ -126,6 +126,12 @@ ENV['RUBY_CC_VERSION'].to_s.split(':').each do |ruby_version|
end end
end end
desc "Build the windows binary gems"
task 'gem:windows' => 'gem' do
require 'rake_compiler_dock'
RakeCompilerDock.sh "rake cross native gem RUBYOPT=--disable-rubygems MAKE=\"nice make V=1 -j `nproc`\" "
end
# Set environment variable SWIG_LIB to # Set environment variable SWIG_LIB to
# c:/ruby-1.8.6-p383-preview2/devkit/msys/1.0.11/usr/local/share/swig/1.3.22 # c:/ruby-1.8.6-p383-preview2/devkit/msys/1.0.11/usr/local/share/swig/1.3.22
# before running swig on MinGW. # before running swig on MinGW.
......
...@@ -7,7 +7,7 @@ def find_installed_fox_version ...@@ -7,7 +7,7 @@ def find_installed_fox_version
stddirs = ["/usr/include/fox-1.6", stddirs = ["/usr/include/fox-1.6",
"/usr/local/include/fox-1.6", "/usr/local/include/fox-1.6",
"/sw/include/fox-1.6", "/sw/include/fox-1.6",
"/opt/local/include/fox-1.6"] "/opt/local/include/fox-1.6"]
usrdirs = [] usrdirs = []
ARGV.each do |arg| ARGV.each do |arg|
if arg =~ /--with-fox-include/ if arg =~ /--with-fox-include/
...@@ -109,12 +109,13 @@ def do_rake_compiler_setup ...@@ -109,12 +109,13 @@ def do_rake_compiler_setup
dir_config("installed") dir_config("installed")
host = RbConfig::CONFIG["host_alias"].empty? ? RbConfig::CONFIG["host"] : RbConfig::CONFIG["host_alias"]
libz_recipe = MiniPortile.new("libz", LIBZ_VERSION).tap do |recipe| libz_recipe = MiniPortile.new("libz", LIBZ_VERSION).tap do |recipe|
recipe.files = [LIBZ_SOURCE_URI] recipe.files = [LIBZ_SOURCE_URI]
recipe.target = portsdir = File.expand_path('../../../ports', __FILE__) recipe.target = portsdir = File.expand_path('../../../ports', __FILE__)
# Prefer host_alias over host in order to use i586-mingw32msvc as # Prefer host_alias over host in order to use i586-mingw32msvc as
# correct compiler prefix for cross build, but use host if not set. # correct compiler prefix for cross build, but use host if not set.
recipe.host = RbConfig::CONFIG["host_alias"].empty? ? RbConfig::CONFIG["host"] : RbConfig::CONFIG["host_alias"] recipe.host = host
class << recipe class << recipe
def configure def configure
Dir.chdir work_path do Dir.chdir work_path do
...@@ -157,7 +158,7 @@ def do_rake_compiler_setup ...@@ -157,7 +158,7 @@ def do_rake_compiler_setup
recipe.target = portsdir = File.expand_path('../../../ports', __FILE__) recipe.target = portsdir = File.expand_path('../../../ports', __FILE__)
# Prefer host_alias over host in order to use i586-mingw32msvc as # Prefer host_alias over host in order to use i586-mingw32msvc as
# correct compiler prefix for cross build, but use host if not set. # correct compiler prefix for cross build, but use host if not set.
recipe.host = RbConfig::CONFIG["host_alias"].empty? ? RbConfig::CONFIG["host"] : RbConfig::CONFIG["host_alias"] recipe.host = host
recipe.configure_options = [ recipe.configure_options = [
"--host=#{recipe.host}", "--host=#{recipe.host}",
"--enable-shared", "--enable-shared",
...@@ -182,7 +183,7 @@ def do_rake_compiler_setup ...@@ -182,7 +183,7 @@ def do_rake_compiler_setup
recipe.target = portsdir = File.expand_path('../../../ports', __FILE__) recipe.target = portsdir = File.expand_path('../../../ports', __FILE__)
# Prefer host_alias over host in order to use i586-mingw32msvc as # Prefer host_alias over host in order to use i586-mingw32msvc as
# correct compiler prefix for cross build, but use host if not set. # correct compiler prefix for cross build, but use host if not set.
recipe.host = RbConfig::CONFIG["host_alias"].empty? ? RbConfig::CONFIG["host"] : RbConfig::CONFIG["host_alias"] recipe.host = host
recipe.configure_options = [ recipe.configure_options = [
"--host=#{recipe.host}", "--host=#{recipe.host}",
"--enable-shared", "--enable-shared",
...@@ -202,7 +203,7 @@ def do_rake_compiler_setup ...@@ -202,7 +203,7 @@ def do_rake_compiler_setup
recipe.target = portsdir = File.expand_path('../../../ports', __FILE__) recipe.target = portsdir = File.expand_path('../../../ports', __FILE__)
# Prefer host_alias over host in order to use i586-mingw32msvc as # Prefer host_alias over host in order to use i586-mingw32msvc as
# correct compiler prefix for cross build, but use host if not set. # correct compiler prefix for cross build, but use host if not set.
recipe.host = RbConfig::CONFIG["host_alias"].empty? ? RbConfig::CONFIG["host"] : RbConfig::CONFIG["host_alias"] recipe.host = host
recipe.configure_options = [ recipe.configure_options = [
"--host=#{recipe.host}", "--host=#{recipe.host}",
"--enable-shared", "--enable-shared",
...@@ -222,7 +223,7 @@ def do_rake_compiler_setup ...@@ -222,7 +223,7 @@ def do_rake_compiler_setup
recipe.target = portsdir = File.expand_path('../../../ports', __FILE__) recipe.target = portsdir = File.expand_path('../../../ports', __FILE__)
# Prefer host_alias over host in order to use i586-mingw32msvc as # Prefer host_alias over host in order to use i586-mingw32msvc as
# correct compiler prefix for cross build, but use host if not set. # correct compiler prefix for cross build, but use host if not set.
recipe.host = RbConfig::CONFIG["host_alias"].empty? ? RbConfig::CONFIG["host"] : RbConfig::CONFIG["host_alias"] recipe.host = host
recipe.configure_options = [ recipe.configure_options = [
"--host=#{recipe.host}", "--host=#{recipe.host}",
"--without-xft", "--without-xft",
...@@ -255,7 +256,7 @@ def do_rake_compiler_setup ...@@ -255,7 +256,7 @@ def do_rake_compiler_setup
recipe.target = portsdir = File.expand_path('../../../ports', __FILE__) recipe.target = portsdir = File.expand_path('../../../ports', __FILE__)
# Prefer host_alias over host in order to use i586-mingw32msvc as # Prefer host_alias over host in order to use i586-mingw32msvc as
# correct compiler prefix for cross build, but use host if not set. # correct compiler prefix for cross build, but use host if not set.
recipe.host = RbConfig::CONFIG["host_alias"].empty? ? RbConfig::CONFIG["host"] : RbConfig::CONFIG["host_alias"] recipe.host = host
recipe.configure_options = [ recipe.configure_options = [
"--host=#{recipe.host}", "--host=#{recipe.host}",
"--enable-shared", "--enable-shared",
...@@ -282,14 +283,19 @@ def do_rake_compiler_setup ...@@ -282,14 +283,19 @@ def do_rake_compiler_setup
checkpoint = File.join(portsdir, "#{recipe.name}-#{recipe.version}-#{recipe.host}.installed") checkpoint = File.join(portsdir, "#{recipe.name}-#{recipe.version}-#{recipe.host}.installed")
unless File.exist?(checkpoint) unless File.exist?(checkpoint)
recipe.cook with_env(
FileUtils.touch checkpoint 'PKG_CONFIG_PATH' => "#{libfox_recipe.path}/lib/pkgconfig"
) do
recipe.cook
FileUtils.touch checkpoint
end
end end
recipe.activate recipe.activate
end end
$autodetected_fxscintilla = true
dir_config('libfox', "#{libfox_recipe.path}/include", "#{libfox_recipe.path}/lib") dir_config('libfox', "#{libfox_recipe.path}/include/fox-1.6", "#{libfox_recipe.path}/lib")
dir_config('libfxscintilla', "#{libfxscintills_recipe.path}/include", "#{libfxscintills_recipe.path}/lib") dir_config('libfxscintilla', "#{libfxscintills_recipe.path}/include/fxscintilla", "#{libfxscintills_recipe.path}/lib")
shared_dlls = [ shared_dlls = [
"#{libfxscintills_recipe.path}/bin/libfxscintilla-20.dll", "#{libfxscintills_recipe.path}/bin/libfxscintilla-20.dll",
...@@ -312,7 +318,7 @@ def do_rake_compiler_setup ...@@ -312,7 +318,7 @@ def do_rake_compiler_setup
FileUtils.cp `#{cmd}`.chomp, '.', verbose: true FileUtils.cp `#{cmd}`.chomp, '.', verbose: true
end end
CONFIG['CXX'] = "#{RbConfig::CONFIG["host"]}-g++" # CXX setting must be prefixed for cross build CONFIG['CXX'] = "#{host}-g++" # CXX setting must be prefixed for cross build
CONFIG['CC'] += "\nCXX=#{CONFIG['CXX']}" # Hack CXX into Makefile for cross compilation CONFIG['CC'] += "\nCXX=#{CONFIG['CXX']}" # Hack CXX into Makefile for cross compilation
CONFIG['LDSHARED'].gsub!('gcc', 'g++') # ensure C++ linker is used, so that libstdc++ is linked static CONFIG['LDSHARED'].gsub!('gcc', 'g++') # ensure C++ linker is used, so that libstdc++ is linked static
$LDFLAGS += " -s" # remove symbol table informations from shared lib $LDFLAGS += " -s" # remove symbol table informations from shared lib
...@@ -371,15 +377,17 @@ dir_config('fox', '/usr/local/include/fox-1.6', '/usr/local/lib') ...@@ -371,15 +377,17 @@ dir_config('fox', '/usr/local/include/fox-1.6', '/usr/local/lib')
dir_config('fxscintilla', '/usr/local/include/fxscintilla', '/usr/local/lib') dir_config('fxscintilla', '/usr/local/include/fxscintilla', '/usr/local/lib')
find_installed_fox_version unless enable_config("win32-cross")
find_installed_fox_version
# #
# Check for FXScintilla header files, unless FXScintilla support has # Check for FXScintilla header files, unless FXScintilla support has
# been explicitly suppressed with the '--without-fxscintilla' flag. # been explicitly suppressed with the '--without-fxscintilla' flag.
# #
unless fxscintilla_support_suppressed? unless fxscintilla_support_suppressed?
find_installed_fxscintilla_version find_installed_fxscintilla_version
end
end end
# Platform-specific modifications # Platform-specific modifications
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment