swiftPackages.{sourcekit-lsp,swift-format}: link libdispatch.so

In my experience this solution seems to be necessary on almost all if
not all Swift packages on Linux
This commit is contained in:
Sam
2025-09-18 11:40:55 -07:00
parent d8754b1b0a
commit 19d240b619
2 changed files with 10 additions and 0 deletions

View File

@@ -7,6 +7,7 @@
swift,
swiftpm,
swiftpm2nix,
Dispatch,
Foundation,
XCTest,
sqlite,
@@ -40,6 +41,10 @@ stdenv.mkDerivation {
ncursesInput
];
env.LD_LIBRARY_PATH = lib.optionalString stdenv.hostPlatform.isLinux (
lib.makeLibraryPath [ Dispatch ]
);
configurePhase = generated.configure + ''
swiftpmMakeMutable indexstore-db
patch -p1 -d .build/checkouts/indexstore-db -i ${./patches/indexstore-db-macos-target.patch}

View File

@@ -6,6 +6,7 @@
swift,
swiftpm,
swiftpm2nix,
Dispatch,
Foundation,
}:
let
@@ -24,6 +25,10 @@ stdenv.mkDerivation {
];
buildInputs = [ Foundation ];
env.LD_LIBRARY_PATH = lib.optionalString stdenv.hostPlatform.isLinux (
lib.makeLibraryPath [ Dispatch ]
);
configurePhase = generated.configure;
# We only install the swift-format binary, so don't need the other products.