Skip to content

Commit 5dbf2fa

Browse files
Ship with BoringSSL (#135)
1 parent 5e12335 commit 5dbf2fa

File tree

11 files changed

+125
-11
lines changed

11 files changed

+125
-11
lines changed

Package.swift

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ let package = Package(
4646
],
4747
dependencies: [
4848
.package(url: "https://github.com/apple/swift-nio.git", from: "2.55.0"),
49-
.package(url: "https://github.com/swift-server/swift-service-lifecycle.git", from: "2.0.0-beta.1"),
49+
.package(url: "https://github.com/apple/swift-nio-ssl", from: "2.25.0"),
50+
.package(url: "https://github.com/swift-server/swift-service-lifecycle.git", from: "2.1.0"),
5051
.package(url: "https://github.com/apple/swift-log.git", from: "1.0.0"),
5152
// The zstd Swift package produces warnings that we cannot resolve:
5253
// https://github.com/facebook/zstd/issues/3328
@@ -56,7 +57,7 @@ let package = Package(
5657
.target(
5758
name: "Crdkafka",
5859
dependencies: [
59-
"COpenSSL",
60+
.product(name: "NIOSSL", package: "swift-nio-ssl"),
6061
.product(name: "libzstd", package: "zstd"),
6162
],
6263
exclude: rdkafkaExclude,
@@ -65,7 +66,9 @@ let package = Package(
6566
cSettings: [
6667
// dummy folder, because config.h is included as "../config.h" in librdkafka
6768
.headerSearchPath("./custom/config/dummy"),
69+
.headerSearchPath("./custom/include"),
6870
.headerSearchPath("./librdkafka/src"),
71+
.define("_GNU_SOURCE", to: "1"), // Fix build error for Swift 5.9 onwards
6972
],
7073
linkerSettings: [
7174
.linkedLibrary("curl"),
@@ -88,14 +91,6 @@ let package = Package(
8891
"Kafka",
8992
]
9093
),
91-
.systemLibrary(
92-
name: "COpenSSL",
93-
pkgConfig: "openssl",
94-
providers: [
95-
.brew(["libressl"]),
96-
.apt(["libssl-dev"]),
97-
]
98-
),
9994
.testTarget(
10095
name: "KafkaTests",
10196
dependencies: ["Kafka"]

Sources/COpenSSL/module.modulemap

Whitespace-only changes.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
//===----------------------------------------------------------------------===//
2+
//
3+
// This source file is part of the swift-kafka-client open source project
4+
//
5+
// Copyright (c) 2023 Apple Inc. and the swift-kafka-client project authors
6+
// Licensed under Apache License v2.0
7+
//
8+
// See LICENSE.txt for license information
9+
// See CONTRIBUTORS.txt for the list of swift-kafka-client project authors
10+
//
11+
// SPDX-License-Identifier: Apache-2.0
12+
//
13+
//===----------------------------------------------------------------------===//
14+
15+
#include "CNIOBoringSSL_err.h"
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
//===----------------------------------------------------------------------===//
2+
//
3+
// This source file is part of the swift-kafka-client open source project
4+
//
5+
// Copyright (c) 2023 Apple Inc. and the swift-kafka-client project authors
6+
// Licensed under Apache License v2.0
7+
//
8+
// See LICENSE.txt for license information
9+
// See CONTRIBUTORS.txt for the list of swift-kafka-client project authors
10+
//
11+
// SPDX-License-Identifier: Apache-2.0
12+
//
13+
//===----------------------------------------------------------------------===//
14+
15+
#include "CNIOBoringSSL_evp.h"
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
//===----------------------------------------------------------------------===//
2+
//
3+
// This source file is part of the swift-kafka-client open source project
4+
//
5+
// Copyright (c) 2023 Apple Inc. and the swift-kafka-client project authors
6+
// Licensed under Apache License v2.0
7+
//
8+
// See LICENSE.txt for license information
9+
// See CONTRIBUTORS.txt for the list of swift-kafka-client project authors
10+
//
11+
// SPDX-License-Identifier: Apache-2.0
12+
//
13+
//===----------------------------------------------------------------------===//
14+
15+
#include "CNIOBoringSSL_hmac.h"
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
//===----------------------------------------------------------------------===//
2+
//
3+
// This source file is part of the swift-kafka-client open source project
4+
//
5+
// Copyright (c) 2023 Apple Inc. and the swift-kafka-client project authors
6+
// Licensed under Apache License v2.0
7+
//
8+
// See LICENSE.txt for license information
9+
// See CONTRIBUTORS.txt for the list of swift-kafka-client project authors
10+
//
11+
// SPDX-License-Identifier: Apache-2.0
12+
//
13+
//===----------------------------------------------------------------------===//
14+
15+
#include "CNIOBoringSSL_pkcs12.h"
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
//===----------------------------------------------------------------------===//
2+
//
3+
// This source file is part of the swift-kafka-client open source project
4+
//
5+
// Copyright (c) 2023 Apple Inc. and the swift-kafka-client project authors
6+
// Licensed under Apache License v2.0
7+
//
8+
// See LICENSE.txt for license information
9+
// See CONTRIBUTORS.txt for the list of swift-kafka-client project authors
10+
//
11+
// SPDX-License-Identifier: Apache-2.0
12+
//
13+
//===----------------------------------------------------------------------===//
14+
15+
#include "CNIOBoringSSL_sha.h"
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
//===----------------------------------------------------------------------===//
2+
//
3+
// This source file is part of the swift-kafka-client open source project
4+
//
5+
// Copyright (c) 2023 Apple Inc. and the swift-kafka-client project authors
6+
// Licensed under Apache License v2.0
7+
//
8+
// See LICENSE.txt for license information
9+
// See CONTRIBUTORS.txt for the list of swift-kafka-client project authors
10+
//
11+
// SPDX-License-Identifier: Apache-2.0
12+
//
13+
//===----------------------------------------------------------------------===//
14+
15+
#include "CNIOBoringSSL_ssl.h"
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
//===----------------------------------------------------------------------===//
2+
//
3+
// This source file is part of the swift-kafka-client open source project
4+
//
5+
// Copyright (c) 2023 Apple Inc. and the swift-kafka-client project authors
6+
// Licensed under Apache License v2.0
7+
//
8+
// See LICENSE.txt for license information
9+
// See CONTRIBUTORS.txt for the list of swift-kafka-client project authors
10+
//
11+
// SPDX-License-Identifier: Apache-2.0
12+
//
13+
//===----------------------------------------------------------------------===//
14+
15+
#include "CNIOBoringSSL_x509.h"
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
//===----------------------------------------------------------------------===//
2+
//
3+
// This source file is part of the swift-kafka-client open source project
4+
//
5+
// Copyright (c) 2023 Apple Inc. and the swift-kafka-client project authors
6+
// Licensed under Apache License v2.0
7+
//
8+
// See LICENSE.txt for license information
9+
// See CONTRIBUTORS.txt for the list of swift-kafka-client project authors
10+
//
11+
// SPDX-License-Identifier: Apache-2.0
12+
//
13+
//===----------------------------------------------------------------------===//
14+
15+
#include "CNIOBoringSSL_x509_vfy.h"

docker/Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ ENV LANGUAGE en_US.UTF-8
1515
# Dependencies
1616
RUN apt-get update
1717
RUN apt-get install libsasl2-dev -y
18-
RUN apt-get install libssl-dev -y
1918

2019
# tools
2120
RUN mkdir -p $HOME/.tools

0 commit comments

Comments
 (0)