poppler 0.20.1 → 0.90.2
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +16 -5
- data/README +1 -1
- data/Rakefile +59 -55
- data/ext/poppler/Makefile +155 -0
- data/ext/poppler/depend +3 -0
- data/ext/poppler/extconf.rb +62 -0
- data/ext/poppler/poppler.def +2 -0
- data/{src → ext/poppler}/rbpoppler-action.c +0 -0
- data/{src → ext/poppler}/rbpoppler-annotation.c +0 -0
- data/{src → ext/poppler}/rbpoppler-attachment.c +0 -0
- data/{src → ext/poppler}/rbpoppler-document.c +0 -0
- data/{src → ext/poppler}/rbpoppler-form-field.c +0 -0
- data/{src → ext/poppler}/rbpoppler-page.c +0 -0
- data/{src → ext/poppler}/rbpoppler-private.h +0 -0
- data/{src → ext/poppler}/rbpoppler.c +0 -0
- data/{src → ext/poppler}/rbpoppler.h +3 -6
- data/{src → ext/poppler}/rbpopplerversion.h +2 -2
- data/extconf.rb +48 -47
- data/{src/lib → lib}/poppler.rb +12 -2
- data/test/fixtures/image.pdf +0 -0
- data/test/run-test.rb +7 -5
- metadata +51 -83
data/ChangeLog
CHANGED
@@ -1,10 +1,21 @@
|
|
1
|
-
2010-
|
1
|
+
2010-09-23 Kouhei Sutou <kou@cozmixng.org>
|
2
2
|
|
3
|
-
*
|
4
|
-
because poppler is GPL not LGPL.
|
3
|
+
* Rakefile: don't add .zip into gem.
|
5
4
|
|
6
|
-
*
|
7
|
-
|
5
|
+
* lib/poppler.rb: support bundled Windows DLL.
|
6
|
+
|
7
|
+
* test/run-test.rb: fix extension library path.
|
8
|
+
|
9
|
+
* ext/poppler/rbpoppler.h: don't use rbpopplerverseion.h when
|
10
|
+
Poppler provides version macros.
|
11
|
+
|
12
|
+
* ./: make buildable with rake-compiler.
|
13
|
+
|
14
|
+
2010-09-22 Kouhei Sutou <kou@cozmixng.org>
|
15
|
+
|
16
|
+
* src/: -> ext/poppler/.
|
17
|
+
|
18
|
+
* src/lib/: -> lib/.
|
8
19
|
|
9
20
|
2010-02-10 Kouhei Sutou <kou@cozmixng.org>
|
10
21
|
|
data/README
CHANGED
data/Rakefile
CHANGED
@@ -1,71 +1,75 @@
|
|
1
|
-
|
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
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
CURRENT_VERSION = ruby_poppler_version
|
15
|
-
|
16
|
-
desc "Default Task (Test project)"
|
17
|
-
task :default => :test
|
3
|
+
require 'pathname'
|
4
|
+
require 'find'
|
5
|
+
require 'rubygems'
|
6
|
+
require 'rake/extensiontask'
|
18
7
|
|
19
|
-
|
20
|
-
|
21
|
-
MAKECMD = ENV['MAKE_CMD'] || make_program
|
22
|
-
MAKEOPTS = ENV['MAKE_OPTS'] || ''
|
8
|
+
@top_dir = Pathname(__FILE__).dirname.parent.expand_path
|
9
|
+
@rb_glib2_dir = @top_dir + "glib2"
|
23
10
|
|
24
|
-
|
25
|
-
|
26
|
-
file 'Makefile' => 'extconf.rb' do
|
27
|
-
sh "ruby extconf.rb #{ENV['EXTCONF_OPTS']}"
|
28
|
-
end
|
11
|
+
task :default => :build
|
29
12
|
|
30
|
-
def
|
31
|
-
|
32
|
-
$?.exitstatus
|
13
|
+
def version
|
14
|
+
@version ||= ENV["VERSION"] || guess_version
|
33
15
|
end
|
34
16
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
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
|
-
|
42
|
-
task :configure => ['Makefile']
|
30
|
+
package_name = "poppler"
|
43
31
|
|
44
|
-
|
45
|
-
|
32
|
+
spec = Gem::Specification.new do |s|
|
33
|
+
s.name = package_name
|
34
|
+
s.summary = "Ruby/Poppler is a Ruby binding of poppler-glib."
|
35
|
+
s.description = "Ruby/Poppler is a Ruby binding of poppler-glib."
|
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
|
-
|
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
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
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
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
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 => ["gtk"],
|
73
|
+
:dependencies => ["poppler"])
|
74
|
+
end
|
70
75
|
end
|
71
|
-
|
@@ -0,0 +1,155 @@
|
|
1
|
+
|
2
|
+
SHELL = /bin/sh
|
3
|
+
|
4
|
+
#### Start of system configuration section. ####
|
5
|
+
|
6
|
+
srcdir = /home/kou/work/ruby/ruby-gnome2/poppler/src
|
7
|
+
topdir = /usr/lib/ruby/1.8/x86_64-linux
|
8
|
+
hdrdir = $(topdir)
|
9
|
+
VPATH = $(srcdir):$(topdir):$(hdrdir)
|
10
|
+
prefix = $(DESTDIR)/usr
|
11
|
+
exec_prefix = $(prefix)
|
12
|
+
sitedir = $(DESTDIR)/usr/local/lib/site_ruby
|
13
|
+
rubylibdir = $(libdir)/ruby/$(ruby_version)
|
14
|
+
docdir = $(datarootdir)/doc/$(PACKAGE)
|
15
|
+
dvidir = $(docdir)
|
16
|
+
datarootdir = $(prefix)/share
|
17
|
+
archdir = $(rubylibdir)/$(arch)
|
18
|
+
sbindir = $(exec_prefix)/sbin
|
19
|
+
psdir = $(docdir)
|
20
|
+
localedir = $(datarootdir)/locale
|
21
|
+
htmldir = $(docdir)
|
22
|
+
datadir = $(datarootdir)
|
23
|
+
includedir = $(prefix)/include
|
24
|
+
infodir = $(prefix)/share/info
|
25
|
+
sysconfdir = $(DESTDIR)/etc
|
26
|
+
mandir = $(prefix)/share/man
|
27
|
+
libdir = $(exec_prefix)/lib
|
28
|
+
sharedstatedir = $(prefix)/com
|
29
|
+
oldincludedir = $(DESTDIR)/usr/include
|
30
|
+
pdfdir = $(docdir)
|
31
|
+
sitearchdir = $(sitelibdir)/$(sitearch)
|
32
|
+
bindir = $(exec_prefix)/bin
|
33
|
+
localstatedir = $(DESTDIR)/var
|
34
|
+
sitelibdir = $(sitedir)/$(ruby_version)
|
35
|
+
libexecdir = $(prefix)/lib/ruby1.8
|
36
|
+
|
37
|
+
CC = cc
|
38
|
+
LIBRUBY = $(LIBRUBY_SO)
|
39
|
+
LIBRUBY_A = lib$(RUBY_SO_NAME)-static.a
|
40
|
+
LIBRUBYARG_SHARED = -l$(RUBY_SO_NAME)
|
41
|
+
LIBRUBYARG_STATIC = -l$(RUBY_SO_NAME)-static
|
42
|
+
|
43
|
+
RUBY_EXTCONF_H =
|
44
|
+
CFLAGS = -fPIC -fno-strict-aliasing -g -O2 -fPIC -Wall -DPNG_NO_MMX_CODE -I/usr/include/poppler/glib -I/usr/include/poppler -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pango-1.0 -I/usr/include/freetype2 -I/usr/include/libpng12 -DPNG_NO_MMX_CODE -I/usr/include/cairo -I/usr/include/freetype2 -I/usr/include/libpng12
|
45
|
+
INCFLAGS = -I. -I/home/kou/work/ruby/ruby-gnome2/glib/src -I/home/kou/work/ruby/ruby-gnome2/glib/src -I. -I/usr/lib/ruby/1.8/x86_64-linux -I/home/kou/work/ruby/ruby-gnome2/poppler
|
46
|
+
CPPFLAGS = -DHAVE_RB_DEFINE_ALLOC_FUNC -DHAVE_RB_BLOCK_PROC -DHAVE_OBJECT_ALLOCATE -DHAVE_NODE_ATTRASGN -DHAVE_RB_CAIRO_H -DHAVE_POPPLER_PAGE_RENDER_SELECTION_TO_PIXBUF -DRUBY_POPPLER_COMPILATION -I/usr/local/lib/site_ruby/1.8/x86_64-linux
|
47
|
+
CXXFLAGS = $(CFLAGS)
|
48
|
+
DLDFLAGS = -L. -rdynamic -Wl,-export-dynamic
|
49
|
+
LDSHARED = $(CC) -shared
|
50
|
+
AR = ar
|
51
|
+
EXEEXT =
|
52
|
+
|
53
|
+
RUBY_INSTALL_NAME = ruby1.8
|
54
|
+
RUBY_SO_NAME = ruby1.8
|
55
|
+
arch = x86_64-linux
|
56
|
+
sitearch = x86_64-linux
|
57
|
+
ruby_version = 1.8
|
58
|
+
ruby = /usr/bin/ruby1.8
|
59
|
+
RUBY = $(ruby)
|
60
|
+
RM = rm -f
|
61
|
+
MAKEDIRS = mkdir -p
|
62
|
+
INSTALL = /usr/bin/install -c
|
63
|
+
INSTALL_PROG = $(INSTALL) -m 0755
|
64
|
+
INSTALL_DATA = $(INSTALL) -m 644
|
65
|
+
COPY = cp
|
66
|
+
|
67
|
+
#### End of system configuration section. ####
|
68
|
+
|
69
|
+
preload =
|
70
|
+
|
71
|
+
libpath = . $(libdir)
|
72
|
+
LIBPATH = -L"." -L"$(libdir)"
|
73
|
+
DEFFILE =
|
74
|
+
|
75
|
+
CLEANFILES = mkmf.log
|
76
|
+
DISTCLEANFILES = rbpopplerversion.h
|
77
|
+
|
78
|
+
extout =
|
79
|
+
extout_prefix =
|
80
|
+
target_prefix =
|
81
|
+
LOCAL_LIBS =
|
82
|
+
LIBS = $(LIBRUBYARG_SHARED) -lpoppler-glib -lgdk-x11-2.0 -lgdk_pixbuf-2.0 -lm -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0 -lcairo -lpthread -ldl -lcrypt -lm -lc
|
83
|
+
SRCS = rbpoppler-document.c rbpoppler-page.c rbpoppler-action.c rbpoppler.c rbpoppler-attachment.c
|
84
|
+
OBJS = rbpoppler-document.o rbpoppler-page.o rbpoppler-action.o rbpoppler.o rbpoppler-attachment.o
|
85
|
+
TARGET = poppler
|
86
|
+
DLLIB = $(TARGET).so
|
87
|
+
EXTSTATIC =
|
88
|
+
STATIC_LIB =
|
89
|
+
|
90
|
+
RUBYCOMMONDIR = $(sitedir)$(target_prefix)
|
91
|
+
RUBYLIBDIR = $(sitelibdir)$(target_prefix)
|
92
|
+
RUBYARCHDIR = $(sitearchdir)$(target_prefix)
|
93
|
+
|
94
|
+
TARGET_SO = $(DLLIB)
|
95
|
+
CLEANLIBS = $(TARGET).so $(TARGET).il? $(TARGET).tds $(TARGET).map
|
96
|
+
CLEANOBJS = *.o *.a *.s[ol] *.pdb *.exp *.bak
|
97
|
+
|
98
|
+
all: $(DLLIB)
|
99
|
+
static: $(STATIC_LIB)
|
100
|
+
|
101
|
+
clean:
|
102
|
+
@-$(RM) $(CLEANLIBS) $(CLEANOBJS) $(CLEANFILES)
|
103
|
+
|
104
|
+
distclean: clean
|
105
|
+
@-$(RM) Makefile $(RUBY_EXTCONF_H) conftest.* mkmf.log
|
106
|
+
@-$(RM) core ruby$(EXEEXT) *~ $(DISTCLEANFILES)
|
107
|
+
|
108
|
+
realclean: distclean
|
109
|
+
install: install-so install-rb
|
110
|
+
|
111
|
+
install-so: $(RUBYARCHDIR)
|
112
|
+
install-so: $(RUBYARCHDIR)/$(DLLIB)
|
113
|
+
$(RUBYARCHDIR)/$(DLLIB): $(DLLIB)
|
114
|
+
$(INSTALL_PROG) $(DLLIB) $(RUBYARCHDIR)
|
115
|
+
install-rb: pre-install-rb install-rb-default
|
116
|
+
install-rb-default: pre-install-rb-default
|
117
|
+
pre-install-rb: Makefile
|
118
|
+
pre-install-rb-default: Makefile
|
119
|
+
pre-install-rb-default: $(RUBYLIBDIR)
|
120
|
+
install-rb-default: $(RUBYLIBDIR)/poppler.rb
|
121
|
+
$(RUBYLIBDIR)/poppler.rb: /home/kou/work/ruby/ruby-gnome2/poppler/src/lib/poppler.rb
|
122
|
+
$(INSTALL_DATA) /home/kou/work/ruby/ruby-gnome2/poppler/src/lib/poppler.rb $(@D)
|
123
|
+
$(RUBYARCHDIR):
|
124
|
+
$(MAKEDIRS) $@
|
125
|
+
$(RUBYLIBDIR):
|
126
|
+
$(MAKEDIRS) $@
|
127
|
+
|
128
|
+
site-install: site-install-so site-install-rb
|
129
|
+
site-install-so: install-so
|
130
|
+
site-install-rb: install-rb
|
131
|
+
|
132
|
+
.SUFFIXES: .c .m .cc .cxx .cpp .C .o
|
133
|
+
|
134
|
+
.cc.o:
|
135
|
+
$(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $<
|
136
|
+
|
137
|
+
.cxx.o:
|
138
|
+
$(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $<
|
139
|
+
|
140
|
+
.cpp.o:
|
141
|
+
$(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $<
|
142
|
+
|
143
|
+
.C.o:
|
144
|
+
$(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $<
|
145
|
+
|
146
|
+
.c.o:
|
147
|
+
$(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) -c $<
|
148
|
+
|
149
|
+
$(DLLIB): $(OBJS)
|
150
|
+
@-$(RM) $@
|
151
|
+
$(LDSHARED) -o $@ $(OBJS) $(LIBPATH) $(DLDFLAGS) $(LOCAL_LIBS) $(LIBS)
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
$(OBJS): ruby.h defines.h
|
data/ext/poppler/depend
ADDED
@@ -0,0 +1,62 @@
|
|
1
|
+
=begin
|
2
|
+
extconf.rb for Ruby/Poppler 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 = "poppler"
|
23
|
+
package_id = "poppler-glib"
|
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
|
+
if PKGConfig.have_package('poppler-cairo')
|
32
|
+
options = {}
|
33
|
+
rcairo_source_dir_names = ["rcairo"]
|
34
|
+
if /mingw|cygwin|mswin32/ =~ RUBY_PLATFORM
|
35
|
+
rcairo_source_dir_names.unshift("rcairo.win32")
|
36
|
+
end
|
37
|
+
rcairo_source_dir_names.each do |rcairo_source_dir_name|
|
38
|
+
rcairo_source_dir = top_dir.parent.expand_path + rcairo_source_dir_name
|
39
|
+
if rcairo_source_dir.exist?
|
40
|
+
options[:rcairo_source_dir] = rcairo_source_dir.to_s
|
41
|
+
break
|
42
|
+
end
|
43
|
+
end
|
44
|
+
check_cairo(options)
|
45
|
+
end
|
46
|
+
|
47
|
+
["glib2", "gtk2", "gdk_pixbuf2"].each do |package|
|
48
|
+
directory = "#{package}#{version_suffix}"
|
49
|
+
build_dir = "#{directory}/tmp/#{RUBY_PLATFORM}/#{package}/#{RUBY_VERSION}"
|
50
|
+
add_depend_package(package, "#{directory}/ext/#{package}",
|
51
|
+
top_dir.to_s,
|
52
|
+
:top_build_dir => top_build_dir.to_s,
|
53
|
+
:target_build_dir => build_dir)
|
54
|
+
end
|
55
|
+
|
56
|
+
unless have_macro("POPPLER_MAJOR_VERSION", ["poppler.h"])
|
57
|
+
make_version_header("POPPLER", package_id, ".")
|
58
|
+
end
|
59
|
+
|
60
|
+
create_pkg_config_file("Ruby/Poppler", package_id)
|
61
|
+
$defs << " -DRUBY_POPPLER_COMPILATION"
|
62
|
+
create_makefile(module_name)
|
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,19 +1,16 @@
|
|
1
1
|
#ifndef __RBPOPPLER_H__
|
2
2
|
#define __RBPOPPLER_H__
|
3
3
|
|
4
|
-
#include "rbpopplerversion.h"
|
5
|
-
|
6
4
|
#include <ruby.h>
|
7
5
|
|
8
6
|
#include <rbglib.h>
|
9
7
|
#include <rbgobject.h>
|
10
8
|
|
11
9
|
#include <poppler.h>
|
12
|
-
#include "rbglib.h"
|
13
10
|
|
14
|
-
#
|
15
|
-
#
|
16
|
-
#
|
11
|
+
#ifndef POPPLER_MAJOR_VERSION
|
12
|
+
# include "rbpopplerversion.h"
|
13
|
+
#endif
|
17
14
|
|
18
15
|
#ifndef POPPLER_TYPE_INDEX_ITER
|
19
16
|
# define POPPLER_TYPE_INDEX_ITER (poppler_index_iter_get_type ())
|
@@ -11,8 +11,8 @@
|
|
11
11
|
#define __RBPOPPLER_VERSION_H__
|
12
12
|
|
13
13
|
#define POPPLER_MAJOR_VERSION (0)
|
14
|
-
#define POPPLER_MINOR_VERSION (
|
15
|
-
#define POPPLER_MICRO_VERSION (
|
14
|
+
#define POPPLER_MINOR_VERSION (6)
|
15
|
+
#define POPPLER_MICRO_VERSION (2)
|
16
16
|
|
17
17
|
#define POPPLER_CHECK_VERSION(major,minor,micro) \
|
18
18
|
(POPPLER_MAJOR_VERSION > (major) || \
|
data/extconf.rb
CHANGED
@@ -1,48 +1,49 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'pathname'
|
4
|
+
require 'mkmf'
|
5
|
+
require 'rbconfig'
|
6
|
+
require 'fileutils'
|
7
|
+
|
8
|
+
package = "poppler"
|
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
|
25
49
|
end
|
26
|
-
|
27
|
-
PKGConfig.have_package(PACKAGE_ID, 0, 8, 0) or exit 1
|
28
|
-
setup_win32(PACKAGE_NAME)
|
29
|
-
|
30
|
-
check_cairo
|
31
|
-
|
32
|
-
if USE_GNOME_GEMS
|
33
|
-
add_depend_package("glib2", File.dirname(Gem.find_files('rbglib.h').first), '/')
|
34
|
-
add_depend_package("pango", File.dirname(Gem.find_files('rbpango.h').first), '/')
|
35
|
-
add_depend_package("atk", File.dirname(Gem.find_files('rbatk.h').first), '/')
|
36
|
-
add_depend_package("gdkpixbuf2", File.dirname(Gem.find_files('rbgdk-pixbuf.h').first), '/')
|
37
|
-
add_depend_package("gtk2", File.dirname(Gem.find_files('rbgtk.h').first), '/')
|
38
|
-
else
|
39
|
-
add_depend_package("glib2", "glib/src", TOPDIR)
|
40
|
-
add_depend_package("gtk2", "gtk/src", TOPDIR)
|
41
|
-
add_depend_package("gdk_pixbuf2", "gdkpixbuf", TOPDIR)
|
42
|
-
end
|
43
|
-
|
44
|
-
make_version_header("POPPLER", PACKAGE_ID)
|
45
|
-
|
46
|
-
create_pkg_config_file("Ruby/Poppler", PACKAGE_ID)
|
47
|
-
create_makefile_at_srcdir(PACKAGE_NAME, SRCDIR, "-DRUBY_POPPLER_COMPILATION")
|
48
|
-
create_top_makefile
|
data/{src/lib → lib}/poppler.rb
RENAMED
@@ -17,7 +17,7 @@ require "date"
|
|
17
17
|
require "glib2"
|
18
18
|
require "gdk_pixbuf2"
|
19
19
|
begin
|
20
|
-
require "gtk2
|
20
|
+
require "gtk2"
|
21
21
|
rescue LoadError
|
22
22
|
rescue
|
23
23
|
if defined?(Gtk::InitError) and $!.class == Gtk::InitError
|
@@ -30,7 +30,17 @@ begin
|
|
30
30
|
require "cairo"
|
31
31
|
rescue LoadError
|
32
32
|
end
|
33
|
-
|
33
|
+
|
34
|
+
base_dir = Pathname.new(__FILE__).dirname.dirname.expand_path
|
35
|
+
vendor_dir = base_dir + "vendor" + "local"
|
36
|
+
vendor_bin_dir = vendor_dir + "bin"
|
37
|
+
GLib.prepend_environment_path(vendor_bin_dir)
|
38
|
+
begin
|
39
|
+
major, minor, micro, = RUBY_VERSION.split(/\./)
|
40
|
+
require "#{major}.#{minor}/poppler.so"
|
41
|
+
rescue LoadError
|
42
|
+
require "poppler.so"
|
43
|
+
end
|
34
44
|
|
35
45
|
module Poppler
|
36
46
|
LOG_DOMAIN = "Poppler"
|
Binary file
|
data/test/run-test.rb
CHANGED
@@ -9,12 +9,14 @@ end
|
|
9
9
|
glib_dir = File.expand_path(File.join(base_dir, "..", "glib"))
|
10
10
|
gtk_dir = File.expand_path(File.join(base_dir, "..", "gtk"))
|
11
11
|
|
12
|
-
$LOAD_PATH.unshift(glib_dir)
|
13
|
-
require '
|
12
|
+
$LOAD_PATH.unshift(File.join(glib_dir, "test"))
|
13
|
+
require 'glib-test-init'
|
14
14
|
|
15
|
-
[gtk_dir,
|
16
|
-
|
17
|
-
|
15
|
+
[[gtk_dir, "gtk2"],
|
16
|
+
[glib_dir, "glib2"],
|
17
|
+
[base_dir, "poppler"]].each do |dir, module_name|
|
18
|
+
$LOAD_PATH.unshift(File.join(dir, "ext", module_name))
|
19
|
+
$LOAD_PATH.unshift(File.join(dir, "lib"))
|
18
20
|
end
|
19
21
|
require "poppler"
|
20
22
|
|
metadata
CHANGED
@@ -1,138 +1,111 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: poppler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
+
hash: 371
|
4
5
|
prerelease: false
|
5
6
|
segments:
|
6
7
|
- 0
|
7
|
-
-
|
8
|
-
-
|
9
|
-
version: 0.
|
8
|
+
- 90
|
9
|
+
- 2
|
10
|
+
version: 0.90.2
|
10
11
|
platform: ruby
|
11
12
|
authors:
|
12
|
-
-
|
13
|
+
- The Ruby-GNOME2 Proejct Team
|
13
14
|
autorequire:
|
14
15
|
bindir: bin
|
15
16
|
cert_chain: []
|
16
17
|
|
17
|
-
date: 2010-
|
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:
|
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:
|
34
|
+
version: 1.10.0
|
31
35
|
type: :runtime
|
32
36
|
version_requirements: *id001
|
33
37
|
- !ruby/object:Gem::Dependency
|
34
|
-
name:
|
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
|
-
|
48
|
+
- 90
|
49
|
+
- 2
|
50
|
+
version: 0.90.2
|
44
51
|
type: :runtime
|
45
52
|
version_requirements: *id002
|
46
|
-
- !ruby/object:Gem::Dependency
|
47
|
-
name: pango
|
48
|
-
prerelease: false
|
49
|
-
requirement: &id003 !ruby/object:Gem::Requirement
|
50
|
-
none: false
|
51
|
-
requirements:
|
52
|
-
- - ">="
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
segments:
|
55
|
-
- 0
|
56
|
-
version: "0"
|
57
|
-
type: :runtime
|
58
|
-
version_requirements: *id003
|
59
|
-
- !ruby/object:Gem::Dependency
|
60
|
-
name: cairo
|
61
|
-
prerelease: false
|
62
|
-
requirement: &id004 !ruby/object:Gem::Requirement
|
63
|
-
none: false
|
64
|
-
requirements:
|
65
|
-
- - ">="
|
66
|
-
- !ruby/object:Gem::Version
|
67
|
-
segments:
|
68
|
-
- 0
|
69
|
-
version: "0"
|
70
|
-
type: :runtime
|
71
|
-
version_requirements: *id004
|
72
|
-
- !ruby/object:Gem::Dependency
|
73
|
-
name: gtk2
|
74
|
-
prerelease: false
|
75
|
-
requirement: &id005 !ruby/object:Gem::Requirement
|
76
|
-
none: false
|
77
|
-
requirements:
|
78
|
-
- - ">="
|
79
|
-
- !ruby/object:Gem::Version
|
80
|
-
segments:
|
81
|
-
- 0
|
82
|
-
version: "0"
|
83
|
-
type: :runtime
|
84
|
-
version_requirements: *id005
|
85
53
|
description: Ruby/Poppler is a Ruby binding of poppler-glib.
|
86
|
-
email:
|
54
|
+
email: ruby-gnome2-devel-en@lists.sourceforge.net
|
87
55
|
executables: []
|
88
56
|
|
89
57
|
extensions:
|
90
|
-
- extconf.rb
|
91
|
-
extra_rdoc_files:
|
92
|
-
|
58
|
+
- ext/poppler/extconf.rb
|
59
|
+
extra_rdoc_files: []
|
60
|
+
|
93
61
|
files:
|
94
62
|
- ChangeLog
|
95
63
|
- README
|
96
64
|
- Rakefile
|
97
65
|
- extconf.rb
|
98
|
-
-
|
99
|
-
-
|
100
|
-
-
|
101
|
-
-
|
102
|
-
-
|
103
|
-
-
|
104
|
-
-
|
105
|
-
-
|
106
|
-
-
|
107
|
-
-
|
108
|
-
-
|
109
|
-
-
|
110
|
-
-
|
66
|
+
- lib/poppler.rb
|
67
|
+
- ext/poppler/rbpoppler-attachment.c
|
68
|
+
- ext/poppler/rbpoppler.h
|
69
|
+
- ext/poppler/rbpoppler.c
|
70
|
+
- ext/poppler/Makefile
|
71
|
+
- ext/poppler/rbpoppler-page.c
|
72
|
+
- ext/poppler/extconf.rb
|
73
|
+
- ext/poppler/rbpoppler-form-field.c
|
74
|
+
- ext/poppler/rbpopplerversion.h
|
75
|
+
- ext/poppler/rbpoppler-action.c
|
76
|
+
- ext/poppler/rbpoppler-annotation.c
|
77
|
+
- ext/poppler/rbpoppler-private.h
|
78
|
+
- ext/poppler/poppler.def
|
79
|
+
- ext/poppler/depend
|
80
|
+
- ext/poppler/rbpoppler-document.c
|
111
81
|
- sample/pdf2svg.rb
|
112
82
|
- sample/pdf2text.rb
|
83
|
+
- sample/pdf2.rb
|
84
|
+
- sample/number-pdf.rb
|
113
85
|
- sample/pdfdiv.rb
|
86
|
+
- test/test_document.rb
|
114
87
|
- test/poppler-test-utils.rb
|
88
|
+
- test/test_page.rb
|
115
89
|
- test/run-test.rb
|
116
|
-
- test/
|
90
|
+
- test/fixtures/image.pdf
|
117
91
|
- test/test_color.rb
|
118
92
|
- test/test_constants.rb
|
119
|
-
- test/
|
120
|
-
- test/test_page.rb
|
93
|
+
- test/test_annotation.rb
|
121
94
|
has_rdoc: true
|
122
95
|
homepage: http://ruby-gnome2.sourceforge.jp/
|
123
96
|
licenses: []
|
124
97
|
|
125
98
|
post_install_message:
|
126
|
-
rdoc_options:
|
127
|
-
|
128
|
-
- README
|
99
|
+
rdoc_options: []
|
100
|
+
|
129
101
|
require_paths:
|
130
|
-
-
|
102
|
+
- lib
|
131
103
|
required_ruby_version: !ruby/object:Gem::Requirement
|
132
104
|
none: false
|
133
105
|
requirements:
|
134
106
|
- - ">="
|
135
107
|
- !ruby/object:Gem::Version
|
108
|
+
hash: 3
|
136
109
|
segments:
|
137
110
|
- 0
|
138
111
|
version: "0"
|
@@ -141,21 +114,16 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
141
114
|
requirements:
|
142
115
|
- - ">="
|
143
116
|
- !ruby/object:Gem::Version
|
117
|
+
hash: 3
|
144
118
|
segments:
|
145
119
|
- 0
|
146
120
|
version: "0"
|
147
121
|
requirements: []
|
148
122
|
|
149
|
-
rubyforge_project:
|
123
|
+
rubyforge_project:
|
150
124
|
rubygems_version: 1.3.7
|
151
125
|
signing_key:
|
152
126
|
specification_version: 3
|
153
|
-
summary: Ruby poppler
|
154
|
-
test_files:
|
155
|
-
|
156
|
-
- test/run-test.rb
|
157
|
-
- test/test_annotation.rb
|
158
|
-
- test/test_color.rb
|
159
|
-
- test/test_constants.rb
|
160
|
-
- test/test_document.rb
|
161
|
-
- test/test_page.rb
|
127
|
+
summary: Ruby/Poppler is a Ruby binding of poppler-glib.
|
128
|
+
test_files: []
|
129
|
+
|