<pre style='margin:0'>
David B. Evans (dbevans) pushed a commit to branch master
in repository macports-ports.
</pre>
<p><a href="https://github.com/macports/macports-ports/commit/e7b22aeacad68836f3b2082bb3208c43b1825b1c">https://github.com/macports/macports-ports/commit/e7b22aeacad68836f3b2082bb3208c43b1825b1c</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit e7b22aeacad68836f3b2082bb3208c43b1825b1c
</span>Author: Ryan Schmidt <ryandesign@macports.org>
AuthorDate: Wed Aug 26 10:21:02 2020 -0500
<span style='display:block; white-space:pre;color:#404040;'> libgit2: Enable NTLM client for 10.9 and earlier
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> See: https://trac.macports.org/ticket/61057
</span>---
devel/libgit2/Portfile | 21 ++-------
devel/libgit2/files/htonll.patch | 93 ++++++++++++++++++++++++++++++++++++++++
2 files changed, 96 insertions(+), 18 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/devel/libgit2/Portfile b/devel/libgit2/Portfile
</span><span style='display:block; white-space:pre;color:#808080;'>index 517b411c1f9..cf0c776be21 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/devel/libgit2/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/devel/libgit2/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -7,7 +7,7 @@ PortGroup legacysupport 1.0
</span>
# don't forget to update py-pygit2 and libgit2-glib as well
github.setup libgit2 libgit2 1.0.1 v
<span style='display:block; white-space:pre;background:#ffe0e0;'>-revision 0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+revision 1
</span> epoch 1
categories devel
platforms darwin
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -37,27 +37,12 @@ depends_lib port:curl \
</span> path:lib/libssl.dylib:openssl \
port:zlib
<span style='display:block; white-space:pre;background:#e0ffe0;'>+patchfiles-append htonll.patch
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> configure.args-append \
-DTHREADSAFE:BOOL=OFF \
-DUSE_ICONV:BOOL=ON
<span style='display:block; white-space:pre;background:#ffe0e0;'>-platform darwin {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-# macro htonll() not defined on 10.9 and earlier
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-# ntlm.c:1129:16: warning: implicit declaration of function 'htonll' is invalid in C99 [-Wimplicit-function-declaration]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-# local_nonce = htonll(ntlm->nonce);
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-# Undefined symbols for architecture x86_64:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-# "_htonll", referenced from:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-# _ntlm_client_response in ntlm.c.o
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-# disable NTLM client support on these patforms until this is fixed upstream
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-# https://trac.macports.org/ticket/61057
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-# https://github.com/libgit2/libgit2/issues/5613
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-# https://github.com/libgit2/libgit2/pull/5614
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if {${os.major} < 14} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- configure.args-append \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- -DUSE_NTLMCLIENT:BOOL=OFF
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- }
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span> variant threadsafe description {Build with threadsafe option} {
configure.args-replace \
-DTHREADSAFE:BOOL=OFF -DTHREADSAFE:BOOL=ON
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/devel/libgit2/files/htonll.patch b/devel/libgit2/files/htonll.patch
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 00000000000..005c2e89e11
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/devel/libgit2/files/htonll.patch
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,93 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Use a private implementation of htonll to accommodate systems that don't
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+have one (like OS X 10.9 and earlier).
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+https://github.com/libgit2/libgit2/issues/5613
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+https://github.com/libgit2/libgit2/pull/5614
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- deps/ntlmclient/CMakeLists.txt.orig 2020-06-04 03:46:58.000000000 -0500
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ deps/ntlmclient/CMakeLists.txt 2020-08-24 09:58:38.000000000 -0500
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1,9 +1,16 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++INCLUDE(TestBigEndian)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ FILE(GLOB SRC_NTLMCLIENT "ntlm.c" "unicode_builtin.c" "util.c")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ADD_DEFINITIONS(-DNTLM_STATIC=1)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ DISABLE_WARNINGS(implicit-fallthrough)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++TEST_BIG_ENDIAN(BIG_ENDIAN)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++IF(BIG_ENDIAN)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ ADD_DEFINITIONS(-DNTLM_BIG_ENDIAN)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ENDIF()
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ IF (HTTPS_BACKEND STREQUAL "SecureTransport")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ADD_DEFINITIONS(-DCRYPT_COMMONCRYPTO)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ SET(SRC_NTLMCLIENT_CRYPTO "crypt_commoncrypto.c")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- deps/ntlmclient/compat.h.orig 2020-06-04 03:46:58.000000000 -0500
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ deps/ntlmclient/compat.h 2020-08-24 10:00:04.000000000 -0500
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -21,31 +21,20 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # include <stdbool.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#ifdef __linux__
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-/* See man page endian(3) */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-# include <endian.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-# define htonll htobe64
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#elif defined(__NetBSD__) || defined(__OpenBSD__)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-/* See man page htobe64(3) */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-# include <endian.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-# define htonll htobe64
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#elif defined(__FreeBSD__)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-/* See man page bwaps64(9) */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-# include <sys/endian.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-# define htonll htobe64
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-#elif defined(sun) || defined(__sun)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-/* See man page byteorder(3SOCKET) */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-# include <sys/types.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-# include <netinet/in.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-# include <inttypes.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-# if !defined(htonll)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-# if defined(_BIG_ENDIAN)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-# define htonll(x) (x)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-# else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-# define htonll(x) ((((uint64_t)htonl(x)) << 32) + htonl((uint64_t)(x) >> 32))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-# endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-# endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#if defined(NTLM_BIG_ENDIAN)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++static inline uint64_t ntlm_htonll(uint64_t value)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return value;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++#else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++# include <arpa/inet.h>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++static inline uint64_t ntlm_htonll(uint64_t value)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++{
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ return ((uint64_t)htonl(value) << 32) + htonl((uint64_t)value >> 32);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #endif
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #ifndef MIN
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- deps/ntlmclient/ntlm.c.orig 2020-06-04 03:46:58.000000000 -0500
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ deps/ntlmclient/ntlm.c 2020-08-24 09:57:15.000000000 -0500
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1126,7 +1126,7 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ size_t lm2_len = 16;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ uint64_t local_nonce;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- local_nonce = htonll(ntlm->nonce);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ local_nonce = ntlm_htonll(ntlm->nonce);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (!ntlm_hmac_ctx_reset(ntlm->hmac_ctx) ||
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ !ntlm_hmac_md5_init(ntlm->hmac_ctx,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1198,8 +1198,8 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* the blob's integer values are in network byte order */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ signature = htonl(0x01010000);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- timestamp = htonll(ntlm->timestamp);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+- nonce = htonll(ntlm->nonce);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ timestamp = ntlm_htonll(ntlm->timestamp);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ nonce = ntlm_htonll(ntlm->nonce);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /* construct the blob */
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ memcpy(&blob[0], &signature, 4);
</span></pre><pre style='margin:0'>
</pre>