diff --git a/.gitignore b/.gitignore index 903db58..b8fabdd 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,8 @@ src lib frameworks include/openssl +.build +swiftpm *.gz *.gz.asc *.framework diff --git a/Package.swift b/Package.swift new file mode 100644 index 0000000..165639b --- /dev/null +++ b/Package.swift @@ -0,0 +1,26 @@ +// swift-tools-version:5.5 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +import PackageDescription + +let package = Package( + name: "openssl-apple", + products: [ + // Products define the executables and libraries a package produces, and make them visible to other packages. + .library( + name: "openssl-apple", + targets: ["openssl"]), + ], + dependencies: [ + // Dependencies declare other packages that this package depends on. + // .package(url: /* package url */, from: "1.0.0"), + ], + targets: [ + // Targets are the basic building blocks of a package. A target can define a module or a test suite. + // Targets can depend on other targets in this package, and on products in packages this package depends on. + .binaryTarget( + name: "openssl", + url: "https://github.com/keeshux/openssl-apple/releases/download/openssl-1.1.1l/openssl.xcframework.zip", + checksum: "18628fddadcac81c96e5824d62991b93172f58c7539cebb4ddba4df52b99aade") + ] +) diff --git a/create-swiftpm-binaries.sh b/create-swiftpm-binaries.sh new file mode 100755 index 0000000..9d70b08 --- /dev/null +++ b/create-swiftpm-binaries.sh @@ -0,0 +1,12 @@ +#!/bin/bash +VERSION="1.1.1l" +TARGETS="ios-sim-cross-x86_64 ios-sim-cross-arm64 ios64-cross-arm64 ios64-cross-arm64e macos64-x86_64 macos64-arm64 mac-catalyst-x86_64 mac-catalyst-arm64" +FRAMEWORK="openssl.xcframework" +FRAMEWORK_ZIP="openssl.xcframework.zip" +FRAMEWORK_DIR="swiftpm/$VERSION" +./build-libssl.sh --version="$VERSION" --targets="$TARGETS" +./create-openssl-framework.sh dynamic +( cd frameworks && zip -r $FRAMEWORK_ZIP $FRAMEWORK ) +mkdir -p $FRAMEWORK_DIR +mv frameworks/$FRAMEWORK_ZIP $FRAMEWORK_DIR +swift package compute-checksum $FRAMEWORK_DIR/$FRAMEWORK_ZIP