23 | 23 |
LIBZ_VERSION = ENV['LIBZ_VERSION'] || '1.2.7.3'
|
24 | 24 |
LIBZ_SOURCE_URI = "http://zlib.net/fossils/zlib-#{LIBZ_VERSION}.tar.gz"
|
25 | 25 |
|
26 | |
LIBPNG_VERSION = ENV['LIBPNG_VERSION'] || '1.6.36'
|
|
26 |
LIBPNG_VERSION = ENV['LIBPNG_VERSION'] || '1.6.37'
|
27 | 27 |
LIBPNG_SOURCE_URI = "http://prdownloads.sourceforge.net/libpng/libpng-#{LIBPNG_VERSION}.tar.gz"
|
28 | 28 |
|
29 | 29 |
# LIBJPEG_VERSION = ENV['LIBJPEG_VERSION'] || '9b'
|
30 | 30 |
# LIBJPEG_SOURCE_URI = "http://www.ijg.org/files/jpegsrc.v#{LIBJPEG_VERSION}.tar.gz"
|
31 | 31 |
|
32 | |
LIBJPEG_VERSION = ENV['LIBJPEG_VERSION'] || '1.5.3'
|
|
32 |
LIBJPEG_VERSION = ENV['LIBJPEG_VERSION'] || '2.0.4'
|
33 | 33 |
LIBJPEG_SOURCE_URI = "https://downloads.sourceforge.net/libjpeg-turbo/libjpeg-turbo-#{LIBJPEG_VERSION}.tar.gz"
|
34 | 34 |
|
35 | |
LIBTIFF_VERSION = ENV['LIBTIFF_VERSION'] || '4.0.10'
|
|
35 |
LIBTIFF_VERSION = ENV['LIBTIFF_VERSION'] || '4.1.0'
|
36 | 36 |
LIBTIFF_SOURCE_URI = "http://download.osgeo.org/libtiff/tiff-#{LIBTIFF_VERSION}.tar.gz"
|
37 | 37 |
|
38 | 38 |
LIBFOX_VERSION = ENV['LIBFOX_VERSION'] || '1.6.57'
|
|
43 | 43 |
# LIBFXSCINTILLA_VERSION = ENV['LIBFXSCINTILLA_VERSION'] || '3.5.2'
|
44 | 44 |
# LIBFXSCINTILLA_SOURCE_URI = "https://github.com/yetanothergeek/fxscintilla/archive/FXSCINTILLA-#{LIBFXSCINTILLA_VERSION.gsub(".","_")}.tar.gz"
|
45 | 45 |
|
46 | |
|
47 | |
class BuildRecipe < MiniPortile
|
|
46 |
module BuildRecipeCommons
|
48 | 47 |
def initialize(name, version, files)
|
49 | 48 |
super(name, version)
|
50 | 49 |
self.files = files
|
51 | 50 |
rootdir = File.expand_path('../../..', __FILE__)
|
52 | 51 |
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"]
|
56 | 53 |
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 | |
]
|
69 | 54 |
end
|
70 | 55 |
|
71 | 56 |
def port_path
|
|
92 | 77 |
end
|
93 | 78 |
self.activate
|
94 | 79 |
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"
|
95 | 118 |
end
|
96 | 119 |
end
|
97 | 120 |
|
|
140 | 163 |
recipe.cook_and_activate
|
141 | 164 |
end
|
142 | 165 |
|
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|
|
144 | 167 |
recipe.cook_and_activate
|
145 | 168 |
end
|
146 | 169 |
|