diff options
Diffstat (limited to 'community/ruby-http_parser.rb/use-system-libhttp_parser.patch')
-rw-r--r-- | community/ruby-http_parser.rb/use-system-libhttp_parser.patch | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/community/ruby-http_parser.rb/use-system-libhttp_parser.patch b/community/ruby-http_parser.rb/use-system-libhttp_parser.patch new file mode 100644 index 00000000000..a023f20d056 --- /dev/null +++ b/community/ruby-http_parser.rb/use-system-libhttp_parser.patch @@ -0,0 +1,50 @@ +Link with system-provided libhttp_parser. + +mongrel is dead, the last release is from 2009, so I don't think it +there's still some risk of symbols clash. + +--- a/ext/ruby_http_parser/extconf.rb ++++ b/ext/ruby_http_parser/extconf.rb +@@ -1,24 +1,7 @@ + require 'mkmf' + +-# check out code if it hasn't been already +-if Dir[File.expand_path('../vendor/http-parser/*', __FILE__)].empty? +- Dir.chdir(File.expand_path('../../../', __FILE__)) do +- xsystem 'git submodule init' +- xsystem 'git submodule update' +- end +-end +- +-# mongrel and http-parser both define http_parser_(init|execute), so we +-# rename functions in http-parser before using them. +-vendor_dir = File.expand_path('../vendor/http-parser/', __FILE__) +-src_dir = File.expand_path('../', __FILE__) +-%w[ http_parser.c http_parser.h ].each do |file| +- File.open(File.join(src_dir, "ryah_#{file}"), 'w'){ |f| +- f.write File.read(File.join(vendor_dir, file)).gsub('http_parser', 'ryah_http_parser') +- } +-end +- +-$CFLAGS << " -I\"#{src_dir}\"" ++$CFLAGS << ' -Wall -Wextra' ++$LDFLAGS << ' -lhttp_parser' + + dir_config("ruby_http_parser") + create_makefile("ruby_http_parser") +--- a/ext/ruby_http_parser/ruby_http_parser.c ++++ b/ext/ruby_http_parser/ruby_http_parser.c +@@ -1,6 +1,12 @@ + #include "ruby.h" + #include "ext_help.h" +-#include "ryah_http_parser.h" ++#include "http_parser.h" ++ ++#define ryah_http_parser http_parser ++#define ryah_http_parser_execute http_parser_execute ++#define ryah_http_parser_init http_parser_init ++#define ryah_http_parser_settings http_parser_settings ++#define ryah_http_parser_type http_parser_type + + #define GET_WRAPPER(N, from) ParserWrapper *N = (ParserWrapper *)(from)->data; + #define HASH_CAT(h, k, ptr, len) \ |