Sisyphus repositório
Última atualização: 1 outubro 2023 | SRPMs: 18631 | Visitas: 37882630
en ru br
ALT Linux repositórios
S:0.8.0-alt1

Group :: Desenvolvimento/Ruby
RPM: gem-http-parser-rb

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs e FR  Repocop 

Patch: ruby-http-parser-rb.patch
Download


--- ./ext/ruby_http_parser/extconf.rb	2022-04-18 19:41:59.313000000 +0000
+++ ./ext/ruby_http_parser/extconf.rb	2022-04-18 20:21:08.161000000 +0000
@@ -1,3 +1,5 @@
+#!/usr/bin/ruby
+
 require 'mkmf'
 
 # check out code if it hasn't been already
@@ -10,12 +12,21 @@ 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')
-  }
+if find_library("http_parser", "http_parser_init") && find_header("http_parser.h")
+  File.open("ryah_http_parser.h", "w+") do |f|
+    f.puts('#include "http_parser.h"')
+    [nil, :settings, :type, :execute, :init].each do |name|
+      f.puts("#define #{["ryah_http_parser", name].compact.join("_")} #{["http_parser", name].compact.join("_")}")
+    end
+  end
+else
+  vendor_dir = File.expand_path('../vendor/http-parser/', __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
 end
 
 $CFLAGS << " -I\"#{src_dir}\""
 
projeto & código: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
mantenedor atual: Michael Shigorin
mantenedor da tradução: Fernando Martini aka fmartini © 2009