Commit fdb3063a authored by HIGUCHI Daisuke (VDR dai)'s avatar HIGUCHI Daisuke (VDR dai)

Updated version 1.15.6 from 'upstream/1.15.6'

with Debian dir 9c7ee87e4e2fcdf4162e1b9f1aa9c297cf817a90
parents 12021987 7e01d23c
Release 1.15.6 (2017-04-27) Kouhei Sutou <kou@cozmixng.org>
===========================================================
Improvements
------------
* Added Cairo::Context#refrence_count.
* Windows: Update bundled libraries:
* zlib: 1.2.10 -> 1.2.11
* libpng: 1.6.27 -> 1.6.29
* FreeType: 2.7 -> 2.7.1
* Used native-package-installer gem.
Release 1.15.5 (2017-01-14) Kouhei Sutou <kou@cozmixng.org>
===========================================================
......
......@@ -442,8 +442,8 @@ windows_task = WindowsTask.new(spec) do |task|
task.packages = [
{
:name => "zlib",
:version => "1.2.10",
:download_base_url => "https://downloads.sourceforge.net/project/libpng/zlib/1.2.10",
:version => "1.2.11",
:download_base_url => "https://downloads.sourceforge.net/project/libpng/zlib/1.2.11",
:compression_method => "gz",
:windows => {
:builder => ZlibBuilder.new,
......@@ -452,16 +452,16 @@ windows_task = WindowsTask.new(spec) do |task|
},
{
:name => "libpng",
:version => "1.6.27",
:download_base_url => "https://downloads.sourceforge.net/project/libpng/libpng16/1.6.27",
:version => "1.6.29",
:download_base_url => "https://downloads.sourceforge.net/project/libpng/libpng16/1.6.29",
:windows => {
:built_file => "bin/libpng16-16.dll",
},
},
{
:name => "freetype",
:version => "2.7",
:download_base_url => "https://downloads.sourceforge.net/project/freetype/freetype2/2.7",
:version => "2.7.1",
:download_base_url => "https://downloads.sourceforge.net/project/freetype/freetype2/2.7.1",
:compression_method => "bz2",
:windows => {
:built_file => "bin/libfreetype-7.dll",
......
......@@ -17,6 +17,8 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
node.vm.synced_folder("../", "/rcairo")
node.vm.synced_folder("../../pkg-config", "/pkg-config")
node.vm.synced_folder("../../native-package-installer",
"/native-package-installer")
node.vm.synced_folder("../../ruby-gnome2", "/ruby-gnome2")
node.vm.provision(:shell,
......
......@@ -9,7 +9,7 @@ export RUBY_CC_VERSION="2.1.10:2.2.4:2.3.0:2.4.0"
N_CPUS=$(grep '^processor' /proc/cpuinfo | wc -l)
export MAKE_N_JOBS=${N_CPUS}
export RUBYLIB="$(pwd)/pkg-config/lib"
export RUBYLIB="$(pwd)/pkg-config/lib:$(pwd)/native-package-installer/lib"
run()
{
......@@ -60,6 +60,7 @@ run \
# ${BUILD_HOST}-g++ /usr/bin/${BUILD_HOST}-g++-posix
run git clone file:///pkg-config/.git
run git clone file:///native-package-installer/.git
run git clone file:///rcairo/.git rcairo.${DIRECTORY_SUFFIX}
run git clone file:///ruby-gnome2/.git ruby-gnome2.${DIRECTORY_SUFFIX}
......@@ -67,6 +68,7 @@ run sudo gem install --no-document \
rake \
bundler \
pkg-config \
native-package-installer \
rake-compiler \
mechanize \
packnga
......
......@@ -36,6 +36,7 @@ Gem::Specification.new do |s|
s.extra_rdoc_files = ["README.rdoc"]
s.add_runtime_dependency("pkg-config", ">= 1.1.5")
s.add_runtime_dependency("native-package-installer")
s.add_development_dependency("bundler")
s.add_development_dependency("test-unit-notify")
s.add_development_dependency("rake-compiler")
......
......@@ -6,12 +6,8 @@ require 'English'
require 'mkmf'
require 'fileutils'
begin
require 'pkg-config'
rescue LoadError
require 'rubygems'
require 'pkg-config'
end
require "pkg-config"
require "native-package-installer"
checking_for(checking_message("GCC")) do
if macro_defined?("__GNUC__", "")
......@@ -47,119 +43,6 @@ checking_for(checking_message("Win32 OS")) do
end
end
def package_platform
if File.exist?("/etc/debian_version")
:debian
elsif File.exist?("/etc/fedora-release")
:fedora
elsif File.exist?("/etc/redhat-release")
:redhat
elsif find_executable("brew")
:homebrew
elsif find_executable("port")
:macports
else
:unknown
end
end
def super_user?
Process.uid.zero?
end
def normalize_native_package_info(native_package_info)
native_package_info ||= {}
native_package_info = native_package_info.dup
native_package_info[:fedora] ||= native_package_info[:redhat]
native_package_info
end
def install_missing_native_package(native_package_info)
platform = package_platform
native_package_info = normalize_native_package_info(native_package_info)
package = native_package_info[platform]
return false if package.nil?
need_super_user_priviledge = true
case platform
when :debian
install_command = "apt-get install -V -y #{package}"
when :fedora, :redhat
install_command = "yum install -y #{package}"
when :homebrew
need_super_user_priviledge = false
install_command = "brew install #{package}"
when :macports
install_command = "port install -y #{package}"
else
return false
end
have_priviledge = (not need_super_user_priviledge or super_user?)
unless have_priviledge
sudo = find_executable("sudo")
end
installing_message = "installing '#{package}' native package... "
message("%s", installing_message)
failed_to_get_super_user_priviledge = false
succeeded = false
execution_result = ""
File.open("mkmf.log") do |log|
log.seek(0, IO::SEEK_END)
if have_priviledge
succeeded = xsystem(install_command)
else
if sudo
install_command = "#{sudo} #{install_command}"
succeeded = xsystem(install_command)
else
succeeded = false
failed_to_get_super_user_priviledge = true
end
end
executed_command_line = log.gets
execution_result = log.read
end
if failed_to_get_super_user_priviledge
result_message = "require super user privilege"
else
result_message = succeeded ? "succeeded" : "failed"
end
Logging.postpone do
"#{installing_message}#{result_message}\n"
end
message("#{result_message}\n")
error_message = nil
unless succeeded
if failed_to_get_super_user_priviledge
error_message = <<-EOM
'#{package}' native package is required.
Run the following command as super user to install required native package:
\# #{install_command}
EOM
else
error_message = <<-EOM
Failed to run '#{install_command}':
--
#{execution_result.chomp}
--
EOM
end
end
if error_message
message("%s", error_message)
Logging.message("%s", error_message)
end
Logging.message("--------------------\n\n")
succeeded
end
def required_pkg_config_package(package_info, native_package_info=nil)
if package_info.is_a?(Array)
required_package_info = package_info
......@@ -169,7 +52,7 @@ def required_pkg_config_package(package_info, native_package_info=nil)
return true if PKGConfig.have_package(*required_package_info)
native_package_info ||= {}
return false unless install_missing_native_package(native_package_info)
return false unless NativePackageInstaller.install(native_package_info)
PKGConfig.have_package(*required_package_info)
end
......
......@@ -5,7 +5,7 @@
* $Author: kou $
* $Date: 2008-09-19 12:56:27 $
*
* Copyright 2006-2016 Kouhei Sutou <kou@cozmixng.org>
* Copyright 2006-2017 Kouhei Sutou <kou@cozmixng.org>
* Copyright 2005 Øyvind Kolås <pippin@freedesktop.org>
* Copyright 2004-2005 MenTaLguY <mental@rydia.com>
*
......@@ -73,7 +73,7 @@ RB_CAIRO_BEGIN_DECLS
#define RB_CAIRO_VERSION_MAJOR 1
#define RB_CAIRO_VERSION_MINOR 15
#define RB_CAIRO_VERSION_MICRO 5
#define RB_CAIRO_VERSION_MICRO 6
RB_CAIRO_VAR VALUE rb_mCairo;
RB_CAIRO_VAR VALUE rb_cCairo_Context;
......
......@@ -127,7 +127,7 @@ VALUE rb_mCairo_PDFMetadata = Qnil;
#define CAIRO_REGION_OVERLAP_MIN CAIRO_REGION_OVERLAP_IN
#define CAIRO_REGION_OVERLAP_MAX CAIRO_REGION_OVERLAP_PART
#if CAIRO_CHECK_VERSION(1, 15, 6)
#if CAIRO_CHECK_VERSION(1, 15, 5)
# define CAIRO_PDF_OUTLINE_FLAGS_MIN CAIRO_PDF_OUTLINE_FLAG_OPEN
# define CAIRO_PDF_OUTLINE_FLAGS_MAX CAIRO_PDF_OUTLINE_FLAG_ITALIC
#else
......@@ -692,7 +692,7 @@ Init_cairo_constants (void)
#if CAIRO_CHECK_VERSION(1, 15, 4)
rb_mCairo_PDFOutlineFlags =
rb_define_module_under (rb_mCairo, "PDFOutlineFlags");
# if CAIRO_CHECK_VERSION(1, 15, 6)
# if CAIRO_CHECK_VERSION(1, 15, 5)
rb_define_const (rb_mCairo_PDFOutlineFlags, "OPEN",
INT2NUM (CAIRO_PDF_OUTLINE_FLAG_OPEN));
rb_define_const (rb_mCairo_PDFOutlineFlags, "BOLD",
......
......@@ -129,6 +129,18 @@ cr_destroy_with_destroy_check (VALUE self)
return Qnil;
}
static VALUE
cr_get_reference_count (VALUE self)
{
cairo_t *cr;
unsigned int reference_count;
cr = _SELF;
reference_count = cairo_get_reference_count (cr);
return UINT2NUM (reference_count);
}
static VALUE
cr_s_wrap (VALUE self, VALUE pointer)
{
......@@ -1673,6 +1685,8 @@ Init_cairo_context (void)
/* Functions for manipulating state objects */
rb_define_method (rb_cCairo_Context, "initialize", cr_initialize, 1);
rb_define_method (rb_cCairo_Context, "destroy", cr_destroy, 0);
rb_define_method (rb_cCairo_Context, "reference_count",
cr_get_reference_count, 0);
rb_define_method (rb_cCairo_Context, "save", cr_save, 0);
rb_define_method (rb_cCairo_Context, "restore", cr_restore, 0);
......
......@@ -465,6 +465,18 @@ cr_surface_destroy (VALUE self)
return self;
}
static VALUE
cr_surface_get_reference_count (VALUE self)
{
cairo_surface_t *surface;
unsigned int reference_count;
surface = _SELF;
reference_count = cairo_surface_get_reference_count (surface);
return UINT2NUM (reference_count);
}
static VALUE
cr_surface_finish (VALUE self)
{
......@@ -1998,6 +2010,8 @@ Init_cairo_surface (void)
cr_surface_get_device, 0);
#endif
rb_define_method (rb_cCairo_Surface, "destroy", cr_surface_destroy, 0);
rb_define_method (rb_cCairo_Surface, "reference_count",
cr_surface_get_reference_count, 0);
rb_define_method (rb_cCairo_Surface, "finish", cr_surface_finish, 0);
rb_define_method (rb_cCairo_Surface, "content", cr_surface_get_content, 0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment