libyajl2 0.1.16 → 0.1.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 701cf9abb802d677204fc78609ca886a73c36d8c
4
- data.tar.gz: 092e2ee7f218d5be4b8fc9ca21f9ea9e16061c14
3
+ metadata.gz: 0222174194de7fe3d97647c4ae36f05291600292
4
+ data.tar.gz: aee3ce42d2dbea873ca1ebb679fe7257d898b249
5
5
  SHA512:
6
- metadata.gz: bca24849619f450aea3f7dd63fbab3dd4a1f1d17ea0ae0a8110a524938360a3182e3a08fd55f89ef0fbfd460e238c2c055fcc994023277fb4b8c645b91051538
7
- data.tar.gz: 1006169fe3fb826b79557d6a5a35b26d1201aa8df0180f74790964585a931dfc4e2951dc8f0f2366f40c40b58b3d0230dfb29e9276056751a2e31db931435487
6
+ metadata.gz: db3188ee1f24819652ffd52f796010765ff3c1ae6b7cbbfbe5e6146a7d4cf2b123da86cb54826034ee3a51d2d5314c8dc7c94137417188ef0adebb40c60fe6b0
7
+ data.tar.gz: 526218da5db57efc70c19853f42b3ce8773475703f83f12ca244fc28e8ee2a9d931d81bdc62a49977ef5d2e9672da9db550c8cfb3d41be5d92427c35f7fddec4
data/Gemfile CHANGED
@@ -10,3 +10,9 @@ group :development_extras do
10
10
  gem 'kitchen-ec2'
11
11
  gem 'kitchen-vagrant'
12
12
  end
13
+
14
+ platforms :rbx do
15
+ gem 'racc'
16
+ gem 'rubysl', '~> 2.0'
17
+ gem 'psych'
18
+ end
data/Rakefile CHANGED
@@ -84,12 +84,12 @@ task :prep do
84
84
  FileUtils.cp Dir["#{vendor_src_path}/*.h"], build_path
85
85
 
86
86
  # the *.c files need api/yajl_foo.h headers
87
- Dir.mkdir "#{build_path}/api" unless Dir.exist?("#{build_path}/api")
87
+ Dir.mkdir "#{build_path}/api" unless File.exist?("#{build_path}/api")
88
88
  FileUtils.cp Dir["#{vendor_src_path}/api/*.h"], "#{build_path}/api"
89
89
 
90
90
  # the header files need yajl/yajl_foo.h headers (and windows symlinks
91
91
  # are a bit of a PITA so just copy them all)
92
- Dir.mkdir "#{build_path}/yajl" unless Dir.exist?("#{build_path}/yajl")
92
+ Dir.mkdir "#{build_path}/yajl" unless File.exist?("#{build_path}/yajl")
93
93
  FileUtils.cp Dir["#{vendor_src_path}/api/*.h"], "#{build_path}/yajl"
94
94
 
95
95
  # apply patches that haven't yet been pushed upstream
@@ -102,6 +102,15 @@ task :prep do
102
102
  generate_yajl_version
103
103
  end
104
104
 
105
+ desc "Deploy headers (for after compile)"
106
+ task :headers do
107
+ include_path = File.expand_path("../lib/libyajl2/vendored-libyajl2/include/yajl", __FILE__)
108
+ build_path = File.expand_path("../ext/libyajl2", __FILE__)
109
+
110
+ FileUtils.mkdir_p(include_path)
111
+ FileUtils.cp Dir["#{build_path}/api/*.h"], include_path
112
+ end
113
+
105
114
  #
106
115
  # FIXME: need a rake task to update the git submodule and need to do that before shipping
107
116
  #
@@ -205,9 +214,9 @@ desc 'Run all style checks'
205
214
  task :style => ['style:rubocop', 'style:reek']
206
215
 
207
216
  desc 'Run style + spec tests by default on travis'
208
- task :travis => ['prep', 'compile', 'spec', 'style']
217
+ task :travis => ['spec', 'style']
209
218
 
210
219
  desc 'Run style, spec and test kichen on travis'
211
- task :travis_all => ['prep', 'compile', 'spec', 'integration:cloud', 'style']
220
+ task :travis_all => ['spec', 'integration:cloud', 'style']
212
221
 
213
- task :default => ['prep', 'compile', 'spec', 'integration:vagrant', 'style']
222
+ task :default => ['spec', 'integration:vagrant', 'style']
@@ -2,7 +2,6 @@ exit(0) if ENV["USE_SYSTEM_LIBYAJL2"]
2
2
 
3
3
  require 'rbconfig'
4
4
  require 'fileutils'
5
- require 'mkmf'
6
5
 
7
6
  module Libyajl2Build
8
7
  class BuildError < StandardError; end
@@ -23,6 +22,10 @@ module Libyajl2Build
23
22
  PREFIX
24
23
  end
25
24
 
25
+ def self.deps
26
+ require 'mkmf'
27
+ end
28
+
26
29
  def self.setup_env
27
30
  RbConfig::MAKEFILE_CONFIG['CC'] = ENV['CC'] if ENV['CC']
28
31
 
@@ -42,36 +45,65 @@ module Libyajl2Build
42
45
  end
43
46
 
44
47
  def self.makemakefiles
45
- setup_env
46
- dir_config("libyajl")
47
- create_makefile("libyajl")
48
-
49
- # on windows the Makefile will try to export Init_libyajl which is wrong because we aren't a ruby lib.
50
- # i could not figure out how to tell mkmf.rb to stop being so helpful, so instead will just patch it here.
51
- if windows?
52
- makefile = IO.read("Makefile")
53
- makefile.gsub!(/\$\(DEFFILE\)/, '')
54
- File.open("Makefile", 'w+') {|f| f.write(makefile) }
55
- end
48
+ if RUBY_PLATFORM == "java"
49
+ File.open("Makefile", "w+") do |f|
50
+ f.write <<EOF
51
+ CC = gcc
52
+ TARGET = libyajl
53
+ DLLIB = $(TARGET).so
54
+ CFLAGS = -I. -I../../../../ext/libyajl2 -fPIC -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -fPIC -std=c99 -pedantic -Wpointer-arith -Wno-format-y2k -Wstrict-prototypes -Wmissing-declarations -Wnested-externs -Wextra -Wundef -Wwrite-strings -Wold-style-definition -Wredundant-decls -Wno-unused-parameter -Wno-sign-compare -Wmissing-prototypes -O2 -DNDEBUG
55
+ LDFLAGS = -L. -fstack-protector -rdynamic -Wl,-export-dynamic
56
+ LIBS = -lpthread -ldl -lcrypt -lm -lc
57
+ OBJS = yajl_alloc.o yajl_tree.o yajl_gen.o yajl_buf.o yajl.o yajl_encode.o yajl_lex.o yajl_parser.o yajl_version.o
56
58
 
57
- # we cheat and build it right away...
58
- system("make V=1")
59
- # ...so we can hack up what install does later and copy over the include files
59
+ all: $(DLLIB)
60
60
 
61
- # not sure why ruby windows produces .so's instead of .dll's
62
- if windows?
63
- FileUtils.mv "libyajl.so", "yajl.dll"
64
- end
61
+ $(DLLIB): $(OBJS)
62
+ \t$(CC) -shared -o $(DLLIB) $(OBJS) $(LDFLAGS) $(LIBS)
63
+
64
+ %.o: ../../../../ext/libyajl2/%.c
65
+ \t$(COMPILE.c) $(OUTPUT_OPTION) $<
65
66
 
66
- File.open("Makefile", "w+") do |f|
67
- f.write <<EOF
67
+ install:
68
+ \tmkdir -p #{prefix}/lib
69
+ \tcp $(DLLIB) #{prefix}/lib/$(DLLIB)
70
+ \tmkdir -p #{prefix}/include/yajl
71
+ \tcp yajl/*.h #{prefix}/include/yajl
72
+ EOF
73
+ end
74
+ else
75
+ deps
76
+ setup_env
77
+ dir_config("libyajl")
78
+ create_makefile("libyajl")
79
+
80
+ # on windows the Makefile will try to export Init_libyajl which is wrong because we aren't a ruby lib.
81
+ # i could not figure out how to tell mkmf.rb to stop being so helpful, so instead will just patch it here.
82
+ if windows?
83
+ makefile = IO.read("Makefile")
84
+ makefile.gsub!(/\$\(DEFFILE\)/, '')
85
+ File.open("Makefile", 'w+') {|f| f.write(makefile) }
86
+ end
87
+
88
+ system("pwd")
89
+ # we cheat and build it right away...
90
+ system("make >make.out 2>&1") || raise # rubinius doesn't like the output this generates
91
+ # ...so we can hack up what install does later and copy over the include files
92
+
93
+ # not sure why ruby windows produces .so's instead of .dll's
94
+ if windows?
95
+ FileUtils.mv "libyajl.so", "yajl.dll"
96
+ end
97
+
98
+ File.open("Makefile", "w+") do |f|
99
+ f.write <<EOF
68
100
  TARGET = libyajl
69
101
  DLLIB = $(TARGET).#{RbConfig::MAKEFILE_CONFIG['DLEXT']}
70
102
  all:
71
103
 
72
104
  EOF
73
- if windows?
74
- f.write <<EOF
105
+ if windows?
106
+ f.write <<EOF
75
107
  install:
76
108
  \tmkdir -p #{prefix}/lib
77
109
  \tcp yajl.dll #{prefix}/lib/yajl.dll
@@ -80,14 +112,15 @@ install:
80
112
  \tmkdir -p #{prefix}/include/yajl
81
113
  \tcp yajl/*.h #{prefix}/include/yajl
82
114
  EOF
83
- else
84
- f.write <<EOF
115
+ else
116
+ f.write <<EOF
85
117
  install:
86
118
  \tmkdir -p #{prefix}/lib
87
119
  \tcp $(DLLIB) #{prefix}/lib/$(DLLIB)
88
120
  \tmkdir -p #{prefix}/include/yajl
89
121
  \tcp yajl/*.h #{prefix}/include/yajl
90
122
  EOF
123
+ end
91
124
  end
92
125
  end
93
126
  end
@@ -1,3 +1,3 @@
1
1
  module Libyajl2
2
- VERSION = "0.1.16"
2
+ VERSION = "0.1.17"
3
3
  end
data/libyajl2.gemspec CHANGED
@@ -24,7 +24,8 @@ Gem::Specification.new do |spec|
24
24
  # required for 'rake spec'
25
25
  spec.add_development_dependency "bundler"
26
26
  spec.add_development_dependency "rake"
27
- spec.add_development_dependency "rake-compiler", "~> 0.8.3"
27
+ # rake-compiler 0.9.2 is required for rbx compiles, and in turn requires rubygems >= 1.8.25
28
+ spec.add_development_dependency "rake-compiler", "~> 0.9"
28
29
  # pin mime-types in order to work on ruby 1.8.7
29
30
  spec.add_development_dependency "mime-types", "~> 1.16"
30
31
  spec.add_development_dependency "rspec", "~> 2.14"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: libyajl2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.16
4
+ version: 0.1.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - lamont-granquist
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-21 00:00:00.000000000 Z
11
+ date: 2014-06-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 0.8.3
47
+ version: '0.9'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 0.8.3
54
+ version: '0.9'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: mime-types
57
57
  requirement: !ruby/object:Gem::Requirement