swfmill 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/VERSION +1 -1
  2. data/ext/extconf.rb +73 -20
  3. metadata +6 -7
  4. data/.gitignore +0 -23
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.3
1
+ 0.0.4
@@ -100,35 +100,88 @@ have_library("stdc++")
100
100
 
101
101
  $INCFLAGS += " -I./swfmill/src -I./swfmill/src/swft -I./swfmill/src/xslt -I./libb64/include"
102
102
 
103
- Dir.chdir("swfmill") do
104
- cmd = <<CMD
105
- sh configure --config-cache --disable-dependency-tracking \
106
- FREETYPE_CFLAGS="#{$FREETYPE_CFLAGS}" FREETYPE_LIBS="#{$FREETYPE_LIBS}" \
107
- XML_CFLAGS="#{$XML_CFLAGS}" XML_LIBS="#{$XML_LIBS}" \
108
- XSLT_CFLAGS="#{$XSLT_CFLAGS}" XSLT_LIBS="#{$XSLT_LIBS}" \
109
- PNG_CFLAGS="#{$PNG_CFLAGS}" PNG_LIBS="#{$PNG_LIBS}" \
110
- --with-pic \
111
- --enable-shared \
112
- CFLAGS="-fPIC -O3" \
113
- CXXFLAGS="-fPIC -O3 -finline -finline-functions"
114
- CMD
115
- raise "error: #{cmd}" unless system(cmd)
103
+ Dir.chdir("libb64") do
116
104
  cmd = "make"
117
105
  raise "error: #{cmd}" unless system(cmd)
118
106
  end
119
107
 
120
- Dir.chdir("libb64") do
121
- cmd = "make"
108
+ Dir.chdir("swfmill/src") do
109
+ cmd = "xsltproc codegen/mk.xsl codegen/source.xml"
122
110
  raise "error: #{cmd}" unless system(cmd)
111
+
112
+ namespaces = 'xmlns:swft="http://subsignal.org/swfml/swft" '
113
+ namespaces << 'xmlns:str="http://exslt.org/strings" '
114
+ namespaces << 'xmlns:math="http://exslt.org/math"'
115
+
116
+ simple = %x"xsltproc xslt/assemble.xsl xslt/simple.xml"
117
+ File.open("simple.cpp", "wb") do |f|
118
+ f.puts '#include "xslt/xslt.h"'
119
+ f.puts 'const char *xslt_simple = '
120
+ f.puts simple.sub(/namespaces="hack"/, namespaces).gsub(/"/, '\"').gsub(/^.*$/){ |m| '"' + m + '\n"' }
121
+ f.puts ';'
122
+ end
123
123
  end
124
124
 
125
125
  create_makefile("swfmill_ext")
126
- File.open(File.dirname("__FILE__") + "/Makefile", "ab") do |f|
127
- exclude = ['swfmill/src/swfmill-base64.o']
128
- objects = Dir["swfmill/src/**/*.o"] - exclude
129
- f.puts "OBJS += #{objects.join(" ")}"
130
- end
131
126
 
132
127
  File.open(File.dirname("__FILE__") + "/Makefile", "ab") do |f|
133
128
  f.puts "OBJS += libb64/src/cdecode.o libb64/src/cencode.o"
134
129
  end
130
+
131
+ swfmill_files = <<FILES.split.map{|file| file.chomp}
132
+ swfmill/src/gSWFBasics.cpp
133
+ swfmill/src/gSWFDumper.cpp
134
+ swfmill/src/gSWFParseXML.cpp
135
+ swfmill/src/gSWFParser.cpp
136
+ swfmill/src/gSWFSize.cpp
137
+ swfmill/src/gSWFWriteXML.cpp
138
+ swfmill/src/gSWFWriter.cpp
139
+ swfmill/src/Geom.cpp
140
+ swfmill/src/SWFAction.cpp
141
+ swfmill/src/SWFFile.cpp
142
+ swfmill/src/SWFFilter.cpp
143
+ swfmill/src/SWFGlyphList.cpp
144
+ swfmill/src/SWFItem.cpp
145
+ swfmill/src/SWFReader.cpp
146
+ swfmill/src/SWFShapeItem.cpp
147
+ swfmill/src/SWFShapeMaker.cpp
148
+ swfmill/src/SWFTag.cpp
149
+ swfmill/src/SWFTrait.cpp
150
+ swfmill/src/SWFWriter.cpp
151
+ swfmill/src/simple.cpp
152
+ swfmill/src/swft/Parser.cpp
153
+ swfmill/src/swft/SVGAttributeParser.cpp
154
+ swfmill/src/swft/SVGColor.cpp
155
+ swfmill/src/swft/SVGGradient.cpp
156
+ swfmill/src/swft/SVGPathParser.cpp
157
+ swfmill/src/swft/SVGPointsParser.cpp
158
+ swfmill/src/swft/SVGStyle.cpp
159
+ swfmill/src/swft/SVGTransformParser.cpp
160
+ swfmill/src/swft/readpng.c
161
+ swfmill/src/swft/swft.cpp
162
+ swfmill/src/swft/swft_document.cpp
163
+ swfmill/src/swft/swft_import.cpp
164
+ swfmill/src/swft/swft_import_binary.cpp
165
+ swfmill/src/swft/swft_import_jpeg.cpp
166
+ swfmill/src/swft/swft_import_mp3.cpp
167
+ swfmill/src/swft/swft_import_png.cpp
168
+ swfmill/src/swft/swft_import_ttf.cpp
169
+ swfmill/src/swft/swft_import_wav.cpp
170
+ swfmill/src/swft/swft_path.cpp
171
+ FILES
172
+
173
+ data = File.open(File.dirname("__FILE__") + "/Makefile", "rb"){ |f| f.read }
174
+ data.gsub!(/^OBJS = .*\n/) do |m|
175
+ objs = swfmill_files.map{ |e| File.join(File.dirname(e), File.basename(e, ".*") + ".o") }
176
+ m << "OBJS+= " << objs.join(" ") << "\n"
177
+ end
178
+ swfmill_files.each do |e|
179
+ o = File.join(File.dirname(e), File.basename(e, ".*") + ".o")
180
+ data << "#{o}: #{e}\n"
181
+ if e =~ /cpp\Z/
182
+ data << "\t$(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) -o $@ -c $<\n"
183
+ else
184
+ data << "\t$(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) -o $@ -c $<\n"
185
+ end
186
+ end
187
+ File.open(File.dirname("__FILE__") + "/Makefile", "wb") { |f| f.write data }
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: swfmill
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 23
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 3
10
- version: 0.0.3
9
+ - 4
10
+ version: 0.0.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - miyucy
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-09-17 00:00:00 +09:00
18
+ date: 2010-11-17 00:00:00 +09:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -45,7 +45,6 @@ extra_rdoc_files:
45
45
  - README.rdoc
46
46
  files:
47
47
  - .document
48
- - .gitignore
49
48
  - .swfmill
50
49
  - LICENSE
51
50
  - README.rdoc
@@ -205,8 +204,8 @@ homepage: http://github.com/miyucy/swfmill
205
204
  licenses: []
206
205
 
207
206
  post_install_message:
208
- rdoc_options:
209
- - --charset=UTF-8
207
+ rdoc_options: []
208
+
210
209
  require_paths:
211
210
  - lib
212
211
  required_ruby_version: !ruby/object:Gem::Requirement
data/.gitignore DELETED
@@ -1,23 +0,0 @@
1
- ## MAC OS
2
- .DS_Store
3
-
4
- ## TEXTMATE
5
- *.tmproj
6
- tmtags
7
-
8
- ## EMACS
9
- *~
10
- \#*
11
- .\#*
12
-
13
- ## VIM
14
- *.swp
15
-
16
- ## PROJECT::GENERAL
17
- coverage
18
- rdoc
19
- pkg
20
-
21
- ## PROJECT::SPECIFIC
22
- swfmill.gemspec
23
- lib/swfmill_ext.so