gpgme-ffi 3.0.2 → 3.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,33 +1,46 @@
1
- BUILD := <%= BUILD %>
2
- SRC := <%= SRC %>
3
- PREFIX := <%= PREFIX %>
1
+ BUILD := <%= BUILD %>
2
+ SRC := <%= SRC %>
3
+ PREFIX := <%= PREFIX %>
4
+ ARCH_CFLAGS := <%= ARCH_CFLAGS %>
4
5
 
5
- TARGETS := ${SRC}/libgpgme_gem.so ${SRC}/../../lib/gpgme/ffi/enums.rb
6
+ TARGETS := ${SRC}/libgpgme_gem.so ${SRC}/../../lib/gpgme/ffi/enums.rb
6
7
 
7
8
  GPG_ERROR := libgpg-error-1.10
8
9
  ASSUAN := libassuan-2.0.2
9
10
  GPGME := gpgme-1.3.1
10
11
 
11
- COMMON_FLAGS := --prefix=${PREFIX} --disable-shared --enable-static --with-pic
12
+ COMMON_FLAGS := --prefix=${PREFIX} --disable-shared --enable-static --with-pic CFLAGS="${ARCH_CFLAGS}" --disable-dependency-tracking
12
13
  GPG_ERROR_FLAGS := --disable-nls
13
14
  ASSUAN_FLAGS := --with-gpg-error-prefix=${PREFIX}
14
- GPGME_FLAGS := --with-gpg-error-prefix=${PREFIX} --with-libassuan-prefix=${PREFIX}
15
+ GPGME_FLAGS := --with-gpg-error-prefix=${PREFIX} --with-libassuan-prefix=${PREFIX} --without-pth
15
16
 
16
17
  all: ${BUILD}/libgpgme_gem.so ${BUILD}/enums.rb
17
18
 
18
19
  clean:
19
20
  rm -f ${BUILD}/libgpgme_gem.so ${BUILD}/enums.rb
20
21
 
22
+ <% if TARGET_IS_FAT %>
23
+ ${BUILD}/libgpgme_gem.so: ${BUILD}/libgpgme_gem_i386.dylib ${BUILD}/libgpgme_gem_x86_64.dylib
24
+ lipo -create -output $@ $^
25
+
26
+ %_i386.a: %.a
27
+ lipo -thin i386 -output $@ $<
28
+
29
+ %_x86_64.a: %.a
30
+ lipo -thin x86_64 -output $@ $<
31
+
32
+ ${BUILD}/libgpgme_gem_%.dylib: ${BUILD}/libgpgme_ext_%.a ${BUILD}/libgpg-error_ext_%.a ${BUILD}/libassuan_ext_%.a
33
+ <% else %>
21
34
  ${BUILD}/libgpgme_gem.so: ${BUILD}/libgpgme_ext.a ${BUILD}/libgpg-error_ext.a ${BUILD}/libassuan_ext.a
35
+ <% end %>
22
36
  for file in $^; do \
23
- bn=`basename $$file _ext.a` && \
37
+ bn=`basename $$file .a` && \
24
38
  rm -rf ${BUILD}/link-$$bn && \
25
39
  mkdir ${BUILD}/link-$$bn && \
26
40
  cd ${BUILD}/link-$$bn && \
27
41
  ar x $$file; \
28
42
  done
29
- gcc -shared -o $@ $(foreach ext,libgpg-error libgpgme libassuan,${BUILD}/link-$(ext)/*.o) -lc
30
- rm -rf $(addprefix ${BUILD}/link-,libgpg-error libgpgme libassuan)
43
+ gcc -shared -o $@ $(foreach dir,$^,${BUILD}/link-$(notdir $(dir:.a=))/*.o) <% if TARGET_IS_FAT %>-arch $*<% end %>
31
44
 
32
45
  ${BUILD}/%_ext.a: ${PREFIX}/lib/%.a
33
46
  cp $< $@
@@ -12,5 +12,13 @@ end
12
12
 
13
13
  system "gpg-agent", "--version"
14
14
 
15
+ if %x{uname} == "Darwin\n"
16
+ ARCH_CFLAGS="-arch i386 -arch x86_64"
17
+ TARGET_IS_FAT=true
18
+ else
19
+ ARCH_CFLAGS=""
20
+ TARGET_IS_FAT=false
21
+ end
22
+
15
23
  template = ERB.new File.read("#{SRC}/Makefile.in")
16
24
  File.write "#{BUILD}/Makefile", template.result(binding)
Binary file
@@ -150,14 +150,14 @@ module GPGME
150
150
  0
151
151
  else
152
152
 
153
- buffer.write_bytes data, 0, data.length
153
+ buffer.put_bytes 0, data, 0, data.length
154
154
 
155
155
  data.length
156
156
  end
157
157
  end
158
158
 
159
159
  cbs[:write] = FFI::Function.new(:ssize_t, [ :pointer, :pointer, :size_t ]) do |handle, buffer, size|
160
- data = buffer.read_bytes size
160
+ data = buffer.get_bytes 0, size
161
161
 
162
162
  ruby_cbs.write ruby_handle, data, size
163
163
  end
@@ -187,13 +187,13 @@ module GPGME
187
187
 
188
188
  return nil if bytes == 0
189
189
 
190
- buf.read_bytes bytes
190
+ buf.get_bytes 0, bytes
191
191
  end
192
192
 
193
193
  def self.gpgme_data_write(data, buffer, length)
194
194
  buf = FFI::Buffer.new(:uint8, (length > 0) ? length : 1)
195
195
  if length > 0
196
- buf.write_bytes buffer, 0, length
196
+ buf.put_bytes 0, buffer, 0, length
197
197
  end
198
198
 
199
199
  bytes = Library.gpgme_data_write data.context_pointer, buf, length
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gpgme-ffi
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.2
4
+ version: 3.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -184,7 +184,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
184
184
  version: '0'
185
185
  segments:
186
186
  - 0
187
- hash: -3350640821445930124
187
+ hash: -3445448153825285067
188
188
  required_rubygems_version: !ruby/object:Gem::Requirement
189
189
  none: false
190
190
  requirements:
@@ -193,7 +193,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
193
193
  version: '0'
194
194
  segments:
195
195
  - 0
196
- hash: -3350640821445930124
196
+ hash: -3445448153825285067
197
197
  requirements: []
198
198
  rubyforge_project: ruby-gpgme
199
199
  rubygems_version: 1.8.24