From 2248fe8c01e565cdf094111989385a64c66d6f97 Mon Sep 17 00:00:00 2001 From: Shibo Lyu Date: Tue, 22 Apr 2025 19:24:19 +0800 Subject: [PATCH] Add Swift 5.8+ package configuration for backward compatibility with old toolchains --- Package@swift-5.8.swift | 44 +++++++++++++++++++++++++++++++++++++++++ README.md | 1 + 2 files changed, 45 insertions(+) diff --git a/Package@swift-5.8.swift b/Package@swift-5.8.swift index e69de29..a56c119 100644 --- a/Package@swift-5.8.swift +++ b/Package@swift-5.8.swift @@ -0,0 +1,44 @@ +// swift-tools-version: 5.8 + +import PackageDescription + +let package = Package( + name: "Minisign", + platforms: [ + .macOS(.v10_15), + .iOS(.v13), + .visionOS(.v1), + .tvOS(.v13), + .watchOS(.v6), + ], + products: [ + // Products define the executables and libraries a package produces, making them visible to other packages. + .library( + name: "Minisign", + targets: ["Minisign"] + ) + ], + dependencies: [ + .package(url: "https://github.com/apple/swift-crypto", from: "2.0.0"), + .package(url: "https://github.com/lovetodream/swift-blake2", from: "0.1.0"), + ], + targets: [ + // Targets are the basic building blocks of a package, defining a module or a test suite. + // Targets can depend on other targets in this package and products from dependencies. + .target( + name: "Minisign", + dependencies: [ + .product(name: "Crypto", package: "swift-crypto"), + .product(name: "BLAKE2", package: "swift-blake2"), + ], + swiftSettings: [ + .define("UseSwiftCrypto") + ] + ), + .testTarget( + name: "MinisignTests", + dependencies: ["Minisign"] + ), + ], + swiftLanguageModes: [.version("6"), .v5], +) diff --git a/README.md b/README.md index 5a22615..4504a90 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,7 @@ Swift implementation of Minisign, a simple and secure tool for signing and verif This is a fork of [slarew/swift-minisign](https://github.com/slarew/swift-minisign), with these improvements: - Convenient & efficient API for verifying (big) files +- `Sendable` conformance & full Swift 6 support - Replaced C wrapping `swift-crypto-blake2` with [pure Swift implementation of blake2b](https://github.com/lovetodream/swift-blake2). - For Apple platforms, Swift Crypto dependency is now optional, controllable via trait `UseSwiftCrypto`.