cairo-gobject 2.2.4-x64-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Rakefile +32 -0
- data/ext/cairo-gobject/extconf.rb +85 -0
- data/ext/cairo-gobject/rb-cairo-gobject.c +150 -0
- data/ext/cairo-gobject/rb-cairo-gobject.h +42 -0
- data/extconf.rb +71 -0
- data/lib/2.0/cairo_gobject.so +0 -0
- data/lib/2.1/cairo_gobject.so +0 -0
- data/lib/2.2/cairo_gobject.so +0 -0
- data/lib/cairo-gobject.rb +30 -0
- data/test/cairo-gobject-test-utils.rb +21 -0
- data/test/run-test.rb +50 -0
- data/test/test_cairoantialias.rb +23 -0
- data/test/test_cairocontent.rb +23 -0
- data/test/test_cairocontext.rb +24 -0
- data/test/test_cairodevicetype.rb +23 -0
- data/test/test_cairoextend.rb +23 -0
- data/test/test_cairofillrule.rb +23 -0
- data/test/test_cairofilter.rb +23 -0
- data/test/test_cairofontslant.rb +23 -0
- data/test/test_cairofonttype.rb +23 -0
- data/test/test_cairofontweight.rb +23 -0
- data/test/test_cairoformat.rb +23 -0
- data/test/test_cairohintmetrics.rb +23 -0
- data/test/test_cairohintstyle.rb +23 -0
- data/test/test_cairoimagesurface.rb +23 -0
- data/test/test_cairolinecap.rb +23 -0
- data/test/test_cairolinejoin.rb +23 -0
- data/test/test_cairooperator.rb +23 -0
- data/test/test_cairopathdatatype.rb +23 -0
- data/test/test_cairopatterntype.rb +23 -0
- data/test/test_cairoregion.rb +23 -0
- data/test/test_cairoregionoverlap.rb +23 -0
- data/test/test_cairoscaledfont.rb +32 -0
- data/test/test_cairostatus.rb +23 -0
- data/test/test_cairosubpixelorder.rb +23 -0
- data/test/test_cairosurfacetype.rb +23 -0
- data/test/test_cairotextclusterflags.rb +23 -0
- metadata +122 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 64caf29ab6329f2d7d67eb735ece7636b25b74fe
|
4
|
+
data.tar.gz: ded28db0d518cc218bca21847279b0c142d65434
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 825a1a5f0ea4f1d58314b9fe8a58234e9fc1e07ca4336cde0f8c801bb0a502e96e7c62c1bae37baf1c2d3f2bdbcb3acf26ba0f189fad14032615b1edb6d030a2
|
7
|
+
data.tar.gz: 1db71a9e40696de0a63fec908e01bf8840dfb2d6f4cb347c178d59160d5a47f793472bf9374a7c494208032ad71ac314699ceabebde70390b0902ae2fc59d010
|
data/Rakefile
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
# -*- ruby -*-
|
2
|
+
#
|
3
|
+
# Copyright (C) 2012 Ruby-GNOME2 Project Team
|
4
|
+
#
|
5
|
+
# This library is free software; you can redistribute it and/or
|
6
|
+
# modify it under the terms of the GNU Lesser General Public
|
7
|
+
# License as published by the Free Software Foundation; either
|
8
|
+
# version 2.1 of the License, or (at your option) any later version.
|
9
|
+
#
|
10
|
+
# This library is distributed in the hope that it will be useful,
|
11
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
13
|
+
# Lesser General Public License for more details.
|
14
|
+
#
|
15
|
+
# You should have received a copy of the GNU Lesser General Public
|
16
|
+
# License along with this library; if not, write to the Free Software
|
17
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
18
|
+
|
19
|
+
$LOAD_PATH.unshift("./../glib2/lib")
|
20
|
+
require "gnome2/rake/package-task"
|
21
|
+
|
22
|
+
package_task = GNOME2::Rake::PackageTask.new do |package|
|
23
|
+
package.summary = "Ruby/CairoGObject is a Ruby binding of cairo-gobject."
|
24
|
+
package.description = "Ruby/CairoGObject is a Ruby binding of cairo-gobject."
|
25
|
+
package.dependency.gem.runtime = ["cairo", "glib2"]
|
26
|
+
package.dependency.gem.development = ["test-unit-notify"]
|
27
|
+
package.windows.packages = []
|
28
|
+
package.windows.dependencies = []
|
29
|
+
package.windows.build_dependencies = ["cairo", "glib2"]
|
30
|
+
package.windows.build_packages = []
|
31
|
+
end
|
32
|
+
package_task.define
|
@@ -0,0 +1,85 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# Copyright (C) 2013 Ruby-GNOME2 Project Team
|
4
|
+
#
|
5
|
+
# This library is free software; you can redistribute it and/or
|
6
|
+
# modify it under the terms of the GNU Lesser General Public
|
7
|
+
# License as published by the Free Software Foundation; either
|
8
|
+
# version 2.1 of the License, or (at your option) any later version.
|
9
|
+
#
|
10
|
+
# This library is distributed in the hope that it will be useful,
|
11
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
13
|
+
# Lesser General Public License for more details.
|
14
|
+
#
|
15
|
+
# You should have received a copy of the GNU Lesser General Public
|
16
|
+
# License along with this library; if not, write to the Free Software
|
17
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
18
|
+
|
19
|
+
require "pathname"
|
20
|
+
|
21
|
+
source_dir = Pathname(__FILE__).dirname
|
22
|
+
base_dir = source_dir.parent.parent.expand_path
|
23
|
+
top_dir = base_dir.parent.expand_path
|
24
|
+
top_build_dir = Pathname(".").parent.parent.parent.expand_path
|
25
|
+
|
26
|
+
mkmf_gnome2_dir = top_dir + "glib2" + "lib"
|
27
|
+
version_suffix = ""
|
28
|
+
unless mkmf_gnome2_dir.exist?
|
29
|
+
if /(-\d+\.\d+\.\d+)(?:\.\d+)?\z/ =~ base_dir.basename.to_s
|
30
|
+
version_suffix = $1
|
31
|
+
mkmf_gnome2_dir = top_dir + "glib2#{version_suffix}" + "lib"
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
$LOAD_PATH.unshift(mkmf_gnome2_dir.to_s)
|
36
|
+
|
37
|
+
module_name = "cairo_gobject"
|
38
|
+
package_id = "cairo-gobject"
|
39
|
+
|
40
|
+
begin
|
41
|
+
require "mkmf-gnome2"
|
42
|
+
rescue LoadError
|
43
|
+
require "rubygems"
|
44
|
+
gem "glib2"
|
45
|
+
require "mkmf-gnome2"
|
46
|
+
end
|
47
|
+
|
48
|
+
["glib2"].each do |package|
|
49
|
+
directory = "#{package}#{version_suffix}"
|
50
|
+
build_dir = "#{directory}/tmp/#{RUBY_PLATFORM}/#{package}/#{RUBY_VERSION}"
|
51
|
+
add_depend_package(package, "#{directory}/ext/#{package}",
|
52
|
+
top_dir.to_s,
|
53
|
+
:top_build_dir => top_build_dir.to_s,
|
54
|
+
:target_build_dir => build_dir)
|
55
|
+
end
|
56
|
+
|
57
|
+
unless check_cairo(:top_dir => top_dir)
|
58
|
+
exit(false)
|
59
|
+
end
|
60
|
+
|
61
|
+
setup_windows(module_name, base_dir)
|
62
|
+
|
63
|
+
unless required_pkg_config_package(package_id,
|
64
|
+
:debian => "libcairo2-dev",
|
65
|
+
:fedora => "cairo-gobject-devel",
|
66
|
+
:homebrew => "cairo")
|
67
|
+
exit(false)
|
68
|
+
end
|
69
|
+
|
70
|
+
create_pkg_config_file("Ruby/CairoGObject",
|
71
|
+
package_id, ruby_gnome2_version,
|
72
|
+
"ruby-cairo-gobject.pc")
|
73
|
+
|
74
|
+
ensure_objs
|
75
|
+
|
76
|
+
$defs << "-DRUBY_CAIRO_GOBJECT_COMPILATION"
|
77
|
+
create_makefile(module_name)
|
78
|
+
|
79
|
+
pkg_config_dir = with_config("pkg-config-dir")
|
80
|
+
if pkg_config_dir.is_a?(String)
|
81
|
+
File.open("Makefile", "ab") do |makefile|
|
82
|
+
makefile.puts
|
83
|
+
makefile.puts("pkgconfigdir=#{pkg_config_dir}")
|
84
|
+
end
|
85
|
+
end
|
@@ -0,0 +1,150 @@
|
|
1
|
+
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
2
|
+
/*
|
3
|
+
* Copyright (C) 2013 Ruby-GNOME2 Project Team
|
4
|
+
*
|
5
|
+
* This library is free software; you can redistribute it and/or
|
6
|
+
* modify it under the terms of the GNU Lesser General Public
|
7
|
+
* License as published by the Free Software Foundation; either
|
8
|
+
* version 2.1 of the License, or (at your option) any later version.
|
9
|
+
*
|
10
|
+
* This library is distributed in the hope that it will be useful,
|
11
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
13
|
+
* Lesser General Public License for more details.
|
14
|
+
*
|
15
|
+
* You should have received a copy of the GNU Lesser General Public
|
16
|
+
* License along with this library; if not, write to the Free Software
|
17
|
+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
18
|
+
* MA 02110-1301 USA
|
19
|
+
*/
|
20
|
+
|
21
|
+
#include "rb-cairo-gobject.h"
|
22
|
+
|
23
|
+
#define RG_TARGET_NAMESPACE rb_mCairoGObject
|
24
|
+
|
25
|
+
#define DEFINE_CONVERSION(prefix, gtype, rb_klass, RVAL2CR, CR2RVAL) \
|
26
|
+
static gpointer \
|
27
|
+
prefix ## _robj2instance(VALUE rb_object, \
|
28
|
+
G_GNUC_UNUSED gpointer user_data) \
|
29
|
+
{ \
|
30
|
+
ID id_gboxed; \
|
31
|
+
VALUE rb_boxed = Qnil; \
|
32
|
+
\
|
33
|
+
CONST_ID(id_gboxed, "gboxed"); \
|
34
|
+
if (rb_ivar_defined(rb_object, id_gboxed)) { \
|
35
|
+
rb_boxed = rb_ivar_get(rb_object, id_gboxed); \
|
36
|
+
} \
|
37
|
+
if (NIL_P(rb_boxed)) { \
|
38
|
+
gpointer cr_object = RVAL2CR(rb_object); \
|
39
|
+
rb_boxed = rbgobj_make_boxed_default(cr_object, gtype); \
|
40
|
+
rb_ivar_set(rb_object, id_gboxed, rb_boxed); \
|
41
|
+
} \
|
42
|
+
\
|
43
|
+
return rbgobj_boxed_get_default(rb_boxed, gtype); \
|
44
|
+
} \
|
45
|
+
\
|
46
|
+
static VALUE \
|
47
|
+
prefix ## _instance2robj(gpointer cr_object, \
|
48
|
+
G_GNUC_UNUSED gpointer user_data) \
|
49
|
+
{ \
|
50
|
+
return CR2RVAL(cr_object); \
|
51
|
+
} \
|
52
|
+
\
|
53
|
+
static void \
|
54
|
+
define_ ## prefix ## _conversion(void) \
|
55
|
+
{ \
|
56
|
+
RGConvertTable table; \
|
57
|
+
\
|
58
|
+
memset(&table, 0, sizeof(RGConvertTable)); \
|
59
|
+
table.type = gtype; \
|
60
|
+
table.klass = rb_klass; \
|
61
|
+
table.robj2instance = prefix ## _robj2instance; \
|
62
|
+
table.instance2robj = prefix ## _instance2robj; \
|
63
|
+
\
|
64
|
+
RG_DEF_CONVERSION(&table); \
|
65
|
+
}
|
66
|
+
|
67
|
+
DEFINE_CONVERSION(context, CAIRO_GOBJECT_TYPE_CONTEXT, rb_cCairo_Context,
|
68
|
+
RVAL2CRCONTEXT, CRCONTEXT2RVAL)
|
69
|
+
DEFINE_CONVERSION(device, CAIRO_GOBJECT_TYPE_DEVICE, rb_cCairo_Device,
|
70
|
+
RVAL2CRDEVICE, CRDEVICE2RVAL)
|
71
|
+
DEFINE_CONVERSION(pattern, CAIRO_GOBJECT_TYPE_PATTERN, rb_cCairo_Pattern,
|
72
|
+
RVAL2CRPATTERN, CRPATTERN2RVAL)
|
73
|
+
DEFINE_CONVERSION(surface, CAIRO_GOBJECT_TYPE_SURFACE, rb_cCairo_Surface,
|
74
|
+
RVAL2CRSURFACE, CRSURFACE2RVAL)
|
75
|
+
DEFINE_CONVERSION(scaled_font, CAIRO_GOBJECT_TYPE_SCALED_FONT,
|
76
|
+
rb_cCairo_ScaledFont, RVAL2CRSCALEDFONT, CRSCALEDFONT2RVAL)
|
77
|
+
DEFINE_CONVERSION(font_face, CAIRO_GOBJECT_TYPE_FONT_FACE, rb_cCairo_FontFace,
|
78
|
+
RVAL2CRFONTFACE, CRFONTFACE2RVAL)
|
79
|
+
DEFINE_CONVERSION(font_options, CAIRO_GOBJECT_TYPE_FONT_OPTIONS,
|
80
|
+
rb_cCairo_FontOptions, RVAL2CRFONTOPTIONS, CRFONTOPTIONS2RVAL)
|
81
|
+
DEFINE_CONVERSION(region, CAIRO_GOBJECT_TYPE_REGION, rb_cCairo_Region,
|
82
|
+
RVAL2CRREGION, CRREGION2RVAL)
|
83
|
+
|
84
|
+
void
|
85
|
+
Init_cairo_gobject(void)
|
86
|
+
{
|
87
|
+
VALUE RG_TARGET_NAMESPACE;
|
88
|
+
|
89
|
+
RG_TARGET_NAMESPACE = rb_define_module("CairoGObject");
|
90
|
+
|
91
|
+
rb_define_const(RG_TARGET_NAMESPACE, "BUILD_VERSION",
|
92
|
+
rb_ary_new3(3,
|
93
|
+
INT2FIX(CAIRO_VERSION_MAJOR),
|
94
|
+
INT2FIX(CAIRO_VERSION_MINOR),
|
95
|
+
INT2FIX(CAIRO_VERSION_MICRO)));
|
96
|
+
|
97
|
+
define_context_conversion();
|
98
|
+
define_device_conversion();
|
99
|
+
define_pattern_conversion();
|
100
|
+
define_surface_conversion();
|
101
|
+
define_scaled_font_conversion();
|
102
|
+
define_font_face_conversion();
|
103
|
+
define_font_options_conversion();
|
104
|
+
define_region_conversion();
|
105
|
+
|
106
|
+
G_DEF_CLASS(CAIRO_GOBJECT_TYPE_STATUS, "Status",
|
107
|
+
RG_TARGET_NAMESPACE);
|
108
|
+
G_DEF_CLASS(CAIRO_GOBJECT_TYPE_CONTENT, "Content",
|
109
|
+
RG_TARGET_NAMESPACE);
|
110
|
+
G_DEF_CLASS(CAIRO_GOBJECT_TYPE_OPERATOR, "Operator",
|
111
|
+
RG_TARGET_NAMESPACE);
|
112
|
+
G_DEF_CLASS(CAIRO_GOBJECT_TYPE_ANTIALIAS, "Antialias",
|
113
|
+
RG_TARGET_NAMESPACE);
|
114
|
+
G_DEF_CLASS(CAIRO_GOBJECT_TYPE_FILL_RULE, "FillRule",
|
115
|
+
RG_TARGET_NAMESPACE);
|
116
|
+
G_DEF_CLASS(CAIRO_GOBJECT_TYPE_LINE_CAP, "LineCap",
|
117
|
+
RG_TARGET_NAMESPACE);
|
118
|
+
G_DEF_CLASS(CAIRO_GOBJECT_TYPE_LINE_JOIN, "LineJoin",
|
119
|
+
RG_TARGET_NAMESPACE);
|
120
|
+
G_DEF_CLASS(CAIRO_GOBJECT_TYPE_TEXT_CLUSTER_FLAGS, "TextClusterFlags",
|
121
|
+
RG_TARGET_NAMESPACE);
|
122
|
+
G_DEF_CLASS(CAIRO_GOBJECT_TYPE_FONT_SLANT, "FontSlant",
|
123
|
+
RG_TARGET_NAMESPACE);
|
124
|
+
G_DEF_CLASS(CAIRO_GOBJECT_TYPE_FONT_WEIGHT, "FontWeight",
|
125
|
+
RG_TARGET_NAMESPACE);
|
126
|
+
G_DEF_CLASS(CAIRO_GOBJECT_TYPE_SUBPIXEL_ORDER, "SubpixelOrder",
|
127
|
+
RG_TARGET_NAMESPACE);
|
128
|
+
G_DEF_CLASS(CAIRO_GOBJECT_TYPE_HINT_STYLE, "HintStyle",
|
129
|
+
RG_TARGET_NAMESPACE);
|
130
|
+
G_DEF_CLASS(CAIRO_GOBJECT_TYPE_HINT_METRICS, "HintMetrics",
|
131
|
+
RG_TARGET_NAMESPACE);
|
132
|
+
G_DEF_CLASS(CAIRO_GOBJECT_TYPE_FONT_TYPE, "FontType",
|
133
|
+
RG_TARGET_NAMESPACE);
|
134
|
+
G_DEF_CLASS(CAIRO_GOBJECT_TYPE_PATH_DATA_TYPE, "PathDataType",
|
135
|
+
RG_TARGET_NAMESPACE);
|
136
|
+
G_DEF_CLASS(CAIRO_GOBJECT_TYPE_DEVICE_TYPE, "DeviceType",
|
137
|
+
RG_TARGET_NAMESPACE);
|
138
|
+
G_DEF_CLASS(CAIRO_GOBJECT_TYPE_SURFACE_TYPE, "SurfaceType",
|
139
|
+
RG_TARGET_NAMESPACE);
|
140
|
+
G_DEF_CLASS(CAIRO_GOBJECT_TYPE_FORMAT, "Format",
|
141
|
+
RG_TARGET_NAMESPACE);
|
142
|
+
G_DEF_CLASS(CAIRO_GOBJECT_TYPE_PATTERN_TYPE, "PatternType",
|
143
|
+
RG_TARGET_NAMESPACE);
|
144
|
+
G_DEF_CLASS(CAIRO_GOBJECT_TYPE_EXTEND, "Extend",
|
145
|
+
RG_TARGET_NAMESPACE);
|
146
|
+
G_DEF_CLASS(CAIRO_GOBJECT_TYPE_FILTER, "Filter",
|
147
|
+
RG_TARGET_NAMESPACE);
|
148
|
+
G_DEF_CLASS(CAIRO_GOBJECT_TYPE_REGION_OVERLAP, "RegionOverlap",
|
149
|
+
RG_TARGET_NAMESPACE);
|
150
|
+
}
|
@@ -0,0 +1,42 @@
|
|
1
|
+
/* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
|
2
|
+
/*
|
3
|
+
* Copyright (C) 2013 Ruby-GNOME2 Project Team
|
4
|
+
*
|
5
|
+
* This library is free software; you can redistribute it and/or
|
6
|
+
* modify it under the terms of the GNU Lesser General Public
|
7
|
+
* License as published by the Free Software Foundation; either
|
8
|
+
* version 2.1 of the License, or (at your option) any later version.
|
9
|
+
*
|
10
|
+
* This library is distributed in the hope that it will be useful,
|
11
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
13
|
+
* Lesser General Public License for more details.
|
14
|
+
*
|
15
|
+
* You should have received a copy of the GNU Lesser General Public
|
16
|
+
* License along with this library; if not, write to the Free Software
|
17
|
+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
18
|
+
* MA 02110-1301 USA
|
19
|
+
*/
|
20
|
+
|
21
|
+
#ifndef RB_CAIRO_GOBJECT_H
|
22
|
+
#define RB_CAIRO_GOBJECT_H
|
23
|
+
|
24
|
+
#include <ruby.h>
|
25
|
+
#include <rbgobject.h>
|
26
|
+
#include <glib-enum-types.h>
|
27
|
+
|
28
|
+
#include <cairo-gobject.h>
|
29
|
+
|
30
|
+
#ifndef CAIRO_GOBJECT_TYPE_HINT_METRICS
|
31
|
+
# define CAIRO_GOBJECT_TYPE_HINT_METRICS CAIRO_GOBJECT_TYPE_HNT_METRICS
|
32
|
+
#endif
|
33
|
+
|
34
|
+
#ifndef CAIRO_GOBJECT_TYPE_TEXT_CLUSTER_FLAGS
|
35
|
+
# define CAIRO_GOBJECT_TYPE_TEXT_CLUSTER_FLAGS cairo_gobject_text_cluster_flags_get_type ()
|
36
|
+
#endif
|
37
|
+
|
38
|
+
#include <rb_cairo.h>
|
39
|
+
|
40
|
+
extern void Init_cairo_gobject(void);
|
41
|
+
|
42
|
+
#endif
|
data/extconf.rb
ADDED
@@ -0,0 +1,71 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# Copyright (C) 2013 Ruby-GNOME2 Project Team
|
4
|
+
#
|
5
|
+
# This library is free software; you can redistribute it and/or
|
6
|
+
# modify it under the terms of the GNU Lesser General Public
|
7
|
+
# License as published by the Free Software Foundation; either
|
8
|
+
# version 2.1 of the License, or (at your option) any later version.
|
9
|
+
#
|
10
|
+
# This library is distributed in the hope that it will be useful,
|
11
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
13
|
+
# Lesser General Public License for more details.
|
14
|
+
#
|
15
|
+
# You should have received a copy of the GNU Lesser General Public
|
16
|
+
# License along with this library; if not, write to the Free Software
|
17
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
18
|
+
|
19
|
+
require "pathname"
|
20
|
+
require "mkmf"
|
21
|
+
require "rbconfig"
|
22
|
+
require "fileutils"
|
23
|
+
|
24
|
+
module_name = "cairo_gobject"
|
25
|
+
package = "cairo-gobject"
|
26
|
+
|
27
|
+
base_dir = Pathname(__FILE__).dirname.expand_path
|
28
|
+
ext_dir = base_dir + "ext" + package
|
29
|
+
mkmf_gnome2_dir = base_dir + 'lib'
|
30
|
+
|
31
|
+
if RbConfig.respond_to?(:ruby)
|
32
|
+
ruby = RbConfig.ruby
|
33
|
+
else
|
34
|
+
ruby = File.join(RbConfig::CONFIG['bindir'],
|
35
|
+
RbConfig::CONFIG['ruby_install_name'] +
|
36
|
+
RbConfig::CONFIG["EXEEXT"])
|
37
|
+
end
|
38
|
+
build_dir = Pathname("ext") + package
|
39
|
+
FileUtils.mkdir_p(build_dir.to_s) unless build_dir.exist?
|
40
|
+
extconf_rb_path = ext_dir + "extconf.rb"
|
41
|
+
unless system(ruby, "-C", build_dir.to_s, extconf_rb_path.to_s, *ARGV)
|
42
|
+
exit(false)
|
43
|
+
end
|
44
|
+
|
45
|
+
create_makefile(module_name)
|
46
|
+
FileUtils.mv("Makefile", "Makefile.lib")
|
47
|
+
|
48
|
+
File.open("Makefile", "w") do |makefile|
|
49
|
+
makefile.puts(<<-EOM)
|
50
|
+
all:
|
51
|
+
(cd ext/#{package} && $(MAKE))
|
52
|
+
$(MAKE) -f Makefile.lib
|
53
|
+
|
54
|
+
install:
|
55
|
+
(cd ext/#{package} && $(MAKE) install)
|
56
|
+
$(MAKE) -f Makefile.lib install
|
57
|
+
|
58
|
+
site-install:
|
59
|
+
(cd ext/#{package} && $(MAKE) site-install)
|
60
|
+
$(MAKE) -f Makefile.lib site-install
|
61
|
+
|
62
|
+
clean:
|
63
|
+
(cd ext/#{package} && $(MAKE) clean)
|
64
|
+
$(MAKE) -f Makefile.lib clean
|
65
|
+
|
66
|
+
distclean:
|
67
|
+
(cd ext/#{package} && $(MAKE) distclean)
|
68
|
+
$(MAKE) -f Makefile.lib distclean
|
69
|
+
@rm -f Makefile.lib
|
70
|
+
EOM
|
71
|
+
end
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# Copyright (C) 2013 Ruby-GNOME2 Project Team
|
2
|
+
#
|
3
|
+
# This library is free software; you can redistribute it and/or
|
4
|
+
# modify it under the terms of the GNU Lesser General Public
|
5
|
+
# License as published by the Free Software Foundation; either
|
6
|
+
# version 2.1 of the License, or (at your option) any later version.
|
7
|
+
#
|
8
|
+
# This library is distributed in the hope that it will be useful,
|
9
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
10
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
11
|
+
# Lesser General Public License for more details.
|
12
|
+
#
|
13
|
+
# You should have received a copy of the GNU Lesser General Public
|
14
|
+
# License along with this library; if not, write to the Free Software
|
15
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
16
|
+
|
17
|
+
require "cairo"
|
18
|
+
require "glib2"
|
19
|
+
|
20
|
+
begin
|
21
|
+
major, minor, _ = RUBY_VERSION.split(/\./)
|
22
|
+
require "#{major}.#{minor}/cairo_gobject.so"
|
23
|
+
rescue LoadError
|
24
|
+
require "cairo_gobject.so"
|
25
|
+
end
|
26
|
+
|
27
|
+
module CairoGObject
|
28
|
+
LOG_DOMAIN = "CairoGObject"
|
29
|
+
GLib::Log.set_log_domain(LOG_DOMAIN)
|
30
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# Copyright (C) 2013 Ruby-GNOME2 Project Team
|
2
|
+
#
|
3
|
+
# This library is free software; you can redistribute it and/or
|
4
|
+
# modify it under the terms of the GNU Lesser General Public
|
5
|
+
# License as published by the Free Software Foundation; either
|
6
|
+
# version 2.1 of the License, or (at your option) any later version.
|
7
|
+
#
|
8
|
+
# This library is distributed in the hope that it will be useful,
|
9
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
10
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
11
|
+
# Lesser General Public License for more details.
|
12
|
+
#
|
13
|
+
# You should have received a copy of the GNU Lesser General Public
|
14
|
+
# License along with this library; if not, write to the Free Software
|
15
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
16
|
+
|
17
|
+
require "test-unit"
|
18
|
+
require "test/unit/notify"
|
19
|
+
|
20
|
+
module CairoGObjectTestUtils
|
21
|
+
end
|