rbczmq 1.3 → 1.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,9 @@
1
1
  = Changelog
2
2
 
3
- == 1.3 (April 8, 2012)
3
+ == 1.4 (April 27, 2013)
4
+ * Ships with release libzmq and czmq tarballs - removes autotools dependency (James Tucker)
5
+
6
+ == 1.3 (April 8, 2013)
4
7
  * Bump czmq
5
8
 
6
9
  == 1.2 (April 5, 2012)
@@ -53,4 +56,4 @@
53
56
  * Include Travis CI build status in README
54
57
 
55
58
  == 0.1 ( February 21, 2012)
56
- * Initial public release
59
+ * Initial public release
@@ -1,13 +1,13 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rbczmq (1.2)
4
+ rbczmq (1.3)
5
5
 
6
6
  GEM
7
7
  remote: http://rubygems.org/
8
8
  specs:
9
- rake (0.9.2.2)
10
- rake-compiler (0.8.0)
9
+ rake (10.0.4)
10
+ rake-compiler (0.8.3)
11
11
  rake
12
12
 
13
13
  PLATFORMS
Binary file
@@ -0,0 +1,78 @@
1
+ diff --git a/include/zframe.h b/include/zframe.h
2
+ index e0e36c2..1b880d3 100644
3
+ --- a/include/zframe.h
4
+ +++ b/include/zframe.h
5
+ @@ -116,6 +116,10 @@ CZMQ_EXPORT void
6
+ CZMQ_EXPORT void
7
+ zframe_reset (zframe_t *self, const void *data, size_t size);
8
+
9
+ +// Set the free callback for frame
10
+ +CZMQ_EXPORT void
11
+ + zframe_freefn(zframe_t *self, zframe_free_fn *free_fn, void *arg);
12
+ +
13
+ // Self test of this class
14
+ CZMQ_EXPORT int
15
+ zframe_test (bool verbose);
16
+ diff --git a/src/zframe.c b/src/zframe.c
17
+ index edeec07..cf124ac 100644
18
+ --- a/src/zframe.c
19
+ +++ b/src/zframe.c
20
+ @@ -49,6 +49,8 @@ struct _zframe_t {
21
+ zmq_msg_t zmsg; // zmq_msg_t blob for frame
22
+ int more; // More flag, from last read
23
+ int zero_copy; // zero-copy flag
24
+ + zframe_free_fn *free_fn; // destructor callback
25
+ + void *free_arg; // destructor callback arg
26
+ };
27
+
28
+
29
+ @@ -116,6 +118,8 @@ zframe_destroy (zframe_t **self_p)
30
+ assert (self_p);
31
+ if (*self_p) {
32
+ zframe_t *self = *self_p;
33
+ + if (self->free_fn)
34
+ + (self->free_fn) (self, self->free_arg);
35
+ zmq_msg_close (&self->zmsg);
36
+ free (self);
37
+ *self_p = NULL;
38
+ @@ -373,6 +377,16 @@ zframe_reset (zframe_t *self, const void *data, size_t size)
39
+ memcpy (zmq_msg_data (&self->zmsg), data, size);
40
+ }
41
+
42
+ +void
43
+ +zframe_freefn (zframe_t *self, zframe_free_fn *free_fn, void *arg)
44
+ +{
45
+ + assert (self);
46
+ + assert (free_fn);
47
+ +
48
+ + self->free_fn = free_fn;
49
+ + self->free_arg = arg;
50
+ +}
51
+ +
52
+ // --------------------------------------------------------------------------
53
+ // Selftest
54
+
55
+ @@ -389,6 +403,12 @@ s_test_free_cb (void *data, void *arg)
56
+ free (data);
57
+ }
58
+
59
+ +static void
60
+ +s_test_free_frame_cb(void *frame, void *arg)
61
+ +{
62
+ + assert (frame);
63
+ +}
64
+ +
65
+ int
66
+ zframe_test (bool verbose)
67
+ {
68
+ @@ -472,6 +492,10 @@ zframe_test (bool verbose)
69
+ zframe_destroy (&frame);
70
+ zframe_destroy (&frame_copy);
71
+
72
+ + frame = zframe_new ("callback", 8);
73
+ + zframe_freefn (frame, s_test_free_frame_cb, NULL);
74
+ + zframe_destroy (&frame);
75
+ +
76
+ zctx_destroy (&ctx);
77
+ // @end
78
+ printf ("OK\n");
@@ -96,14 +96,26 @@ end
96
96
  unless File.directory?(zmq_path) && File.directory?(czmq_path)
97
97
  fail "The 'tar' (creates and manipulates streaming archive files) utility is required to extract dependencies" if `which tar`.strip.empty?
98
98
  Dir.chdir(vendor_path) do
99
- sys "tar xvzf zeromq.tar.gz", "Could not extract the ZeroMQ archive!"
100
- sys "tar xvzf czmq.tar.gz", "Could not extract the CZMQ archive!"
99
+ names = Dir['*mq*.tar.gz'].map { |f| File.basename(f, '.tar.gz') }
100
+ fail "required files not found: #{names}" unless names.size == 2
101
+
102
+ names.each do |name|
103
+ puts "Extracting #{name}"
104
+ sys "tar xvzf #{name}.tar.gz", "Could not extract #{name}"
105
+ puts "Moving #{name} to #{name.split('-').first}"
106
+ sys "mv #{name} #{name.split('-').first}", "Could not move #{name}"
107
+ end
101
108
  end
102
109
  end
103
110
 
104
111
  # build libzmq
105
112
  lib = libs_path + "libzmq.#{LIBEXT}"
106
113
  Dir.chdir zmq_path do
114
+ Dir['../patches/zeromq/*.patch'].sort.each do |patch|
115
+ puts "applying: #{patch}"
116
+ sys "patch -p1 < #{patch}", "failed to apply patch: #{patch}"
117
+ end
118
+
107
119
  sys "./autogen.sh", "ZeroMQ autogen failed!" unless File.exist?(zmq_path + 'configure')
108
120
  sys "./configure --prefix=#{dst_path} --without-documentation --enable-shared && make && make install", "ZeroMQ compile error!"
109
121
  end unless File.exist?(lib)
@@ -111,6 +123,11 @@ end unless File.exist?(lib)
111
123
  # build libczmq
112
124
  lib = libs_path + "libczmq.#{LIBEXT}"
113
125
  Dir.chdir czmq_path do
126
+ Dir['../patches/czmq/*.patch'].sort.each do |patch|
127
+ puts "Applying: #{patch}"
128
+ sys "patch -p1 < #{patch}", "Failed to apply patch: #{patch}"
129
+ end
130
+
114
131
  sys "./autogen.sh", "CZMQ autogen failed!" unless File.exist?(czmq_path + 'configure')
115
132
  sys "./configure LDFLAGS=-L#{libs_path} CFLAGS='#{CZMQ_CFLAGS.join(" ")}' --prefix=#{dst_path} --with-libzmq=#{dst_path} --disable-shared && make all && make install", "CZMQ compile error!"
116
133
  end unless File.exist?(lib)
@@ -10,7 +10,7 @@
10
10
  if (!(st_lookup(frames_map, (st_data_t)frame, 0))) rb_raise(rb_eZmqError, "ZMQ::Frame instance %p has been destroyed by the ZMQ framework", (void *)obj);
11
11
 
12
12
  #define ZmqRegisterFrame(fr) \
13
- zframe_freefn((fr), rb_czmq_frame_freed); \
13
+ zframe_freefn((fr), rb_czmq_frame_freed, NULL); \
14
14
  st_insert(frames_map, (st_data_t)(fr), (st_data_t)0);
15
15
 
16
16
  void rb_czmq_free_frame(zframe_t *frame);
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module ZMQ
4
- VERSION = "1.3"
4
+ VERSION = "1.4"
5
5
  end
metadata CHANGED
@@ -1,12 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbczmq
3
3
  version: !ruby/object:Gem::Version
4
- hash: 9
4
+ hash: 7
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
- - 3
9
- version: "1.3"
8
+ - 4
9
+ version: "1.4"
10
10
  platform: ruby
11
11
  authors:
12
12
  - "Lourens Naud\xC3\xA9"
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2013-04-08 00:00:00 Z
18
+ date: 2013-04-27 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: rake-compiler
@@ -57,8 +57,8 @@ files:
57
57
  - examples/pub_sub.rb
58
58
  - examples/push_pull.rb
59
59
  - examples/req_rep.rb
60
- - ext/czmq.tar.gz
61
- - ext/libzmq.tar.gz
60
+ - ext/czmq-1.3.2.tar.gz
61
+ - ext/patches/czmq/0_zframe_free.patch
62
62
  - ext/rbczmq/context.c
63
63
  - ext/rbczmq/context.h
64
64
  - ext/rbczmq/extconf.rb
@@ -83,7 +83,7 @@ files:
83
83
  - ext/rbczmq/socket.h
84
84
  - ext/rbczmq/timer.c
85
85
  - ext/rbczmq/timer.h
86
- - ext/zeromq.tar.gz
86
+ - ext/zeromq-3.2.2.tar.gz
87
87
  - lib/rbczmq.rb
88
88
  - lib/zmq.rb
89
89
  - lib/zmq/context.rb
Binary file
Binary file