Date: Mon, 4 Dec 2017 16:34:12 +0000 (UTC) From: Mahdi Mokhtari <mmokhi@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r455524 - in head/www/mod_pagespeed: . files Message-ID: <201712041634.vB4GYCi7087287@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mmokhi Date: Mon Dec 4 16:34:11 2017 New Revision: 455524 URL: https://svnweb.freebsd.org/changeset/ports/455524 Log: www/mod_pagespeed: Fix build with OpenSSL-base w/o gperf in base This patch edits select_openssl.gyp for fixing the selection of -L -I flags for build. Also adds compatibilty flags for the functions that openssl of base doesn't provide. Reviewed by: mat Sponsored by: Netzkommune GmbH Differential Revision: https://reviews.freebsd.org/D13316 Added: head/www/mod_pagespeed/files/patch-third__party_serf_instaweb__ssl__buckets.c (contents, props changed) head/www/mod_pagespeed/files/patch-third__party_serf_serf.diff (contents, props changed) Modified: head/www/mod_pagespeed/Makefile head/www/mod_pagespeed/files/patch-third__party_grpc_src_src_core_lib_tsi_ssl__transport__security.c head/www/mod_pagespeed/files/patch-third__party_serf_select__openssl.gyp Modified: head/www/mod_pagespeed/Makefile ============================================================================== --- head/www/mod_pagespeed/Makefile Mon Dec 4 16:19:15 2017 (r455523) +++ head/www/mod_pagespeed/Makefile Mon Dec 4 16:34:11 2017 (r455524) @@ -2,7 +2,7 @@ PORTNAME= mod_pagespeed PORTVERSION= 1.12.34.2 -PORTREVISION= 2 +PORTREVISION= 3 PORTEPOCH= 1 CATEGORIES= www devel MASTER_SITES= LOCAL/mmokhi:boringssl,chromium_base,chromium_build,googleurl,gflags_arch,gflags_src,libjpeg_turbo_src,yasm_patched,libwebp,modpb64 \ @@ -14,9 +14,6 @@ COMMENT= Apache module for rewriting web pages to redu LICENSE= APACHE20 -BROKEN_SSL= base -BROKEN_SSL_REASON_base= needs openssl.pc - BUILD_DEPENDS= bash:shells/bash \ curl:ftp/curl \ closure-compiler:www/closure-compiler \ @@ -34,7 +31,7 @@ LIB_DEPENDS= libpng.so:graphics/png \ libicutu.so:devel/icu \ libopencv_legacy.so:graphics/opencv -USES= compiler:c++14-lang jpeg gmake localbase pkgconfig \ +USES= compiler:c++14-lang gperf jpeg gmake localbase pkgconfig \ python shebangfix ssl tar:xz USE_APACHE= 22 SHEBANG_GLOB= *.gyp *.gypi *.py *.sh @@ -145,7 +142,7 @@ post-patch: cd ${BUILD_WRKSRC}/third_party/google-sparsehash/gen/arch/freebsd && \ ${MV} ia32 i386 && ${MV} x64 amd64 ) ${REINPLACE_CMD} -e "s,%%LOCALBASE%%,${LOCALBASE},g" \ - ${WRKSRC}/base/base.gypi + ${WRKSRC}/base/base.gypi ${WRKSRC}/third_party/serf/select_openssl.gyp ${REINPLACE_CMD} -e "s,%%PORTSSTAGE%%,${STAGEDIR},g" \ ${WRKSRC}/install/Makefile ${FIND} ${WRKSRC} -type f \( -name "*.gyp" -o -name "*.gypi" \) -exec \ Modified: head/www/mod_pagespeed/files/patch-third__party_grpc_src_src_core_lib_tsi_ssl__transport__security.c ============================================================================== --- head/www/mod_pagespeed/files/patch-third__party_grpc_src_src_core_lib_tsi_ssl__transport__security.c Mon Dec 4 16:19:15 2017 (r455523) +++ head/www/mod_pagespeed/files/patch-third__party_grpc_src_src_core_lib_tsi_ssl__transport__security.c Mon Dec 4 16:34:11 2017 (r455524) @@ -8,3 +8,18 @@ #include <limits.h> #include <string.h> +@@ -54,11 +55,10 @@ + #define TSI_SSL_MAX_PROTECTED_FRAME_SIZE_UPPER_BOUND 16384 + #define TSI_SSL_MAX_PROTECTED_FRAME_SIZE_LOWER_BOUND 1024 + +-/* Putting a macro like this and littering the source file with #if is really +- bad practice. +- TODO(jboeuf): refactor all the #if / #endif in a separate module. */ +-#ifndef TSI_OPENSSL_ALPN_SUPPORT ++#if OPENSSL_VERSION_NUMBER >= 0x10002000L + #define TSI_OPENSSL_ALPN_SUPPORT 1 ++#else ++#define TSI_OPENSSL_ALPN_SUPPORT 0 + #endif + + /* TODO(jboeuf): I have not found a way to get this number dynamically from the Added: head/www/mod_pagespeed/files/patch-third__party_serf_instaweb__ssl__buckets.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/www/mod_pagespeed/files/patch-third__party_serf_instaweb__ssl__buckets.c Mon Dec 4 16:34:11 2017 (r455524) @@ -0,0 +1,18 @@ +--- third_party/serf/instaweb_ssl_buckets.c.orig 2017-06-08 22:22:39 UTC ++++ third_party/serf/instaweb_ssl_buckets.c +@@ -1697,11 +1697,15 @@ int serf_ssl_cert_depth(const serf_ssl_c + int serf_ssl_check_host(const serf_ssl_certificate_t *cert, + const char* hostname) + { ++#if TSI_OPENSSL_ALPN_SUPPORT == 0 ++ return (-1); ++#else + return X509_check_host(cert->ssl_cert, + hostname, + strlen(hostname), + 0 /* we don't need to set any flags */, + NULL /* we don't need the SAN or CN extracted*/); ++#endif + } + + apr_hash_t *serf_ssl_cert_issuer( Modified: head/www/mod_pagespeed/files/patch-third__party_serf_select__openssl.gyp ============================================================================== --- head/www/mod_pagespeed/files/patch-third__party_serf_select__openssl.gyp Mon Dec 4 16:19:15 2017 (r455523) +++ head/www/mod_pagespeed/files/patch-third__party_serf_select__openssl.gyp Mon Dec 4 16:34:11 2017 (r455524) @@ -1,15 +1,21 @@ ---- third_party/serf/select_openssl.gyp.orig 2017-10-04 20:20:10 UTC +--- third_party/serf/select_openssl.gyp.orig 2017-06-08 22:22:39 UTC +++ third_party/serf/select_openssl.gyp -@@ -47,10 +47,10 @@ +@@ -42,15 +42,15 @@ + 'type': 'none', + 'direct_dependent_settings': { + 'cflags': [ +- '<!@(pkg-config --cflags openssl)', ++ '<!@(if [ -e %%LOCALBASE%%/libdata/pkgconfig/openssl.pc ]; then pkg-config --cflags openssl; else echo "-I/usr/include -DTSI_OPENSSL_ALPN_SUPPORT=0"; fi)', + ], }, 'link_settings': { 'ldflags': [ - '<!@(pkg-config --libs-only-L --libs-only-other openssl)', -+ '<!@(pkg-config --libs openssl)', ++ '<!@(if [ -e %%LOCALBASE%%/libdata/pkgconfig/openssl.pc ]; then pkg-config --libs openssl; else echo "-L/usr/lib -lssl -lcrypto"; fi)', ], 'libraries': [ - '<!@(pkg-config --libs-only-l openssl)', -+ '<!@(pkg-config --libs openssl)', ++ '<!@(if [ -e %%LOCALBASE%%/libdata/pkgconfig/openssl.pc ]; then pkg-config --libs openssl; else echo "-L/usr/lib -lssl -lcrypto"; fi)', ], }, }, Added: head/www/mod_pagespeed/files/patch-third__party_serf_serf.diff ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/www/mod_pagespeed/files/patch-third__party_serf_serf.diff Mon Dec 4 16:34:11 2017 (r455524) @@ -0,0 +1,27 @@ +--- third_party/serf/serf.diff.orig 2017-06-08 22:22:39 UTC ++++ third_party/serf/serf.diff +@@ -324,7 +324,7 @@ + apr_status_t serf_ssl_load_cert_file( + serf_ssl_certificate_t **cert, + const char *file_path, +-@@ -1652,6 +1688,21 @@ ++@@ -1652,6 +1688,25 @@ + return cert->depth; + } + +@@ -337,11 +337,15 @@ + +int serf_ssl_check_host(const serf_ssl_certificate_t *cert, + + const char* hostname) + +{ +++#if TSI_OPENSSL_ALPN_SUPPORT == 0 +++ return (-1); +++#else + + return X509_check_host(cert->ssl_cert, + + hostname, + + strlen(hostname), + + 0 /* we don't need to set any flags */, + + NULL /* we don't need the SAN or CN extracted*/); +++#endif + +} + + apr_hash_t *serf_ssl_cert_issuer(
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201712041634.vB4GYCi7087287>