Codebase list ruby-fxruby / c88836c
Update to libpng-1.6.37, jpeg-turbo-2.0.4, libtiff-4.1.0 jpeg-turbo has changed it's configure tool to cmake, so that the build receipe has to be changed accordingly. Lars Kanis 4 years ago
2 changed file(s) with 45 addition(s) and 22 deletion(s). Raw diff Collapse all Expand all
158158 sudo apt update &&
159159 sudo apt install yasm &&
160160 bundle --local --without=test &&
161 rake native:#{plat} pkg/#{ext_task.gem_spec.full_name}-#{plat}.gem MAKE=\"nice make V=1 -j `nproc`\" #{debug}
161 rake native:#{plat} pkg/#{ext_task.gem_spec.full_name}-#{plat}.gem MAKE=\"nice make V=1 VERBOSE=1 -j `nproc`\" #{debug}
162162 EOT
163163 end
164164 end
2323 LIBZ_VERSION = ENV['LIBZ_VERSION'] || '1.2.7.3'
2424 LIBZ_SOURCE_URI = "http://zlib.net/fossils/zlib-#{LIBZ_VERSION}.tar.gz"
2525
26 LIBPNG_VERSION = ENV['LIBPNG_VERSION'] || '1.6.36'
26 LIBPNG_VERSION = ENV['LIBPNG_VERSION'] || '1.6.37'
2727 LIBPNG_SOURCE_URI = "http://prdownloads.sourceforge.net/libpng/libpng-#{LIBPNG_VERSION}.tar.gz"
2828
2929 # LIBJPEG_VERSION = ENV['LIBJPEG_VERSION'] || '9b'
3030 # LIBJPEG_SOURCE_URI = "http://www.ijg.org/files/jpegsrc.v#{LIBJPEG_VERSION}.tar.gz"
3131
32 LIBJPEG_VERSION = ENV['LIBJPEG_VERSION'] || '1.5.3'
32 LIBJPEG_VERSION = ENV['LIBJPEG_VERSION'] || '2.0.4'
3333 LIBJPEG_SOURCE_URI = "https://downloads.sourceforge.net/libjpeg-turbo/libjpeg-turbo-#{LIBJPEG_VERSION}.tar.gz"
3434
35 LIBTIFF_VERSION = ENV['LIBTIFF_VERSION'] || '4.0.10'
35 LIBTIFF_VERSION = ENV['LIBTIFF_VERSION'] || '4.1.0'
3636 LIBTIFF_SOURCE_URI = "http://download.osgeo.org/libtiff/tiff-#{LIBTIFF_VERSION}.tar.gz"
3737
3838 LIBFOX_VERSION = ENV['LIBFOX_VERSION'] || '1.6.57'
4343 # LIBFXSCINTILLA_VERSION = ENV['LIBFXSCINTILLA_VERSION'] || '3.5.2'
4444 # LIBFXSCINTILLA_SOURCE_URI = "https://github.com/yetanothergeek/fxscintilla/archive/FXSCINTILLA-#{LIBFXSCINTILLA_VERSION.gsub(".","_")}.tar.gz"
4545
46
47 class BuildRecipe < MiniPortile
46 module BuildRecipeCommons
4847 def initialize(name, version, files)
4948 super(name, version)
5049 self.files = files
5150 rootdir = File.expand_path('../../..', __FILE__)
5251 self.target = File.join(rootdir, "ports")
53 # Prefer host_alias over host in order to use i586-mingw32msvc as
54 # correct compiler prefix for cross build, but use host if not set.
55 self.host = consolidated_host(RbConfig::CONFIG["host_alias"].empty? ? RbConfig::CONFIG["host"] : RbConfig::CONFIG["host_alias"])
52 self.host = RbConfig::CONFIG["host"]
5653 self.patch_files = Dir[File.join(rootdir, "patches", self.name, self.version, "*.diff")].sort
57 end
58
59 def consolidated_host(name)
60 name.gsub('i686-pc-mingw32', 'i586-mingw32msvc')
61 end
62
63 def configure_defaults
64 [
65 "--host=#{host}", # build for specific target (host)
66 "--disable-static",
67 "--enable-shared",
68 ]
6954 end
7055
7156 def port_path
9277 end
9378 self.activate
9479 self
80 end
81 end
82
83 class BuildRecipe < MiniPortile
84 include BuildRecipeCommons
85
86 def configure_defaults
87 [
88 "--host=#{host}", # build for specific target (host)
89 "--disable-static",
90 "--enable-shared",
91 ]
92 end
93 end
94 class BuildRecipeCMake < MiniPortileCMake
95 include BuildRecipeCommons
96
97 def system_processor
98 case host
99 when /x86_64/ then "amd64"
100 when /i686/ then "x86"
101 else raise "unknown host #{host}"
102 end
103 end
104
105 def configure_defaults
106 [
107 "-DENABLE_STATIC=0",
108 "-DENABLE_SHARED=1",
109 "-DCMAKE_SYSTEM_NAME=Windows",
110 "-DCMAKE_C_COMPILER=#{host}-gcc",
111 "-DCMAKE_CXX_COMPILER=#{host}-g++",
112 "-DCMAKE_SYSTEM_PROCESSOR=#{system_processor}",
113 ]
114 end
115
116 def make_cmd
117 ENV["MAKE"] || "make"
95118 end
96119 end
97120
140163 recipe.cook_and_activate
141164 end
142165
143 libjpeg_recipe = BuildRecipe.new("libjpeg", LIBJPEG_VERSION, [LIBJPEG_SOURCE_URI]).tap do |recipe|
166 libjpeg_recipe = BuildRecipeCMake.new("libjpeg", LIBJPEG_VERSION, [LIBJPEG_SOURCE_URI]).tap do |recipe|
144167 recipe.cook_and_activate
145168 end
146169