Skip to content

Commit 04f816c

Browse files
committed
FIx build issue and CI issue
1 parent 40164fc commit 04f816c

File tree

13 files changed

+86
-57
lines changed

13 files changed

+86
-57
lines changed

Package.resolved

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ let openSwiftUISPITarget = Target.target(
101101
.product(name: "OpenBox", package: "OpenBox"),
102102
],
103103
publicHeadersPath: ".",
104-
cSettings: sharedCSettings,
104+
cSettings: sharedCSettings + [.define("_GNU_SOURCE", .when(platforms: .nonDarwinPlatforms))],
105105
cxxSettings: sharedCxxSettings
106106
)
107107
let coreGraphicsShims = Target.target(
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
//
2+
// CGAffineTransform.swift
3+
// CoreGraphicsShims
4+
5+
#if !canImport(CoreGraphics)
6+
public import Foundation
7+
8+
// FIXME: Use Silica or other implementation
9+
public struct CGAffineTransform: Equatable {
10+
public init() {
11+
a = .zero
12+
b = .zero
13+
c = .zero
14+
d = .zero
15+
tx = .zero
16+
ty = .zero
17+
}
18+
19+
public init(a: Double, b: Double, c: Double, d: Double, tx: Double, ty: Double) {
20+
self.a = a
21+
self.b = b
22+
self.c = c
23+
self.d = d
24+
self.tx = tx
25+
self.ty = ty
26+
}
27+
28+
public var a: Double
29+
public var b: Double
30+
public var c: Double
31+
public var d: Double
32+
public var tx: Double
33+
public var ty: Double
34+
35+
public static let identity = CGAffineTransform(a: 1, b: 0, c: 0, d: 1, tx: 0, ty: 0)
36+
37+
public func concatenating(_ transform: CGAffineTransform) -> CGAffineTransform {
38+
preconditionFailure("Unimplemented")
39+
}
40+
41+
public func inverted() -> CGAffineTransform {
42+
preconditionFailure("Unimplemented")
43+
}
44+
}
45+
46+
extension CGPoint {
47+
public func applying(_ t: CGAffineTransform) -> CGPoint {
48+
preconditionFailure("Unimplemented")
49+
}
50+
}
51+
52+
extension CGSize {
53+
public func applying(_ t: CGAffineTransform) -> CGSize {
54+
preconditionFailure("Unimplemented")
55+
}
56+
}
57+
58+
extension CGRect {
59+
public func applying(_ t: CGAffineTransform) -> CGRect {
60+
preconditionFailure("Unimplemented")
61+
}
62+
}
63+
64+
#endif

Sources/CoreGraphicsShims/Export.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@
44

55
#if canImport(CoreGraphics)
66
@_exported import CoreGraphics
7+
#else
8+
@_exported import CoreFoundation
79
#endif

Sources/OpenSwiftUICore/Extension/CGAffineTransform+Extension.swift

Lines changed: 1 addition & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -5,48 +5,8 @@
55
// Audited for iOS 18.0
66
// Status: Complete
77

8-
#if canImport(CoreGraphics)
9-
package import CoreGraphics
10-
#else
8+
package import CoreGraphicsShims
119
package import Foundation
12-
// FIXME: Use Silica or other implementation
13-
public struct CGAffineTransform: Equatable {
14-
public init() {
15-
a = .zero
16-
b = .zero
17-
c = .zero
18-
d = .zero
19-
tx = .zero
20-
ty = .zero
21-
}
22-
23-
public init(a: Double, b: Double, c: Double, d: Double, tx: Double, ty: Double) {
24-
self.a = a
25-
self.b = b
26-
self.c = c
27-
self.d = d
28-
self.tx = tx
29-
self.ty = ty
30-
}
31-
32-
public var a: Double
33-
public var b: Double
34-
public var c: Double
35-
public var d: Double
36-
public var tx: Double
37-
public var ty: Double
38-
39-
public static let identity = CGAffineTransform(a: 1, b: 0, c: 0, d: 1, tx: 0, ty: 0)
40-
41-
public func concatenating(_ transform: CGAffineTransform) -> CGAffineTransform {
42-
preconditionFailure("Unimplemented")
43-
}
44-
45-
public func inverted() -> CGAffineTransform {
46-
preconditionFailure("Unimplemented")
47-
}
48-
}
49-
#endif
5010

5111
extension CGAffineTransform {
5212
package init(rotation: Angle) {

Sources/OpenSwiftUICore/Layout/Geometry/ProjectionTransform.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
// Status: Complete
77

88
public import Foundation
9+
public import CoreGraphicsShims
910
#if canImport(QuartzCore)
1011
public import QuartzCore
1112
#endif

Sources/OpenSwiftUICore/Layout/View/ViewTransform.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
// ID: 1CC2FE016A82CF91549A64E942CE8ED4 (SwiftUICore)
99

1010
package import Foundation
11+
package import CoreGraphicsShims
1112

1213
@_spi(ForOpenSwiftUIOnly)
1314
public struct ViewTransform: Equatable, CustomStringConvertible {

Sources/OpenSwiftUICore/Shape/Path.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ public struct Path: Equatable, LosslessStringConvertible, @unchecked Sendable {
3333

3434
private var kind: Kind
3535

36+
#if canImport(CoreGraphics)
3637
private var data: PathData
3738

3839
@inline(__always)
@@ -41,13 +42,15 @@ public struct Path: Equatable, LosslessStringConvertible, @unchecked Sendable {
4142
//data = PathData(path)
4243
preconditionFailure("TODO")
4344
}
45+
#endif
4446

4547
package init(takingPath path: OBPath) {
4648
kind = .obPath
4749
//data = PathData(path)
4850
preconditionFailure("TODO")
4951
}
5052

53+
#if canImport(CoreGraphics)
5154
private func prepareBuffer() {
5255
let obPath: OBPath
5356
switch kind {
@@ -64,6 +67,7 @@ public struct Path: Equatable, LosslessStringConvertible, @unchecked Sendable {
6467
// storage.appendPath
6568
obPath.release()
6669
}
70+
#endif
6771

6872
@usableFromInline
6973
package static func == (lhs: PathBox, rhs: PathBox) -> Bool {
@@ -299,7 +303,7 @@ public struct Path: Equatable, LosslessStringConvertible, @unchecked Sendable {
299303
}
300304
#endif
301305

302-
package func retainRBPath() -> RBPath {
306+
package func retainOBPath() -> OBPath {
303307
preconditionFailure("TODO")
304308
}
305309

Sources/OpenSwiftUICore/Shape/RoundedCorner.swift

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
// Status: WIP
77

88
public import Foundation
9-
#if canImport(CoreGraphics)
10-
package import CoreGraphics
11-
#endif
9+
package import CoreGraphicsShims
1210

1311
// MARK: - RoundedCornerStyle
1412

@@ -72,10 +70,10 @@ package struct FixedRoundedRect: Equatable {
7270
}
7371

7472
// TODO: RenderBox
75-
// package func withTemporaryPath<R>(_ body: (RBPath) -> R) -> R
73+
// package func withTemporaryPath<R>(_ body: (OBPath) -> R) -> R
7674

7775
package func contains(_ point: CGPoint) -> Bool {
78-
// TODO: RBPath
76+
// TODO: OBPath
7977
preconditionFailure("TODO")
8078
}
8179

Sources/OpenSwiftUICore/Shape/Shape.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ extension Shape {
163163
/// line-width defined by `lineWidth` and all other properties of
164164
/// `StrokeStyle` having their default values.
165165
@inlinable
166-
nonisolated public func stroke(lineWidth: CoreFoundation.CGFloat = 1) -> some Shape {
166+
nonisolated public func stroke(lineWidth: CGFloat = 1) -> some Shape {
167167
return stroke(style: StrokeStyle(lineWidth: lineWidth))
168168
}
169169
}

0 commit comments

Comments
 (0)