DomT4/homebrew-crypto

compile error: brew install DomT4/crypto/curl-max

huawenyu opened this issue · 4 comments

$ brew install DomT4/crypto/curl-max

shrpx_api_downstream_connection.cc:57:3: error: array must be initialized with a brace-enclosed initializer
};
^
shrpx_api_downstream_connection.cc:57:3: error: too many initializers for 'std::array<shrpx::APIEndpoint, 2ul>'
Makefile:2096: recipe for target 'libnghttpx_a-shrpx_api_downstream_connection.o' failed
make[3]: *** [libnghttpx_a-shrpx_api_downstream_connection.o] Error 1
make[3]: Leaving directory '/tmp/curl-max--nghttp2-20190606-19421-damf6f/nghttp2-1.38.0/src'
Makefile:2668: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory '/tmp/curl-max--nghttp2-20190606-19421-damf6f/nghttp2-1.38.0/src'
Makefile:567: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/tmp/curl-max--nghttp2-20190606-19421-damf6f/nghttp2-1.38.0'
Makefile:476: recipe for target 'all' failed
make: *** [all] Error 2

DomT4 commented
diff --git a/Formula/curl-max.rb b/Formula/curl-max.rb
index 1eed9eb..110ad14 100644
--- a/Formula/curl-max.rb
+++ b/Formula/curl-max.rb
@@ -34,6 +34,14 @@ class CurlMax < Formula
   resource "nghttp2" do
     url "https://github.com/nghttp2/nghttp2/releases/download/v1.38.0/nghttp2-1.38.0.tar.xz"
     sha256 "ef75c761858241c6b4372fa6397aa0481a984b84b7b07c4ec7dc2d7b9eee87f8"
+
+    unless OS.mac?
+      patch do
+        # Fix: shrpx_api_downstream_connection.cc:57:3: error: array must be initialized with a brace-enclosed initializer
+        url "https://gist.githubusercontent.com/iMichka/5dda45fbad3e70f52a6b4e7dfd382969/raw/19797e17926922bdd1ef21a47e162d8be8e2ca65/nghttp2?full_index=1"
+        sha256 "0759d448d4b419911c12fa7d5cbf1df2d6d41835c9077bf3accf9eac58f24f12"
+      end
+    end
   end
 
   resource "libssh2" do

If you apply that change locally, does it fix the issue?

Ref: nghttp2/nghttp2#1269

$ brew install DomT4/crypto/curl-max

==> make install
//usr/lib/x86_64-linux-gnu/libldap-2.4.so.2: undefined reference to ber_set_option@OPENLDAP_2.4_2' //usr/lib/x86_64-linux-gnu/libldap-2.4.so.2: undefined reference to ber_sockbuf_remove_io@OPENLDAP_2.4_2'
//usr/lib/x86_64-linux-gnu/libldap-2.4.so.2: undefined reference to ber_get_stringbv@OPENLDAP_2.4_2' //usr/lib/x86_64-linux-gnu/libldap-2.4.so.2: undefined reference to ber_bvecfree@OPENLDAP_2.4_2'
//usr/lib/x86_64-linux-gnu/libldap-2.4.so.2: undefined reference to ber_flatten2@OPENLDAP_2.4_2' //usr/lib/x86_64-linux-gnu/libldap-2.4.so.2: undefined reference to ber_decode_oid@OPENLDAP_2.4_2'
collect2: error: ld returned 1 exit status
Makefile:922: recipe for target 'curl' failed
make[2]: *** [curl] Error 1
make[2]: Leaving directory '/tmp/curl-max-20190606-30395-1sakhb2/curl-7.65.0/src'
Makefile:1967: recipe for target 'install-recursive' failed
make[1]: *** [install-recursive] Error 1
make[1]: Leaving directory '/tmp/curl-max-20190606-30395-1sakhb2/curl-7.65.0/src'
Makefile:923: recipe for target 'install-recursive' failed
make: *** [install-recursive] Error 1

If reporting this issue please do so at (not Homebrew/brew or Homebrew/core):
https://github.com/domt4/homebrew-crypto/issues

These open issues may also help:
compile error: brew install DomT4/crypto/curl-max #98

I fixed it like this:

  • the first compile error, I just comment the "nghttp2".
  • the 2nd compile error, Add a "--disable-ldap" to curl's args.

So the output curl-max support TLS1.3 but no ldap, :P)

DomT4 commented

Should be fixed, hopefully, by borrowing the patch Linuxbrew has been applying for the last year or so, in 603532a. Let me know otherwise.