Skip to content

Commit 5bcda87

Browse files
committed
use systemd instead of libuv for event loop
1 parent 0390c10 commit 5bcda87

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

Package.swift

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,12 @@ enum FlutterELinuxBackendType {
229229
}
230230
}
231231

232+
packageDependencies += [
233+
.package(url: "https://github.com/xtremekforever/swift-systemd", branch: "main"),
234+
]
235+
232236
let FlutterELinuxBackend = FlutterELinuxBackendType.defaultBackend
237+
let FlutterELinuxVulkanEnabled = true
233238

234239
platformSwiftSettings += [
235240
.define("DISPLAY_BACKEND_TYPE_\(FlutterELinuxBackend.displayBackendType)"),
@@ -257,11 +262,6 @@ targets += [
257262
switch FlutterELinuxBackend {
258263
case .drmGbm:
259264
targets += [
260-
.systemLibrary(
261-
name: "CLibUV",
262-
pkgConfig: "libuv",
263-
providers: [.apt(["libuv1-dev"])]
264-
),
265265
.systemLibrary(
266266
name: "CLibInput",
267267
pkgConfig: "libinput",
@@ -322,7 +322,7 @@ let BackendDependencies: [Target.Dependency]
322322

323323
switch FlutterELinuxBackend {
324324
case .drmGbm:
325-
BackendDependencies = ["CLibUV", "CLibInput", "CLibDRM", "CLibUDev", "CGBM"]
325+
BackendDependencies = ["CLibInput", "CLibDRM", "CLibUDev", "CGBM"]
326326
ExcludedSources = WaylandSources + DRMEGLSources
327327
case .drmEglStream:
328328
BackendDependencies = [] // TODO:
@@ -368,7 +368,11 @@ Exclusions += ExcludedSources
368368
targets += [
369369
.target(
370370
name: "CxxFlutterSwift",
371-
dependencies: ["CEGL", "CXKBCommon"] + BackendDependencies,
371+
dependencies: [
372+
"CEGL",
373+
"CXKBCommon",
374+
.product(name: "Systemd", package: "swift-systemd", condition: .when(platforms: [.linux])),
375+
] + BackendDependencies,
372376
exclude: Exclusions,
373377
cSettings: [],
374378
cxxSettings: [
@@ -380,6 +384,7 @@ targets += [
380384
.define("ENABLE_EGL_ALPHA_COMPONENT_OF_COLOR_BUFFER"),
381385
// ENABLE_VSYNC OFF
382386
// .define("ENABLE_VSYNC"),
387+
.define("USE_LIBSYSTEMD"),
383388
// ENABLE_ELINUX_EMBEDDER_LOG ON
384389
.define("ENABLE_ELINUX_EMBEDDER_LOG"),
385390
// .define("FLUTTER_RELEASE") // FIXME: for release

0 commit comments

Comments
 (0)