Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improved test and compilations task.
- Loading branch information
1 parent
da7e3d5
commit a4dac36
Showing
10 changed files
with
66 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
|
@@ -3,3 +3,4 @@ gpgme_n.* | ||
mkmf.log | mkmf.log | ||
Makefile | Makefile | ||
coverage | coverage | ||
Gemfile.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,26 +1,57 @@ | |||
require 'mkmf' | require 'mkmf' | ||
|
|
||
unless find_executable('gpgme-config') | CWD = File.expand_path(File.dirname(__FILE__)) | ||
$stderr.puts("gpgme-config not found") | PREFIX = "#{CWD}/dst/" | ||
exit(1) |
|
||
def sys(*cmd) | |||
puts " -- #{cmd.join(' ')}" | |||
|
|||
unless ret = xsystem(cmd.join(' ')) | |||
raise "#{cmd.join(' ')} failed!" | |||
end | |||
|
|||
ret | |||
end | end | ||
|
|
||
$CFLAGS += ' ' << `gpgme-config --cflags`.chomp | def build(tgz, *flags) | ||
$libs += ' ' << `gpgme-config --libs`.chomp | sys("tar xjvf #{tgz}") | ||
|
|
||
checking_for('gpgme >= 1.1.3') do | Dir.chdir(File.basename(tgz, '.tar.bz2')) do | ||
if try_run(<<'End') | sys("./configure --prefix=#{PREFIX} --disable-shared --enable-static --with-pic", *flags) | ||
#include <gpgme.h> | sys("make") | ||
#include <stdlib.h> | sys("make install") | ||
int main (void) { | |||
return gpgme_check_version ("1.1.3") == NULL; | |||
} | |||
End | |||
true | |||
else | |||
$CFLAGS += ' -DRUBY_GPGME_NEED_WORKAROUND_KEYLIST_NEXT' | |||
false | |||
end | end | ||
end | end | ||
have_func('gpgme_op_export_keys') |
|
||
libgpg_error_tgz = File.join(CWD, 'libgpg-error-1.10.tar.bz2') | |||
libassuan_tgz = File.join(CWD, 'libassuan-2.0.2.tar.bz2') | |||
gpgme_tgz = File.join(CWD, 'gpgme-1.3.1.tar.bz2') | |||
|
|||
# build deps | |||
|
|||
build(libgpg_error_tgz, "--disable-nls") | |||
build(libassuan_tgz, "--with-gpg-error-prefix=#{PREFIX}") | |||
build(gpgme_tgz, "--with-gpg-error-prefix=#{PREFIX}", "--with-libassuan-prefix=#{PREFIX}") | |||
|
|||
# copy gpgme | |||
|
|||
|
|||
%w[ libassuan libgpg-error libgpgme ].each do |lib| | |||
FileUtils.cp "#{CWD}/dst/lib/#{lib}.a", "#{CWD}/#{lib}_ext.a" | |||
end | |||
|
|||
$INCFLAGS[0,0] = " -I#{CWD}/dst/include " | |||
#$LDFLAGS << " -L#{CWD} " | |||
$CFLAGS << " -fPIC " | |||
|
|||
# build gpgme extension | |||
|
|||
unless have_library 'gpg-error_ext' and have_library 'gpgme_ext' and have_library 'assuan_ext' and have_library 'gpg-error_ext' and have_header 'gpgme.h' | |||
STDERR.puts "\n\n" | |||
STDERR.puts "*********************************************************" | |||
STDERR.puts "********* error compiling and linking libgpgme. *********" | |||
STDERR.puts "*********************************************************" | |||
exit(1) | |||
end | |||
|
|||
create_makefile ('gpgme_n') | create_makefile ('gpgme_n') |
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters