diff --git a/Package.swift b/Package.swift index 8d463327..aa93da09 100644 --- a/Package.swift +++ b/Package.swift @@ -46,8 +46,7 @@ let package = Package( ], dependencies: [ .package(url: "https://github.com/apple/swift-nio.git", from: "2.55.0"), - .package(url: "https://github.com/apple/swift-nio-ssl", from: "2.25.0"), - .package(url: "https://github.com/swift-server/swift-service-lifecycle.git", from: "2.1.0"), + .package(url: "https://github.com/swift-server/swift-service-lifecycle.git", from: "2.0.0"), .package(url: "https://github.com/apple/swift-log.git", from: "1.0.0"), // The zstd Swift package produces warnings that we cannot resolve: // https://github.com/facebook/zstd/issues/3328 @@ -57,7 +56,7 @@ let package = Package( .target( name: "Crdkafka", dependencies: [ - .product(name: "NIOSSL", package: "swift-nio-ssl"), + "COpenSSL", .product(name: "libzstd", package: "zstd"), ], exclude: rdkafkaExclude, @@ -66,9 +65,7 @@ let package = Package( cSettings: [ // dummy folder, because config.h is included as "../config.h" in librdkafka .headerSearchPath("./custom/config/dummy"), - .headerSearchPath("./custom/include"), .headerSearchPath("./librdkafka/src"), - .define("_GNU_SOURCE", to: "1"), // Fix build error for Swift 5.9 onwards ], linkerSettings: [ .linkedLibrary("curl"), @@ -91,6 +88,14 @@ let package = Package( "Kafka", ] ), + .systemLibrary( + name: "COpenSSL", + pkgConfig: "openssl", + providers: [ + .brew(["libressl"]), + .apt(["libssl-dev"]), + ] + ), .testTarget( name: "KafkaTests", dependencies: ["Kafka"] diff --git a/Sources/COpenSSL/module.modulemap b/Sources/COpenSSL/module.modulemap new file mode 100644 index 00000000..e69de29b diff --git a/Sources/Crdkafka/custom/include/openssl/err.h b/Sources/Crdkafka/custom/include/openssl/err.h deleted file mode 100644 index 61a232a5..00000000 --- a/Sources/Crdkafka/custom/include/openssl/err.h +++ /dev/null @@ -1,15 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// This source file is part of the swift-kafka-client open source project -// -// Copyright (c) 2023 Apple Inc. and the swift-kafka-client project authors -// Licensed under Apache License v2.0 -// -// See LICENSE.txt for license information -// See CONTRIBUTORS.txt for the list of swift-kafka-client project authors -// -// SPDX-License-Identifier: Apache-2.0 -// -//===----------------------------------------------------------------------===// - -#include "CNIOBoringSSL_err.h" diff --git a/Sources/Crdkafka/custom/include/openssl/evp.h b/Sources/Crdkafka/custom/include/openssl/evp.h deleted file mode 100644 index 54218188..00000000 --- a/Sources/Crdkafka/custom/include/openssl/evp.h +++ /dev/null @@ -1,15 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// This source file is part of the swift-kafka-client open source project -// -// Copyright (c) 2023 Apple Inc. and the swift-kafka-client project authors -// Licensed under Apache License v2.0 -// -// See LICENSE.txt for license information -// See CONTRIBUTORS.txt for the list of swift-kafka-client project authors -// -// SPDX-License-Identifier: Apache-2.0 -// -//===----------------------------------------------------------------------===// - -#include "CNIOBoringSSL_evp.h" diff --git a/Sources/Crdkafka/custom/include/openssl/hmac.h b/Sources/Crdkafka/custom/include/openssl/hmac.h deleted file mode 100644 index 60a44389..00000000 --- a/Sources/Crdkafka/custom/include/openssl/hmac.h +++ /dev/null @@ -1,15 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// This source file is part of the swift-kafka-client open source project -// -// Copyright (c) 2023 Apple Inc. and the swift-kafka-client project authors -// Licensed under Apache License v2.0 -// -// See LICENSE.txt for license information -// See CONTRIBUTORS.txt for the list of swift-kafka-client project authors -// -// SPDX-License-Identifier: Apache-2.0 -// -//===----------------------------------------------------------------------===// - -#include "CNIOBoringSSL_hmac.h" diff --git a/Sources/Crdkafka/custom/include/openssl/pkcs12.h b/Sources/Crdkafka/custom/include/openssl/pkcs12.h deleted file mode 100644 index 5d13efe2..00000000 --- a/Sources/Crdkafka/custom/include/openssl/pkcs12.h +++ /dev/null @@ -1,15 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// This source file is part of the swift-kafka-client open source project -// -// Copyright (c) 2023 Apple Inc. and the swift-kafka-client project authors -// Licensed under Apache License v2.0 -// -// See LICENSE.txt for license information -// See CONTRIBUTORS.txt for the list of swift-kafka-client project authors -// -// SPDX-License-Identifier: Apache-2.0 -// -//===----------------------------------------------------------------------===// - -#include "CNIOBoringSSL_pkcs12.h" diff --git a/Sources/Crdkafka/custom/include/openssl/sha.h b/Sources/Crdkafka/custom/include/openssl/sha.h deleted file mode 100644 index e58bcc98..00000000 --- a/Sources/Crdkafka/custom/include/openssl/sha.h +++ /dev/null @@ -1,15 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// This source file is part of the swift-kafka-client open source project -// -// Copyright (c) 2023 Apple Inc. and the swift-kafka-client project authors -// Licensed under Apache License v2.0 -// -// See LICENSE.txt for license information -// See CONTRIBUTORS.txt for the list of swift-kafka-client project authors -// -// SPDX-License-Identifier: Apache-2.0 -// -//===----------------------------------------------------------------------===// - -#include "CNIOBoringSSL_sha.h" diff --git a/Sources/Crdkafka/custom/include/openssl/ssl.h b/Sources/Crdkafka/custom/include/openssl/ssl.h deleted file mode 100644 index 634d88d4..00000000 --- a/Sources/Crdkafka/custom/include/openssl/ssl.h +++ /dev/null @@ -1,15 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// This source file is part of the swift-kafka-client open source project -// -// Copyright (c) 2023 Apple Inc. and the swift-kafka-client project authors -// Licensed under Apache License v2.0 -// -// See LICENSE.txt for license information -// See CONTRIBUTORS.txt for the list of swift-kafka-client project authors -// -// SPDX-License-Identifier: Apache-2.0 -// -//===----------------------------------------------------------------------===// - -#include "CNIOBoringSSL_ssl.h" diff --git a/Sources/Crdkafka/custom/include/openssl/x509.h b/Sources/Crdkafka/custom/include/openssl/x509.h deleted file mode 100644 index 3db443e9..00000000 --- a/Sources/Crdkafka/custom/include/openssl/x509.h +++ /dev/null @@ -1,15 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// This source file is part of the swift-kafka-client open source project -// -// Copyright (c) 2023 Apple Inc. and the swift-kafka-client project authors -// Licensed under Apache License v2.0 -// -// See LICENSE.txt for license information -// See CONTRIBUTORS.txt for the list of swift-kafka-client project authors -// -// SPDX-License-Identifier: Apache-2.0 -// -//===----------------------------------------------------------------------===// - -#include "CNIOBoringSSL_x509.h" diff --git a/Sources/Crdkafka/custom/include/openssl/x509_vfy.h b/Sources/Crdkafka/custom/include/openssl/x509_vfy.h deleted file mode 100644 index aba8dcb1..00000000 --- a/Sources/Crdkafka/custom/include/openssl/x509_vfy.h +++ /dev/null @@ -1,15 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// This source file is part of the swift-kafka-client open source project -// -// Copyright (c) 2023 Apple Inc. and the swift-kafka-client project authors -// Licensed under Apache License v2.0 -// -// See LICENSE.txt for license information -// See CONTRIBUTORS.txt for the list of swift-kafka-client project authors -// -// SPDX-License-Identifier: Apache-2.0 -// -//===----------------------------------------------------------------------===// - -#include "CNIOBoringSSL_x509_vfy.h" diff --git a/Sources/Crdkafka/librdkafka b/Sources/Crdkafka/librdkafka index c282ba24..95a542c8 160000 --- a/Sources/Crdkafka/librdkafka +++ b/Sources/Crdkafka/librdkafka @@ -1 +1 @@ -Subproject commit c282ba2423b2694052393c8edb0399a5ef471b3f +Subproject commit 95a542c87c61d2c45b445f91c73dd5442eb04f3c diff --git a/docker/Dockerfile b/docker/Dockerfile index 31ae9a21..0b7a72a4 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -15,6 +15,7 @@ ENV LANGUAGE en_US.UTF-8 # Dependencies RUN apt-get update RUN apt-get install libsasl2-dev -y +RUN apt-get install openssl -y # tools RUN mkdir -p $HOME/.tools