Skip to content

Commit 016f3b9

Browse files
Yuxin-Qiaosteipete
andauthored
build: add opt-in musl SQLite link path (#1609)
Co-authored-by: Peter Steinberger <[email protected]>
1 parent d39b4d8 commit 016f3b9

2 files changed

Lines changed: 13 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
- Display: add a Hide critters option for plain menu bar quota capsules. Thanks @elijahfriedman!
88

99
### Changed
10+
- Linux CLI: accept an opt-in static SQLite library directory for musl builds. Thanks @Yuxin-Qiao!
1011
- Linux CLI: add musl source compatibility for static Linux SDK builds. Thanks @Yuxin-Qiao!
1112
- Cost history: resize the chart details to the hovered day's model breakdown instead of reserving the tallest day. Thanks @elijahfriedman!
1213
- Antigravity: use current backend quota labels in menus and widgets while preferring a usable quota lane over an exhausted one. Thanks @Yuxin-Qiao!

Package.swift

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@ let sweetCookieKitDependency: Package.Dependency =
1010
? .package(path: sweetCookieKitPath)
1111
: .package(url: "https://github.com/steipete/SweetCookieKit", from: "0.4.1")
1212

13+
let sqlite3LibDir = ProcessInfo.processInfo.environment["CODEXBAR_SQLITE3_LIB_DIR"]?
14+
.trimmingCharacters(in: .whitespacesAndNewlines)
15+
let sqlite3LinkerSettings: [LinkerSetting] = if let sqlite3LibDir, !sqlite3LibDir.isEmpty {
16+
[.unsafeFlags(["-L\(sqlite3LibDir)"], .when(platforms: [.linux]))]
17+
} else {
18+
[]
19+
}
20+
1321
let package = Package(
1422
name: "CodexBar",
1523
defaultLocalization: "en",
@@ -53,7 +61,8 @@ let package = Package(
5361
],
5462
swiftSettings: [
5563
.enableUpcomingFeature("StrictConcurrency"),
56-
]),
64+
],
65+
linkerSettings: sqlite3LinkerSettings),
5766
.executableTarget(
5867
name: "CodexBarCLI",
5968
dependencies: [
@@ -63,7 +72,8 @@ let package = Package(
6372
path: "Sources/CodexBarCLI",
6473
swiftSettings: [
6574
.enableUpcomingFeature("StrictConcurrency"),
66-
]),
75+
],
76+
linkerSettings: sqlite3LinkerSettings),
6777
.testTarget(
6878
name: "CodexBarLinuxTests",
6979
dependencies: ["CodexBarCore", "CodexBarCLI"],

0 commit comments

Comments
 (0)