pango 0.20.1 → 0.90.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. data/ChangeLog +16 -0
  2. data/Rakefile +67 -54
  3. data/ext/pango/Makefile +172 -0
  4. data/ext/pango/depend +7 -0
  5. data/ext/pango/extconf.rb +75 -0
  6. data/ext/pango/pango.def +18 -0
  7. data/{src → ext/pango}/rbpango.c +0 -0
  8. data/{src → ext/pango}/rbpango.h +0 -1
  9. data/{src → ext/pango}/rbpangoanalysis.c +0 -0
  10. data/{src → ext/pango}/rbpangoattribute.c +0 -0
  11. data/{src → ext/pango}/rbpangoattriterator.c +0 -0
  12. data/{src → ext/pango}/rbpangoattrlist.c +0 -0
  13. data/{src → ext/pango}/rbpangocairo.c +0 -0
  14. data/{src → ext/pango}/rbpangocolor.c +0 -0
  15. data/{src → ext/pango}/rbpangocontext.c +0 -0
  16. data/{src → ext/pango}/rbpangocoverage.c +0 -0
  17. data/{src → ext/pango}/rbpangoengine.c +0 -0
  18. data/{src → ext/pango}/rbpangofont.c +0 -0
  19. data/{src → ext/pango}/rbpangofontdescription.c +0 -0
  20. data/{src → ext/pango}/rbpangofontface.c +0 -0
  21. data/{src → ext/pango}/rbpangofontfamily.c +0 -0
  22. data/{src → ext/pango}/rbpangofontmap.c +0 -0
  23. data/{src → ext/pango}/rbpangofontmetrics.c +0 -0
  24. data/{src → ext/pango}/rbpangofontset.c +0 -0
  25. data/{src → ext/pango}/rbpangofontsetsimple.c +0 -0
  26. data/{src → ext/pango}/rbpangoglyphinfo.c +0 -0
  27. data/{src → ext/pango}/rbpangoglyphitem.c +0 -0
  28. data/{src → ext/pango}/rbpangoglyphstring.c +0 -0
  29. data/{src → ext/pango}/rbpangogravity.c +0 -0
  30. data/{src → ext/pango}/rbpangoinits.c +0 -0
  31. data/{src → ext/pango}/rbpangoitem.c +0 -0
  32. data/{src → ext/pango}/rbpangolanguage.c +0 -0
  33. data/{src → ext/pango}/rbpangolayout.c +0 -0
  34. data/{src → ext/pango}/rbpangolayoutiter.c +0 -0
  35. data/{src → ext/pango}/rbpangolayoutline.c +0 -0
  36. data/{src → ext/pango}/rbpangologattr.c +0 -0
  37. data/{src → ext/pango}/rbpangomain.c +0 -0
  38. data/{src → ext/pango}/rbpangomatrix.c +0 -0
  39. data/{src → ext/pango}/rbpangorectangle.c +0 -0
  40. data/{src → ext/pango}/rbpangorenderer.c +0 -0
  41. data/{src → ext/pango}/rbpangoscript.c +0 -0
  42. data/{src → ext/pango}/rbpangoscriptiter.c +0 -0
  43. data/{src → ext/pango}/rbpangotabarray.c +0 -0
  44. data/{src → ext/pango}/rbpangoversion.h +24 -24
  45. data/extconf.rb +48 -67
  46. data/{src/lib → lib}/pango.rb +11 -1
  47. data/test/run-test.rb +6 -5
  48. metadata +80 -74
  49. data/sample/cairo.png +0 -0
  50. data/src/makeinits.rb +0 -48
data/ChangeLog CHANGED
@@ -1,3 +1,19 @@
1
+ 2010-09-23 Kouhei Sutou <kou@cozmixng.org>
2
+
3
+ * Rakefile: don't add .zip into gem.
4
+
5
+ * lib/pango.rb: support bundled Windows DLL.
6
+
7
+ * test/run-test.rb: fix extension library path.
8
+
9
+ 2010-09-21 Kouhei Sutou <kou@cozmixng.org>
10
+
11
+ * ./: make buildable by rake-compiler.
12
+
13
+ * src/ -> ext/pango/
14
+
15
+ * src/lib/: -> lib/
16
+
1
17
  2010-02-02 Hiroyuki Ito <ZXB01226@nifty.com>
2
18
 
3
19
  * src/rbpangogravity.c (Init_pango_gravity): remove redundant
data/Rakefile CHANGED
@@ -1,70 +1,83 @@
1
- require 'rake/clean'
2
- CLEAN.include '**/*.o'
3
- CLEAN.include "**/*.#{Config::MAKEFILE_CONFIG['DLEXT']}"
4
- CLOBBER.include 'doc'
5
- CLOBBER.include '**/*.log'
6
- CLOBBER.include '**/Makefile'
7
- CLOBBER.include '**/extconf.h'
1
+ # -*- ruby -*-
8
2
 
9
- # Determine the current version of the software
10
- def ruby_pango_version
11
- "0.20.1"
12
- end
13
-
14
- CURRENT_VERSION = ruby_pango_version
15
-
16
- desc "Default Task (Test project)"
17
- task :default => :test
18
-
19
- # Make tasks -----------------------------------------------------
20
- make_program = (/mswin/ =~ RUBY_PLATFORM) ? 'nmake' : 'make'
21
- MAKECMD = ENV['MAKE_CMD'] || make_program
22
- MAKEOPTS = ENV['MAKE_OPTS'] || ''
3
+ require 'pathname'
4
+ require 'find'
5
+ require 'rubygems'
6
+ require 'rake/extensiontask'
23
7
 
24
- PANGO_SO = "src/pango.#{Config::MAKEFILE_CONFIG['DLEXT']}"
8
+ @top_dir = Pathname(__FILE__).dirname.parent.expand_path
9
+ @rb_glib2_dir = @top_dir + "glib2"
25
10
 
26
- file 'Makefile' => 'extconf.rb' do
27
- sh "ruby extconf.rb #{ENV['EXTCONF_OPTS']}"
28
- end
11
+ task :default => :build
29
12
 
30
- def make(target = '')
31
- pid = system("#{MAKECMD} #{MAKEOPTS} #{target}")
32
- $?.exitstatus
13
+ def version
14
+ @version ||= ENV["VERSION"] || guess_version
33
15
  end
34
16
 
35
- # Let make handle dependencies between c/o/so - we'll just run it.
36
- file PANGO_SO => (['Makefile'] + Dir['src/*.c'] + Dir['src/*.h']) do
37
- m = make
38
- fail "Make failed (status #{m})" unless m == 0
17
+ def guess_version
18
+ versions = {}
19
+ rbglib_h_path = @rb_glib2_dir + "ext" + "glib2" + "rbglib.h"
20
+ rbglib_h_path.open do |rbglib_h|
21
+ rbglib_h.each_line do |line|
22
+ if /#define\s+RBGLIB_([A-Z]+)_VERSION\s+(\d+)/ =~ line
23
+ versions[$1.downcase] = $2.to_i
24
+ end
25
+ end
26
+ end
27
+ ["major", "minor", "micro"].collect {|type| versions[type]}.compact.join(".")
39
28
  end
40
29
 
41
- desc "Configure Pango"
42
- task :configure => ['Makefile']
30
+ package_name = "pango"
43
31
 
44
- desc "Compile the shared object"
45
- task :compile => [PANGO_SO]
32
+ spec = Gem::Specification.new do |s|
33
+ s.name = package_name
34
+ s.summary = "Ruby/Pango is a Ruby binding of pango-1.x."
35
+ s.description = "Ruby/Pango is a Ruby binding of pango-1.x."
36
+ s.author = "The Ruby-GNOME2 Proejct Team"
37
+ s.email = "ruby-gnome2-devel-en@lists.sourceforge.net"
38
+ s.homepage = "http://ruby-gnome2.sourceforge.jp/"
39
+ s.version = version
40
+ s.platform = Gem::Platform::RUBY
41
+ s.add_dependency("cairo", ">= 1.10.0")
42
+ s.add_dependency("glib2", "= #{version}")
43
+ s.extensions = FileList["ext/#{package_name}/extconf.rb"]
44
+ s.require_paths = ["lib"]
45
+ s.files = FileList["ChangeLog", "README", "Rakefile", "extconf.rb",
46
+ "lib/**/*.rb", "{ext,sample,test}/**/*"]
47
+ end
46
48
 
47
- desc "Run pango tests"
48
- task :test => :compile do
49
- sh "ruby test/run-test.rb"
49
+ Rake::GemPackageTask.new(spec) do |pkg|
50
50
  end
51
51
 
52
- desc 'Generate gem specification'
53
- task :gemspec do
54
- require 'erb'
55
- tspec = ERB.new(File.read(File.join(File.dirname(__FILE__),'src','pango.gemspec.erb')))
56
- File.open(File.join(File.dirname(__FILE__),'pango.gemspec'),'wb') do|f|
57
- f << tspec.result
52
+ Rake::ExtensionTask.new(package_name, spec) do |ext|
53
+ ext.cross_compile = true
54
+ ext.cross_compiling do |spec|
55
+ if /mingw|mswin/ =~ spec.platform.to_s
56
+ win32_dir = File.join("vendor", "local")
57
+ win32_files = []
58
+ Find.find(win32_dir) do |file|
59
+ next if /\.zip\z/ =~ file
60
+ win32_files << file
61
+ end
62
+ spec.files += win32_files
63
+ end
58
64
  end
59
65
  end
60
66
 
61
- desc 'Build gem'
62
- task :package => :gemspec do
63
- require 'rubygems/specification'
64
- spec_source = File.read File.join(File.dirname(__FILE__),'pango.gemspec')
65
- spec = nil
66
- # see: http://gist.github.com/16215
67
- Thread.new { spec = eval("$SAFE = 3\n#{spec_source}") }.join
68
- spec.validate
69
- Gem::Builder.new(spec).build
67
+ namespace :win32 do
68
+ desc "download Windows binaries"
69
+ task :download do
70
+ $LOAD_PATH.unshift((@rb_glib2_dir + "lib").to_s)
71
+ require 'gnome2-win32-binary-downloader'
72
+ GNOME2Win32BinaryDownloader.download(:packages => ["glib", "pango"],
73
+ :dependencies => ["gettext-runtime",
74
+ "cairo",
75
+ "cairo-dev",
76
+ "libpng",
77
+ "zlib",
78
+ "expat",
79
+ "expat",
80
+ "fontconfig",
81
+ "freetype"])
82
+ end
70
83
  end
@@ -0,0 +1,172 @@
1
+
2
+ SHELL = /bin/sh
3
+
4
+ #### Start of system configuration section. ####
5
+
6
+ srcdir = Z:/home/kou/work/ruby/ruby-gnome2.win32/pango/src
7
+ topdir = Z:/tmp/local/lib/ruby/1.8/i386-mingw32msvc
8
+ hdrdir = $(topdir)
9
+ VPATH = $(srcdir):$(topdir):$(hdrdir)
10
+
11
+ DESTDIR = Z:
12
+ exec_prefix = $(prefix)
13
+ prefix = $(DESTDIR)/tmp/local
14
+ sharedstatedir = $(prefix)/com
15
+ mandir = $(datarootdir)/man
16
+ psdir = $(docdir)
17
+ oldincludedir = $(DESTDIR)/usr/include
18
+ localedir = $(datarootdir)/locale
19
+ bindir = $(exec_prefix)/bin
20
+ libexecdir = $(exec_prefix)/libexec
21
+ sitedir = $(libdir)/ruby/site_ruby
22
+ htmldir = $(docdir)
23
+ vendorarchdir = $(vendorlibdir)/$(sitearch)
24
+ includedir = $(prefix)/include
25
+ infodir = $(datarootdir)/info
26
+ vendorlibdir = $(vendordir)/$(ruby_version)
27
+ sysconfdir = $(prefix)/etc
28
+ libdir = $(exec_prefix)/lib
29
+ sbindir = $(exec_prefix)/sbin
30
+ rubylibdir = $(libdir)/ruby/$(ruby_version)
31
+ docdir = $(datarootdir)/doc/$(PACKAGE)
32
+ dvidir = $(docdir)
33
+ vendordir = $(libdir)/ruby/vendor_ruby
34
+ datarootdir = $(prefix)/share
35
+ pdfdir = $(docdir)
36
+ archdir = $(rubylibdir)/$(arch)
37
+ sitearchdir = $(sitelibdir)/$(sitearch)
38
+ datadir = $(datarootdir)
39
+ localstatedir = $(prefix)/var
40
+ sitelibdir = $(sitedir)/$(ruby_version)
41
+
42
+ CC = i586-mingw32msvc-gcc
43
+ LIBRUBY = lib$(LIBRUBY_SO).a
44
+ LIBRUBY_A = lib$(RUBY_SO_NAME)-static.a
45
+ LIBRUBYARG_SHARED = -l$(RUBY_SO_NAME)
46
+ LIBRUBYARG_STATIC = -l$(RUBY_SO_NAME)-static
47
+
48
+ RUBY_EXTCONF_H =
49
+ cflags = $(optflags) $(debugflags) $(warnflags)
50
+ optflags = -O2
51
+ debugflags = -g
52
+ warnflags = -Wall -Wno-parentheses
53
+ CFLAGS = $(cflags) -mms-bitfields -I/home/kou/.wine/drive_c/gtk/include/pango-1.0 -I/home/kou/.wine/drive_c/gtk/include/glib-2.0 -I/home/kou/.wine/drive_c/gtk/lib/glib-2.0/include -mms-bitfields -I/home/kou/.wine/drive_c/gtk/include/pango-1.0 -I/home/kou/.wine/drive_c/gtk/include/cairo -I/home/kou/.wine/drive_c/gtk/include/libpng12 -I/home/kou/.wine/drive_c/gtk/include/glib-2.0 -I/home/kou/.wine/drive_c/gtk/lib/glib-2.0/include
54
+ INCFLAGS = -I. -IZ:/home/kou/work/ruby/ruby-gnome2.win32/glib/src -IZ:/home/kou/work/ruby/ruby-gnome2.win32/glib/src -I. -IZ:/tmp/local/lib/ruby/1.8/i386-mingw32msvc -IZ:/home/kou/work/ruby/ruby-gnome2.win32/pango
55
+ DEFS =
56
+ CPPFLAGS = -DHAVE_OBJECT_ALLOCATE -DRUBY_PANGO_COMPILATION -IZ:/tmp/local/lib/ruby/site_ruby/1.8/i386-msvcrt
57
+ CXXFLAGS = $(CFLAGS)
58
+ ldflags = -L. -L/home/kou/.wine/drive_c/gtk/lib -L/home/kou/.wine/drive_c/gtk/lib -LZ:/home/kou/work/ruby/ruby-gnome2.win32/glib/src -LZ:/home/kou/work/ruby/ruby-gnome2.win32/glib/src
59
+ dldflags = -Wl,--enable-auto-image-base,--enable-auto-import,--export-all,--out-implib=libruby-pango.a
60
+ archflag =
61
+ DLDFLAGS = $(ldflags) $(dldflags) $(archflag)
62
+ LDSHARED = i586-mingw32msvc-gcc -shared -s
63
+ AR = i586-mingw32msvc-ar
64
+ EXEEXT = .exe
65
+
66
+ RUBY_INSTALL_NAME = ruby
67
+ RUBY_SO_NAME = msvcrt-ruby18
68
+ arch = i386-mingw32msvc
69
+ sitearch = i386-msvcrt
70
+ ruby_version = 1.8
71
+ ruby = Z:/tmp/local/bin/ruby.exe
72
+ RUBY = $(ruby)
73
+ RM = rm -f
74
+ MAKEDIRS = mkdir -p
75
+ INSTALL = /usr/bin/install -c
76
+ INSTALL_PROG = $(INSTALL) -m 0755
77
+ INSTALL_DATA = $(INSTALL) -m 644
78
+ COPY = cp
79
+
80
+ #### End of system configuration section. ####
81
+
82
+ preload =
83
+
84
+ libpath = . $(libdir)
85
+ LIBPATH = -L. -L$(libdir)
86
+ DEFFILE =
87
+
88
+ CLEANFILES = mkmf.log
89
+ DISTCLEANFILES = rbpangoinits.c rbpangoversion.h
90
+
91
+ extout =
92
+ extout_prefix =
93
+ target_prefix =
94
+ LOCAL_LIBS =
95
+ LIBS = $(LIBRUBYARG_SHARED) -lpango-1.0 -lglib-2.0 -lintl -lgobject-2.0 -lgmodule-2.0 -lpangocairo-1.0 -lpango-1.0 -lglib-2.0 -lintl -lgobject-2.0 -lgmodule-2.0 -lcairo -lruby-glib2 -lruby-glib2 -lshell32 -lwsock32
96
+ SRCS = rbpangoglyphinfo.c rbpangoscript.c rbpangolayout.c rbpangotabarray.c rbpangoattrlist.c rbpangoanalysis.c rbpangorectangle.c rbpangocontext.c rbpangofont.c rbpangologattr.c rbpangocoverage.c rbpangoglyphstring.c rbpangofontdescription.c rbpangolayoutiter.c rbpangoglyphitem.c rbpangofontmap.c rbpangomain.c rbpangofontsetsimple.c rbpangofontface.c rbpangofontset.c rbpangoinits.c rbpangoitem.c rbpangoattribute.c rbpangoscriptiter.c rbpangofontfamily.c rbpangomatrix.c rbpangofontmetrics.c rbpangoengine.c rbpangolanguage.c rbpangolayoutline.c rbpangoattriterator.c rbpango.c rbpangocolor.c rbpangorenderer.c rbpangocairo.c
97
+ OBJS = rbpangoglyphinfo.o rbpangoscript.o rbpangolayout.o rbpangotabarray.o rbpangoattrlist.o rbpangoanalysis.o rbpangorectangle.o rbpangocontext.o rbpangofont.o rbpangologattr.o rbpangocoverage.o rbpangoglyphstring.o rbpangofontdescription.o rbpangolayoutiter.o rbpangoglyphitem.o rbpangofontmap.o rbpangomain.o rbpangofontsetsimple.o rbpangofontface.o rbpangofontset.o rbpangoinits.o rbpangoitem.o rbpangoattribute.o rbpangoscriptiter.o rbpangofontfamily.o rbpangomatrix.o rbpangofontmetrics.o rbpangoengine.o rbpangolanguage.o rbpangolayoutline.o rbpangoattriterator.o rbpango.o rbpangocolor.o rbpangorenderer.o rbpangocairo.o
98
+ TARGET = pango
99
+ DLLIB = $(TARGET).so
100
+ EXTSTATIC =
101
+ STATIC_LIB =
102
+
103
+ BINDIR = $(bindir)
104
+ RUBYCOMMONDIR = $(sitedir)$(target_prefix)
105
+ RUBYLIBDIR = $(sitelibdir)$(target_prefix)
106
+ RUBYARCHDIR = $(sitearchdir)$(target_prefix)
107
+
108
+ TARGET_SO = $(DLLIB)
109
+ CLEANLIBS = $(TARGET).so $(TARGET).il? $(TARGET).tds $(TARGET).map
110
+ CLEANOBJS = *.o *.a *.s[ol] *.pdb *.exp *.bak
111
+
112
+ all: $(DLLIB)
113
+ static: $(STATIC_LIB)
114
+
115
+ clean:
116
+ @-$(RM) $(CLEANLIBS) $(CLEANOBJS) $(CLEANFILES)
117
+
118
+ distclean: clean
119
+ @-$(RM) Makefile $(RUBY_EXTCONF_H) conftest.* mkmf.log
120
+ @-$(RM) core ruby$(EXEEXT) *~ $(DISTCLEANFILES)
121
+
122
+ realclean: distclean
123
+ install: install-so install-rb
124
+
125
+ install-so: $(RUBYARCHDIR)
126
+ install-so: $(RUBYARCHDIR)/$(DLLIB)
127
+ $(RUBYARCHDIR)/$(DLLIB): $(DLLIB)
128
+ $(INSTALL_PROG) $(DLLIB) $(RUBYARCHDIR)
129
+ install-rb: pre-install-rb install-rb-default
130
+ install-rb-default: pre-install-rb-default
131
+ pre-install-rb: Makefile
132
+ pre-install-rb-default: Makefile
133
+ pre-install-rb-default: $(RUBYLIBDIR)
134
+ install-rb-default: $(RUBYLIBDIR)/pango.rb
135
+ $(RUBYLIBDIR)/pango.rb: Z:/home/kou/work/ruby/ruby-gnome2.win32/pango/src/lib/pango.rb $(RUBYLIBDIR)
136
+ $(INSTALL_DATA) Z:/home/kou/work/ruby/ruby-gnome2.win32/pango/src/lib/pango.rb $(@D)
137
+ $(RUBYARCHDIR):
138
+ $(MAKEDIRS) $@
139
+ $(RUBYLIBDIR):
140
+ $(MAKEDIRS) $@
141
+
142
+ site-install: site-install-so site-install-rb
143
+ site-install-so: install-so
144
+ site-install-rb: install-rb
145
+
146
+ .SUFFIXES: .c .m .cc .cxx .cpp .C .o
147
+
148
+ .cc.o:
149
+ $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $<
150
+
151
+ .cxx.o:
152
+ $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $<
153
+
154
+ .cpp.o:
155
+ $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $<
156
+
157
+ .C.o:
158
+ $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $<
159
+
160
+ .c.o:
161
+ $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) -c $<
162
+
163
+ $(DLLIB): $(OBJS)
164
+ @-$(RM) $@
165
+ $(LDSHARED) -o $@ $(OBJS) $(LIBPATH) $(DLDFLAGS) $(LOCAL_LIBS) $(LIBS)
166
+
167
+
168
+
169
+ ###
170
+ install:
171
+ @$(RUBY) -run -e install -- -m 0644 -v $(srcdir)/rbpango.h $(sitearchdir)$(target_prefix)
172
+ @$(RUBY) -run -e install -- -m 0644 -v rbpangoversion.h $(sitearchdir)$(target_prefix)
data/ext/pango/depend ADDED
@@ -0,0 +1,7 @@
1
+ install-so:
2
+ $(INSTALL_DATA) $(srcdir)/rbpango.h $(RUBYARCHDIR)
3
+ $(INSTALL_DATA) rbpangoversion.h $(RUBYARCHDIR)
4
+
5
+ install:
6
+ $(MAKEDIRS) $(libdir)/pkgconfig
7
+ $(INSTALL_DATA) ruby-pango.pc $(libdir)/pkgconfig
@@ -0,0 +1,75 @@
1
+ =begin
2
+ extconf.rb for Ruby/Pango extention library
3
+ =end
4
+
5
+ require 'pathname'
6
+
7
+ base_dir = Pathname(__FILE__).dirname.parent.parent.expand_path
8
+ top_dir = base_dir.parent
9
+ top_build_dir = Pathname(".").parent.parent.parent.expand_path
10
+
11
+ mkmf_gnome2_dir = top_dir + "glib2" + 'lib'
12
+ version_suffix = ""
13
+ unless mkmf_gnome2_dir.exist?
14
+ if /(-\d+\.\d+\.\d+)\z/ =~ base_dir.basename.to_s
15
+ version_suffix = $1
16
+ mkmf_gnome2_dir = top_dir + "glib2#{version_suffix}" + 'lib'
17
+ end
18
+ end
19
+
20
+ $LOAD_PATH.unshift(mkmf_gnome2_dir.to_s)
21
+
22
+ module_name = "pango"
23
+ package_id = "pango"
24
+
25
+ require 'mkmf-gnome2'
26
+
27
+ setup_win32(module_name, base_dir)
28
+
29
+ PKGConfig.have_package(package_id) or exit 1
30
+
31
+ pango_header = "pango/pango.h"
32
+ have_func("pango_layout_iter_get_type", pango_header)
33
+ have_func("pango_layout_set_ellipsize", pango_header)
34
+ have_func("pango_layout_get_font_description", pango_header)
35
+ have_func("pango_render_part_get_type", pango_header)
36
+ have_func("pango_attr_strikethrough_color_new", pango_header)
37
+ have_func("pango_attr_underline_color_new", pango_header)
38
+ have_func("pango_glyph_item_free", pango_header)
39
+ have_func("pango_glyph_item_get_type", pango_header)
40
+ have_func("pango_attr_iterator_get_attrs", pango_header)
41
+ have_func("pango_itemize_with_base_dir", pango_header)
42
+ have_func("pango_font_family_is_monospace", pango_header)
43
+
44
+ if PKGConfig.have_package('pangocairo')
45
+ options = {}
46
+ rcairo_source_dir_names = ["rcairo"]
47
+ if /mingw|cygwin|mswin32/ =~ RUBY_PLATFORM
48
+ rcairo_source_dir_names.unshift("rcairo.win32")
49
+ end
50
+ rcairo_source_dir_names.each do |rcairo_source_dir_name|
51
+ rcairo_source_dir = top_dir.parent.expand_path + rcairo_source_dir_name
52
+ if rcairo_source_dir.exist?
53
+ options[:rcairo_source_dir] = rcairo_source_dir.to_s
54
+ break
55
+ end
56
+ end
57
+ check_cairo(options)
58
+ end
59
+
60
+ ["glib2"].each do |package|
61
+ directory = "#{package}#{version_suffix}"
62
+ build_dir = "#{directory}/tmp/#{RUBY_PLATFORM}/#{package}/#{RUBY_VERSION}"
63
+ add_depend_package(package, "#{directory}/ext/#{package}",
64
+ top_dir.to_s,
65
+ :top_build_dir => top_build_dir.to_s,
66
+ :target_build_dir => build_dir)
67
+ end
68
+
69
+ add_distcleanfile("rbpangoinits.c")
70
+
71
+ make_version_header("PANGO", "pango", ".")
72
+
73
+ create_pkg_config_file("Ruby/Pango", package_id)
74
+ $defs << " -DRUBY_PANGO_COMPILATION"
75
+ create_makefile(module_name)
@@ -0,0 +1,18 @@
1
+ EXPORTS
2
+ Init_pango
3
+ mPango DATA
4
+ attrstring DATA
5
+ pattr DATA
6
+ pattrbool DATA
7
+ pattrcolor DATA
8
+ pattrfloat DATA
9
+ pattrint DATA
10
+ pango_add_attribute
11
+ pango_attr_iter_get_type
12
+ pango_get_attribute
13
+ pango_get_attribute_klass
14
+ pango_item_get_type
15
+ pango_layout_iter_get_type
16
+ pango_layout_line_get_type
17
+ pango_make_attribute
18
+ pango_rectangle_get_type
File without changes
@@ -10,7 +10,6 @@
10
10
  ************************************************/
11
11
 
12
12
  #include "ruby.h"
13
-
14
13
  #define PANGO_ENABLE_ENGINE
15
14
  #define PANGO_ENABLE_BACKEND
16
15
  #include <pango/pango.h>
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1,24 +1,24 @@
1
- /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
- /************************************************
3
-
4
- rbpangoversion.h -
5
-
6
- This file was generated by mkmf-gnome2.rb.
7
-
8
- ************************************************/
9
-
10
- #ifndef __RBPANGO_VERSION_H__
11
- #define __RBPANGO_VERSION_H__
12
-
13
- #define PANGO_MAJOR_VERSION (1)
14
- #define PANGO_MINOR_VERSION (24)
15
- #define PANGO_MICRO_VERSION (5)
16
-
17
- #define PANGO_CHECK_VERSION(major,minor,micro) \
18
- (PANGO_MAJOR_VERSION > (major) || \
19
- (PANGO_MAJOR_VERSION == (major) && PANGO_MINOR_VERSION > (minor)) || \
20
- (PANGO_MAJOR_VERSION == (major) && PANGO_MINOR_VERSION == (minor) && \
21
- PANGO_MICRO_VERSION >= (micro)))
22
-
23
-
24
- #endif /* __RBPANGO_VERSION_H__ */
1
+ /* -*- c-file-style: "ruby"; indent-tabs-mode: nil -*- */
2
+ /************************************************
3
+
4
+ rbpangoversion.h -
5
+
6
+ This file was generated by mkmf-gnome2.rb.
7
+
8
+ ************************************************/
9
+
10
+ #ifndef __RBPANGO_VERSION_H__
11
+ #define __RBPANGO_VERSION_H__
12
+
13
+ #define PANGO_MAJOR_VERSION (1)
14
+ #define PANGO_MINOR_VERSION (20)
15
+ #define PANGO_MICRO_VERSION (5)
16
+
17
+ #define PANGO_CHECK_VERSION(major,minor,micro) \
18
+ (PANGO_MAJOR_VERSION > (major) || \
19
+ (PANGO_MAJOR_VERSION == (major) && PANGO_MINOR_VERSION > (minor)) || \
20
+ (PANGO_MAJOR_VERSION == (major) && PANGO_MINOR_VERSION == (minor) && \
21
+ PANGO_MICRO_VERSION >= (micro)))
22
+
23
+
24
+ #endif /* __RBPANGO_VERSION_H__ */
data/extconf.rb CHANGED
@@ -1,68 +1,49 @@
1
- =begin
2
- extconf.rb for Ruby/Pango extention library
3
- =end
4
-
5
- PACKAGE_NAME = "pango"
6
- PACKAGE_ID = "pango"
7
-
8
- begin
9
- require 'rubygems'
10
- require 'mkmf-gnome2'
11
- USE_GNOME_GEMS = true
12
- TOPDIR = File.expand_path(File.dirname(__FILE__) )
13
- SRCDIR = TOPDIR + '/src'
14
- require 'glib2'
15
- rescue LoadError => e
16
-
17
- USE_GNOME_GEMS = false
18
-
19
- TOPDIR = File.expand_path(File.dirname(__FILE__) + '/..')
20
- MKMF_GNOME2_DIR = TOPDIR + '/glib/src/lib'
21
- SRCDIR = TOPDIR + '/pango/src'
22
-
23
- $LOAD_PATH.unshift MKMF_GNOME2_DIR
24
- $LOAD_PATH << "E:\\ruby\\lib\\ruby\\1.8\\i386-mswin32"
25
-
26
- require 'mkmf-gnome2'
27
-
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'pathname'
4
+ require 'mkmf'
5
+ require 'rbconfig'
6
+ require 'fileutils'
7
+
8
+ package = "pango"
9
+
10
+ base_dir = Pathname(__FILE__).dirname.expand_path
11
+ ext_dir = base_dir + "ext" + package
12
+ mkmf_gnome2_dir = base_dir + 'lib'
13
+
14
+ ruby = File.join(RbConfig::CONFIG['bindir'],
15
+ RbConfig::CONFIG['ruby_install_name'] +
16
+ RbConfig::CONFIG["EXEEXT"])
17
+
18
+ build_dir = Pathname("ext") + package
19
+ FileUtils.mkdir_p(build_dir.to_s) unless build_dir.exist?
20
+ extconf_rb_path = ext_dir + "extconf.rb"
21
+ system(ruby, "-C", build_dir.to_s, extconf_rb_path.to_s, *ARGV) || exit(false)
22
+
23
+ create_makefile(package)
24
+ FileUtils.mv("Makefile", "Makefile.lib")
25
+
26
+ File.open("Makefile", "w") do |makefile|
27
+ makefile.puts(<<-EOM)
28
+ all:
29
+ (cd ext/#{package} && $(MAKE))
30
+ $(MAKE) -f Makefile.lib
31
+
32
+ install:
33
+ (cd ext/#{package} && $(MAKE) install)
34
+ $(MAKE) -f Makefile.lib install
35
+
36
+ site-install:
37
+ (cd ext/#{package} && $(MAKE) site-install)
38
+ $(MAKE) -f Makefile.lib site-install
39
+
40
+ clean:
41
+ (cd ext/#{package} && $(MAKE) clean)
42
+ $(MAKE) -f Makefile.lib clean
43
+
44
+ distclean:
45
+ (cd ext/#{package} && $(MAKE) distclean)
46
+ $(MAKE) -f Makefile.lib distclean
47
+ @rm -f Makefile.lib
48
+ EOM
28
49
  end
29
-
30
- PKGConfig.have_package(PACKAGE_ID) or exit 1
31
- setup_win32(PACKAGE_NAME)
32
-
33
- pango_header = "pango/pango.h"
34
- have_func("pango_layout_iter_get_type", pango_header)
35
- have_func("pango_layout_set_ellipsize", pango_header)
36
- have_func("pango_layout_get_font_description", pango_header)
37
- have_func("pango_render_part_get_type", pango_header)
38
- have_func("pango_attr_strikethrough_color_new", pango_header)
39
- have_func("pango_attr_underline_color_new", pango_header)
40
- have_func("pango_glyph_item_free", pango_header)
41
- have_func("pango_glyph_item_get_type", pango_header)
42
- have_func("pango_attr_iterator_get_attrs", pango_header)
43
- have_func("pango_itemize_with_base_dir", pango_header)
44
- have_func("pango_font_family_is_monospace", pango_header)
45
-
46
- if PKGConfig.have_package('pangocairo')
47
- check_cairo
48
- end
49
-
50
- if USE_GNOME_GEMS
51
- # locate the latest glib2 install and add the package dependency
52
- path = File.dirname(Gem.find_files('rbglib.h').first)
53
- add_depend_package("glib2", path, '/')
54
- else
55
- add_depend_package("glib2", "glib/src", TOPDIR)
56
- end
57
-
58
- add_distcleanfile("rbpangoinits.c")
59
-
60
- make_version_header("PANGO", "pango")
61
-
62
- create_pkg_config_file("Ruby/Pango", PACKAGE_ID)
63
- create_makefile_at_srcdir(PACKAGE_NAME, SRCDIR, "-DRUBY_PANGO_COMPILATION") {
64
- SRCDIR_QUOTED = SRCDIR.gsub(' ', '\ ')
65
- system("#{$ruby} #{SRCDIR_QUOTED}/makeinits.rb #{SRCDIR_QUOTED}/*.c > rbpangoinits.c")
66
- }
67
- create_top_makefile
68
-
@@ -16,7 +16,17 @@ begin
16
16
  end
17
17
  rescue LoadError
18
18
  end
19
- require 'pango.so'
19
+
20
+ base_dir = Pathname.new(__FILE__).dirname.dirname.expand_path
21
+ vendor_dir = base_dir + "vendor" + "local"
22
+ vendor_bin_dir = vendor_dir + "bin"
23
+ GLib.prepend_environment_path(vendor_bin_dir)
24
+ begin
25
+ major, minor, micro, = RUBY_VERSION.split(/\./)
26
+ require "#{major}.#{minor}/pango.so"
27
+ rescue LoadError
28
+ require "pango.so"
29
+ end
20
30
 
21
31
  module Pango
22
32
  LOG_DOMAIN = "Pango"
data/test/run-test.rb CHANGED
@@ -8,15 +8,16 @@ ruby_gnome2_base = File.expand_path(ruby_gnome2_base)
8
8
  glib_base = File.join(ruby_gnome2_base, "glib")
9
9
  pango_base = File.join(ruby_gnome2_base, "pango")
10
10
 
11
- $LOAD_PATH.unshift(glib_base)
12
- require 'test/glib-test-init'
11
+ $LOAD_PATH.unshift(File.join(glib_base, "test"))
12
+ require 'glib-test-init'
13
13
 
14
- [glib_base, pango_base].each do |target|
14
+ [[glib_base, "glib2"],
15
+ [pango_base, "pango"]].each do |target, module_name|
15
16
  if system("which make > /dev/null")
16
17
  `make -C #{target.dump} > /dev/null` or exit(1)
17
18
  end
18
- $LOAD_PATH.unshift(File.join(target, "src"))
19
- $LOAD_PATH.unshift(File.join(target, "src", "lib"))
19
+ $LOAD_PATH.unshift(File.join(target, "ext", module_name))
20
+ $LOAD_PATH.unshift(File.join(target, "lib"))
20
21
  end
21
22
 
22
23
  $LOAD_PATH.unshift(File.join(pango_base, "test"))
metadata CHANGED
@@ -1,133 +1,142 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pango
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 371
4
5
  prerelease: false
5
6
  segments:
6
7
  - 0
7
- - 20
8
- - 1
9
- version: 0.20.1
8
+ - 90
9
+ - 2
10
+ version: 0.90.2
10
11
  platform: ruby
11
12
  authors:
12
- - ruby-gnome2/AUTHORS
13
+ - The Ruby-GNOME2 Proejct Team
13
14
  autorequire:
14
15
  bindir: bin
15
16
  cert_chain: []
16
17
 
17
- date: 2010-07-11 00:00:00 -04:00
18
+ date: 2010-09-25 00:00:00 +09:00
18
19
  default_executable:
19
20
  dependencies:
20
21
  - !ruby/object:Gem::Dependency
21
- name: glib2
22
+ name: cairo
22
23
  prerelease: false
23
24
  requirement: &id001 !ruby/object:Gem::Requirement
24
25
  none: false
25
26
  requirements:
26
27
  - - ">="
27
28
  - !ruby/object:Gem::Version
29
+ hash: 63
28
30
  segments:
31
+ - 1
32
+ - 10
29
33
  - 0
30
- version: "0"
34
+ version: 1.10.0
31
35
  type: :runtime
32
36
  version_requirements: *id001
33
37
  - !ruby/object:Gem::Dependency
34
- name: cairo
38
+ name: glib2
35
39
  prerelease: false
36
40
  requirement: &id002 !ruby/object:Gem::Requirement
37
41
  none: false
38
42
  requirements:
39
- - - ">="
43
+ - - "="
40
44
  - !ruby/object:Gem::Version
45
+ hash: 371
41
46
  segments:
42
47
  - 0
43
- version: "0"
48
+ - 90
49
+ - 2
50
+ version: 0.90.2
44
51
  type: :runtime
45
52
  version_requirements: *id002
46
53
  description: Ruby/Pango is a Ruby binding of pango-1.x.
47
- email: todd.fisher@gmail.com
54
+ email: ruby-gnome2-devel-en@lists.sourceforge.net
48
55
  executables: []
49
56
 
50
57
  extensions:
51
- - extconf.rb
52
- extra_rdoc_files:
53
- - README
58
+ - ext/pango/extconf.rb
59
+ extra_rdoc_files: []
60
+
54
61
  files:
55
62
  - ChangeLog
56
63
  - README
57
64
  - Rakefile
58
65
  - extconf.rb
59
- - src/lib/pango.rb
60
- - src/makeinits.rb
61
- - src/rbpango.c
62
- - src/rbpangoanalysis.c
63
- - src/rbpangoattribute.c
64
- - src/rbpangoattriterator.c
65
- - src/rbpangoattrlist.c
66
- - src/rbpangocairo.c
67
- - src/rbpangocolor.c
68
- - src/rbpangocontext.c
69
- - src/rbpangocoverage.c
70
- - src/rbpangoengine.c
71
- - src/rbpangofont.c
72
- - src/rbpangofontdescription.c
73
- - src/rbpangofontface.c
74
- - src/rbpangofontfamily.c
75
- - src/rbpangofontmap.c
76
- - src/rbpangofontmetrics.c
77
- - src/rbpangofontset.c
78
- - src/rbpangofontsetsimple.c
79
- - src/rbpangoglyphinfo.c
80
- - src/rbpangoglyphitem.c
81
- - src/rbpangoglyphstring.c
82
- - src/rbpangogravity.c
83
- - src/rbpangoinits.c
84
- - src/rbpangoitem.c
85
- - src/rbpangolanguage.c
86
- - src/rbpangolayout.c
87
- - src/rbpangolayoutiter.c
88
- - src/rbpangolayoutline.c
89
- - src/rbpangologattr.c
90
- - src/rbpangomain.c
91
- - src/rbpangomatrix.c
92
- - src/rbpangorectangle.c
93
- - src/rbpangorenderer.c
94
- - src/rbpangoscript.c
95
- - src/rbpangoscriptiter.c
96
- - src/rbpangotabarray.c
97
- - src/rbpango.h
98
- - src/rbpangoversion.h
66
+ - lib/pango.rb
67
+ - ext/pango/rbpangoglyphstring.c
68
+ - ext/pango/rbpango.c
69
+ - ext/pango/rbpangofontmetrics.c
70
+ - ext/pango/rbpangogravity.c
71
+ - ext/pango/rbpangoattribute.c
72
+ - ext/pango/rbpangoglyphinfo.c
73
+ - ext/pango/rbpangoversion.h
74
+ - ext/pango/rbpangoglyphitem.c
75
+ - ext/pango/rbpangolayout.c
76
+ - ext/pango/rbpangoattriterator.c
77
+ - ext/pango/Makefile
78
+ - ext/pango/rbpangoinits.c
79
+ - ext/pango/rbpangoattrlist.c
80
+ - ext/pango/rbpangomain.c
81
+ - ext/pango/rbpangofontsetsimple.c
82
+ - ext/pango/rbpangoscript.c
83
+ - ext/pango/rbpangolanguage.c
84
+ - ext/pango/rbpangofont.c
85
+ - ext/pango/extconf.rb
86
+ - ext/pango/pango.def
87
+ - ext/pango/rbpangofontdescription.c
88
+ - ext/pango/rbpangofontmap.c
89
+ - ext/pango/rbpangologattr.c
90
+ - ext/pango/rbpango.h
91
+ - ext/pango/rbpangolayoutiter.c
92
+ - ext/pango/rbpangofontfamily.c
93
+ - ext/pango/rbpangofontface.c
94
+ - ext/pango/rbpangotabarray.c
95
+ - ext/pango/rbpangoengine.c
96
+ - ext/pango/rbpangocolor.c
97
+ - ext/pango/rbpangoanalysis.c
98
+ - ext/pango/rbpangomatrix.c
99
+ - ext/pango/rbpangocoverage.c
100
+ - ext/pango/rbpangorectangle.c
101
+ - ext/pango/rbpangoscriptiter.c
102
+ - ext/pango/rbpangorenderer.c
103
+ - ext/pango/rbpangocairo.c
104
+ - ext/pango/depend
105
+ - ext/pango/rbpangolayoutline.c
106
+ - ext/pango/rbpangocontext.c
107
+ - ext/pango/rbpangofontset.c
108
+ - ext/pango/rbpangoitem.c
99
109
  - sample/attribute.rb
100
- - sample/break.rb
101
- - sample/cairo.png
102
110
  - sample/gdk_layout.rb
103
- - sample/glyphstring.rb
104
- - sample/item.rb
111
+ - sample/parse.rb
105
112
  - sample/label.rb
106
- - sample/layout.rb
113
+ - sample/break.rb
107
114
  - sample/pango_cairo.rb
108
- - sample/parse.rb
109
115
  - sample/sample.txt
116
+ - sample/layout.rb
117
+ - sample/item.rb
118
+ - sample/glyphstring.rb
110
119
  - sample/script.rb
111
120
  - test/pango-test-utils.rb
112
- - test/run-test.rb
121
+ - test/test_layout.rb
113
122
  - test/test-attribute.rb
123
+ - test/run-test.rb
114
124
  - test/test-language.rb
115
- - test/test_layout.rb
116
125
  has_rdoc: true
117
126
  homepage: http://ruby-gnome2.sourceforge.jp/
118
127
  licenses: []
119
128
 
120
129
  post_install_message:
121
- rdoc_options:
122
- - --main
123
- - README
130
+ rdoc_options: []
131
+
124
132
  require_paths:
125
- - src
133
+ - lib
126
134
  required_ruby_version: !ruby/object:Gem::Requirement
127
135
  none: false
128
136
  requirements:
129
137
  - - ">="
130
138
  - !ruby/object:Gem::Version
139
+ hash: 3
131
140
  segments:
132
141
  - 0
133
142
  version: "0"
@@ -136,19 +145,16 @@ required_rubygems_version: !ruby/object:Gem::Requirement
136
145
  requirements:
137
146
  - - ">="
138
147
  - !ruby/object:Gem::Version
148
+ hash: 3
139
149
  segments:
140
150
  - 0
141
151
  version: "0"
142
152
  requirements: []
143
153
 
144
- rubyforge_project: pango
154
+ rubyforge_project:
145
155
  rubygems_version: 1.3.7
146
156
  signing_key:
147
157
  specification_version: 3
148
- summary: Ruby pango bindings
149
- test_files:
150
- - test/pango-test-utils.rb
151
- - test/run-test.rb
152
- - test/test-attribute.rb
153
- - test/test-language.rb
154
- - test/test_layout.rb
158
+ summary: Ruby/Pango is a Ruby binding of pango-1.x.
159
+ test_files: []
160
+
data/sample/cairo.png DELETED
Binary file
data/src/makeinits.rb DELETED
@@ -1,48 +0,0 @@
1
- =begin
2
- makeinits.rb -
3
-
4
- $Author: mutoh $
5
- $Date: 2005/01/28 09:24:45 $
6
-
7
- Copyright (C) 2002-2005 Masao Mutoh
8
- =end
9
-
10
- except_targets = ["Init_pango()"]
11
-
12
- def print_data(array, type, defs, extern = false)
13
- if array[type]
14
- extern_def = "extern void" if extern
15
- print "##{defs} #{type}\n" if defs
16
- array[type].each do |val|
17
- print "#{extern_def} #{val};\n"
18
- end
19
- print "#endif\n" if defs
20
- end
21
- end
22
-
23
- inits = Hash.new
24
-
25
- while gets
26
- if ~ /^(Init_.*\(.*\))(.*)/
27
- init = $1
28
- unless except_targets.include?(init)
29
- flag = $2
30
- if flag.size > 0
31
- if flag =~ /\/\*\s*(\w*)\s*\*\//
32
- inits[$1] = Array.new unless inits[$1]
33
- inits[$1] << init
34
- end
35
- else
36
- inits[""] = Array.new unless inits[""]
37
- inits[""] << init
38
- end
39
- end
40
- end
41
- end
42
-
43
- print_data(inits, "", nil, true)
44
-
45
- puts "void Init_pango_inits()\n"
46
- puts "{\n"
47
- print_data(inits, "", nil)
48
- puts "}\n"