commit 504d7c6714f59b27028a43949f0088f9c19b39d7
Date:   Sun Oct 13 16:03:12 2019 -0700

    webkit2-gtk: patchset to enable build on MacPorts
    
    presently Mojave against 10.14 SDK, building X11

diff --git Source/JavaScriptCore/shell/PlatformGTK.cmake Source/JavaScriptCore/shell/PlatformGTK.cmake
index c4ac7c9a..cf2fc2d6 100644
--- Source/JavaScriptCore/shell/PlatformGTK.cmake
+++ Source/JavaScriptCore/shell/PlatformGTK.cmake
@@ -1,3 +1,7 @@
 list(APPEND jsc_LIBRARIES
     ${GLIB_LIBRARIES}
 )
+
+list(APPEND jsc_PRIVATE_INCLUDE_DIRECTORIES
+	${WTF_DIR}
+)
diff --git Source/WTF/CMakeLists.txt Source/WTF/CMakeLists.txt
index 7c615c55..dd221b1a 100644
--- Source/WTF/CMakeLists.txt
+++ Source/WTF/CMakeLists.txt
@@ -6,6 +6,6 @@ add_subdirectory(wtf)
 
 # Apple builds have the ICU headers checked into ${WTF_DIR}/icu
 # Copy them into ${ICU_INCLUDE_DIRS} so the build behaves like find_package was used
-if (APPLE)
+if (DISABLEAPPLE)
     file(COPY ${WTF_DIR}/icu/unicode DESTINATION ${ICU_INCLUDE_DIRS})
 endif ()
diff --git Source/WebCore/CMakeLists.txt Source/WebCore/CMakeLists.txt
index a5b62f40..440ef671 100644
--- Source/WebCore/CMakeLists.txt
+++ Source/WebCore/CMakeLists.txt
@@ -178,6 +178,10 @@ set(WebCore_SYSTEM_INCLUDE_DIRECTORIES
     ${ZLIB_INCLUDE_DIRS}
 )
 
+list(APPEND WebCore_SYSTEM_INCLUDE_DIRECTORIES
+	${PAL_DIR}
+)
+
 set(WebCore_IDL_INCLUDES
     css
     dom
diff --git Source/WebCore/PAL/pal/spi/cocoa/CommonCryptoSPI.h Source/WebCore/PAL/pal/spi/cocoa/CommonCryptoSPI.h
new file mode 100644
index 00000000..cf113819
--- /dev/null
+++ Source/WebCore/PAL/pal/spi/cocoa/CommonCryptoSPI.h
@@ -0,0 +1,117 @@
+/*
+ * Copyright (C) 2013-2019 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if USE(APPLE_INTERNAL_SDK)
+
+#include <CommonCrypto/CommonCryptorSPI.h>
+#include <CommonCrypto/CommonDigestSPI.h>
+#include <CommonCrypto/CommonECCryptor.h>
+#include <CommonCrypto/CommonKeyDerivationSPI.h>
+#include <CommonCrypto/CommonRSACryptor.h>
+#include <CommonCrypto/CommonRSACryptorSPI.h>
+
+#else
+
+#ifndef _CC_RSACRYPTOR_H_
+enum {
+    kCCDigestNone = 0,
+    kCCDigestSHA1 = 8,
+    kCCDigestSHA224 = 9,
+    kCCDigestSHA256 = 10,
+    kCCDigestSHA384 = 11,
+    kCCDigestSHA512 = 12,
+};
+typedef uint32_t CCDigestAlgorithm;
+
+enum {
+    ccRSAKeyPublic = 0,
+    ccRSAKeyPrivate = 1
+};
+typedef uint32_t CCRSAKeyType;
+
+enum {
+    ccPKCS1Padding = 1001,
+    ccOAEPPadding = 1002,
+    ccRSAPSSPadding = 1005
+};
+typedef uint32_t CCAsymmetricPadding;
+#endif
+
+typedef struct _CCRSACryptor *CCRSACryptorRef;
+extern "C" CCCryptorStatus CCRSACryptorEncrypt(CCRSACryptorRef publicKey, CCAsymmetricPadding padding, const void *plainText, size_t plainTextLen, void *cipherText, size_t *cipherTextLen, const void *tagData, size_t tagDataLen, CCDigestAlgorithm digestType);
+extern "C" CCCryptorStatus CCRSACryptorDecrypt(CCRSACryptorRef privateKey, CCAsymmetricPadding padding, const void *cipherText, size_t cipherTextLen, void *plainText, size_t *plainTextLen, const void *tagData, size_t tagDataLen, CCDigestAlgorithm digestType);
+extern "C" CCCryptorStatus CCRSACryptorSign(CCRSACryptorRef privateKey, CCAsymmetricPadding padding, const void *hashToSign, size_t hashSignLen, CCDigestAlgorithm digestType, size_t saltLen, void *signedData, size_t *signedDataLen);
+extern "C" CCCryptorStatus CCRSACryptorVerify(CCRSACryptorRef publicKey, CCAsymmetricPadding padding, const void *hash, size_t hashLen, CCDigestAlgorithm digestType, size_t saltLen, const void *signedData, size_t signedDataLen);
+extern "C" CCCryptorStatus CCRSACryptorGeneratePair(size_t keysize, uint32_t e, CCRSACryptorRef *publicKey, CCRSACryptorRef *privateKey);
+extern "C" CCRSACryptorRef CCRSACryptorGetPublicKeyFromPrivateKey(CCRSACryptorRef privkey);
+extern "C" void CCRSACryptorRelease(CCRSACryptorRef key);
+extern "C" CCCryptorStatus CCRSAGetKeyComponents(CCRSACryptorRef rsaKey, uint8_t *modulus, size_t *modulusLength, uint8_t *exponent, size_t *exponentLength, uint8_t *p, size_t *pLength, uint8_t *q, size_t *qLength);
+extern "C" CCRSAKeyType CCRSAGetKeyType(CCRSACryptorRef key);
+extern "C" CCCryptorStatus CCRSACryptorImport(const void *keyPackage, size_t keyPackageLen, CCRSACryptorRef *key);
+extern "C" CCCryptorStatus CCRSACryptorExport(CCRSACryptorRef key, void *out, size_t *outLen);
+
+extern "C" CCCryptorStatus CCRSAGetCRTComponentsSizes(CCRSACryptorRef rsaKey, size_t *dpSize, size_t *dqSize, size_t *qinvSize);
+extern "C" CCCryptorStatus CCRSAGetCRTComponents(CCRSACryptorRef rsaKey, void *dp, size_t dpSize, void *dq, size_t dqSize, void *qinv, size_t qinvSize);
+
+#ifndef _CC_ECCRYPTOR_H_
+enum {
+    ccECKeyPublic = 0,
+    ccECKeyPrivate = 1,
+};
+typedef uint32_t CCECKeyType;
+
+enum {
+    kCCImportKeyBinary = 0,
+};
+typedef uint32_t CCECKeyExternalFormat;
+#endif
+
+typedef struct _CCECCryptor *CCECCryptorRef;
+extern "C" CCCryptorStatus CCECCryptorGeneratePair(size_t keysize, CCECCryptorRef *publicKey, CCECCryptorRef *privateKey);
+extern "C" void CCECCryptorRelease(CCECCryptorRef key);
+extern "C" CCCryptorStatus CCECCryptorImportKey(CCECKeyExternalFormat format, const void *keyPackage, size_t keyPackageLen, CCECKeyType keyType, CCECCryptorRef *key);
+extern "C" CCCryptorStatus CCECCryptorExportKey(CCECKeyExternalFormat format, void *keyPackage, size_t *keyPackageLen, CCECKeyType keyType, CCECCryptorRef key);
+extern "C" int CCECGetKeySize(CCECCryptorRef key);
+extern "C" CCCryptorStatus CCECCryptorCreateFromData(size_t keySize, uint8_t *qX, size_t qXLength, uint8_t *qY, size_t qYLength, CCECCryptorRef *ref);
+extern "C" CCCryptorStatus CCECCryptorGetKeyComponents(CCECCryptorRef ecKey, size_t *keySize, uint8_t *qX, size_t *qXLength, uint8_t *qY, size_t *qYLength, uint8_t *d, size_t *dLength);
+extern "C" CCCryptorStatus CCECCryptorComputeSharedSecret(CCECCryptorRef privateKey, CCECCryptorRef publicKey, void *out, size_t *outLen);
+extern "C" CCCryptorStatus CCECCryptorSignHash(CCECCryptorRef privateKey, const void *hashToSign, size_t hashSignLen, void *signedData, size_t *signedDataLen);
+extern "C" CCCryptorStatus CCECCryptorVerifyHash(CCECCryptorRef publicKey, const void *hash, size_t hashLen, const void *signedData, size_t signedDataLen, uint32_t *valid);
+
+#ifndef CommonCrypto_CommonNistKeyDerivation_h
+enum {
+    kCCKDFAlgorithmHKDF = 6
+};
+typedef uint32_t CCKDFAlgorithm;
+#endif
+
+extern "C" CCStatus CCKeyDerivationHMac(CCKDFAlgorithm algorithm, CCDigestAlgorithm digest, unsigned rounds, const void *keyDerivationKey, size_t keyDerivationKeyLen, const void *label, size_t labelLen, const void *context, size_t contextLen, const void *iv, size_t ivLen, const void *salt, size_t saltLen, void *derivedKey, size_t derivedKeyLen);
+
+extern "C" CCCryptorStatus CCCryptorGCM(CCOperation op, CCAlgorithm alg, const void* key, size_t keyLength, const void* iv, size_t ivLen, const void* aData, size_t aDataLen, const void* dataIn, size_t dataInLength, void* dataOut, void* tag, size_t* tagLength);
+extern "C" CCCryptorStatus CCRSACryptorCreateFromData(CCRSAKeyType keyType, const uint8_t *modulus, size_t modulusLength, const uint8_t *exponent, size_t exponentLength, const uint8_t *p, size_t pLength, const uint8_t *q, size_t qLength, CCRSACryptorRef *ref);
+
+#endif // !USE(APPLE_INTERNAL_SDK)
--- Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp.orig	2019-11-26 03:02:20.000000000 -0800
+++ Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp	2019-11-26 14:56:04.000000000 -0800
@@ -1504,7 +1504,7 @@
     if (GST_STATE(m_pipeline.get()) < GST_STATE_PAUSED)
         return MediaTime::invalidTime();
 
-    int64_t duration = 0;
+    gint64 duration = 0;
     if (!gst_element_query_duration(m_pipeline.get(), GST_FORMAT_TIME, &duration) || !GST_CLOCK_TIME_IS_VALID(duration)) {
         GST_DEBUG_OBJECT(pipeline(), "Time duration query failed for %s", m_url.string().utf8().data());
         return MediaTime::positiveInfiniteTime();
@@ -2267,7 +2267,7 @@
             GUniqueOutPtr<GstStructure> responseHeaders;
             if (gst_structure_get(structure, "response-headers", GST_TYPE_STRUCTURE, &responseHeaders.outPtr(), nullptr)) {
                 CString contentLengthHeaderName = httpHeaderNameString(HTTPHeaderName::ContentLength).utf8();
-                uint64_t contentLength = 0;
+                guint64 contentLength = 0;
                 if (!gst_structure_get_uint64(responseHeaders.get(), contentLengthHeaderName.data(), &contentLength)) {
                     // souphttpsrc sets a string for Content-Length, so
                     // handle it here, until we remove the webkit+ protocol
@@ -3707,8 +3707,8 @@ Optional<VideoPlaybackQualityMetrics> MediaPlayerPrivateGStreamer::videoPlayback
     if (!webkitGstCheckVersion(1, 17, 0) && !m_fpsSink)
         return WTF::nullopt;
 
-    uint64_t totalVideoFrames = 0;
-    uint64_t droppedVideoFrames = 0;
+    guint64 totalVideoFrames = 0;
+    guint64 droppedVideoFrames = 0;
     if (webkitGstCheckVersion(1, 17, 0)) {
         GUniqueOutPtr<GstStructure> stats;
         g_object_get(m_videoSink.get(), "stats", &stats.outPtr(), nullptr);
