Bug 218721 - ftp/curl builds with http2 by default - even when told not to.
Summary: ftp/curl builds with http2 by default - even when told not to.
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Po-Chuan Hsieh
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-04-18 04:38 UTC by dewayne
Modified: 2017-04-19 14:15 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description dewayne 2017-04-18 04:38:47 UTC
With 
# make -C /usr/ports/ftp/curl -DUSE_C3 showconfig | grep HTT
     HTTP2=off: HTTP protocol version 2.0 support
The curl package will build with http2
# ldd `which curl`
/usr/local/bin/curl:
        libcurl.so.4 => /usr/local/lib/libcurl.so.4 (0x80084f000)
        libz.so.6 => /lib/libz.so.6 (0x800ac7000)
        libthr.so.3 => /lib/libthr.so.3 (0x800ce0000)
        libc.so.7 => /lib/libc.so.7 (0x800f08000)
        libnghttp2.so.14 => /usr/local/lib/libnghttp2.so.14 (0x8012b4000)
        libssh2.so.1 => /usr/local/lib/libssh2.so.1 (0x8014db000)
        libssl.so.43 => /usr/local/lib/libssl.so.43 (0x801706000)
        libcrypto.so.41 => /usr/local/lib/libcrypto.so.41 (0x80195d000)

Commenting out, from the curl/Makefile doesn't help
#HTTP2_CONFIGURE_WITH=  libnghttp2
#HTTP2_LIB_DEPENDS=     libnghttp2.so:www/libnghttp2
#HTTP2_USES=            pkgconfig

so I've just added to CONFIGURE_ARGS, 
--without-nghttp2

which does the trick.  From the diff of the build logs, it looks like pkg-config is being too smart.

< checking for pkg-config... (cached) /usr/local/bin/pkg-config
< checking for libnghttp2 options with pkg-config... found
< configure: -l is -lnghttp2
< configure: -I is -I/usr/local/include
< configure: -L is -L/usr/local/lib
< checking for nghttp2_option_set_no_recv_client_magic in -lnghttp2... yes
< checking nghttp2/nghttp2.h usability... yes
< checking nghttp2/nghttp2.h presence... yes
< checking for nghttp2/nghttp2.h... yes
741c732
< configure: using LIBS: -lnghttp2 -lssh2 -lssh2 -lssl -lcrypto -lz -L/usr/local/lib
---
> configure: using LIBS: -lssh2 -lssh2 -lssl -lcrypto -lz -L/usr/local/lib
827c818
<   HTTP2 support:    enabled (nghttp2)
---
>   HTTP2 support:    disabled (--with-nghttp2)


Yes I do build using portmaster, and I probably already have libnghttp2 for testing via apache.  But I don't want http2 as a dependency by curl as it is very widely used across the environment and a minimal executable is highly desired.  (curl replaces fetch and wget use)
Comment 1 Adam Weinberger freebsd_committer freebsd_triage 2017-04-18 12:54:06 UTC
Sending over to maintainer.

Sunpoet, does that need to be "HTTP2_CONFIGURE_WITH= nghttp2"? Or "libnghttp2 nghttp2"?
Comment 2 Po-Chuan Hsieh freebsd_committer freebsd_triage 2017-04-18 17:02:07 UTC
I checked configure again and it should be HTTP2_CONFIGURE_WITH=nghttp2, not libnghttp2.
Comment 3 commit-hook freebsd_committer freebsd_triage 2017-04-18 19:39:33 UTC
A commit references this bug:

Author: sunpoet
Date: Tue Apr 18 19:38:23 UTC 2017
New revision: 438798
URL: https://svnweb.freebsd.org/changeset/ports/438798

Log:
  Fix HTTP2 option

  PR:		218721
  Reported by:	<dewayne@heuristicsystems.com.au>
  MFH:		2017Q2

Changes:
  head/ftp/curl/Makefile
Comment 4 Po-Chuan Hsieh freebsd_committer freebsd_triage 2017-04-18 19:41:20 UTC
Committed. Thanks!
Comment 5 commit-hook freebsd_committer freebsd_triage 2017-04-19 14:15:54 UTC
A commit references this bug:

Author: sunpoet
Date: Wed Apr 19 14:15:30 UTC 2017
New revision: 438844
URL: https://svnweb.freebsd.org/changeset/ports/438844

Log:
  MFH: r438798

  Fix HTTP2 option

  PR:		218721
  Reported by:	<dewayne@heuristicsystems.com.au>

  Approved by:	ports-secteam (junovitch)

Changes:
_U  branches/2017Q2/
  branches/2017Q2/ftp/curl/Makefile