After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.
Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.
A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.
This commit was automatically created and can be verified using
nix-build a08b3a4d19.tar.gz \
--argstr baseRev b32a0943687d2a5094a6d92f25a4b6e16a76b5b7
result/bin/apply-formatting $NIXPKGS_PATH
93 lines
3.7 KiB
Nix
93 lines
3.7 KiB
Nix
# SwiftPM dependencies are normally not installed using CMake, and only provide
|
|
# CMake modules to link them together in a build tree. We have separate
|
|
# derivations, so need a real install step. Here we provide our own minimal
|
|
# CMake modules to install along with the build products.
|
|
{
|
|
lib,
|
|
stdenv,
|
|
swift,
|
|
}:
|
|
let
|
|
|
|
inherit (stdenv.hostPlatform) extensions;
|
|
|
|
# This file exports shell snippets for use in postInstall.
|
|
mkInstallScript = module: template: ''
|
|
mkdir -p $out/lib/cmake/${module}
|
|
(
|
|
export staticLibExt="${extensions.staticLibrary}"
|
|
export sharedLibExt="${extensions.sharedLibrary}"
|
|
export swiftOs="${swift.swiftOs}"
|
|
substituteAll \
|
|
${builtins.toFile "${module}Config.cmake" template} \
|
|
$out/lib/cmake/${module}/${module}Config.cmake
|
|
)
|
|
'';
|
|
|
|
in
|
|
lib.mapAttrs mkInstallScript {
|
|
SwiftSystem = ''
|
|
add_library(SwiftSystem::SystemPackage STATIC IMPORTED)
|
|
set_property(TARGET SwiftSystem::SystemPackage PROPERTY IMPORTED_LOCATION "@out@/lib/swift_static/@swiftOs@/libSystemPackage@staticLibExt@")
|
|
'';
|
|
|
|
SwiftCollections = ''
|
|
add_library(SwiftCollections::Collections STATIC IMPORTED)
|
|
set_property(TARGET SwiftCollections::Collections PROPERTY IMPORTED_LOCATION "@out@/lib/swift_static/@swiftOs@/libCollections@staticLibExt@")
|
|
|
|
add_library(SwiftCollections::DequeModule STATIC IMPORTED)
|
|
set_property(TARGET SwiftCollections::DequeModule PROPERTY IMPORTED_LOCATION "@out@/lib/swift_static/@swiftOs@/libDequeModule@staticLibExt@")
|
|
|
|
add_library(SwiftCollections::OrderedCollections STATIC IMPORTED)
|
|
set_property(TARGET SwiftCollections::OrderedCollections PROPERTY IMPORTED_LOCATION "@out@/lib/swift_static/@swiftOs@/libOrderedCollections@staticLibExt@")
|
|
'';
|
|
|
|
TSC = ''
|
|
add_library(TSCLibc SHARED IMPORTED)
|
|
set_property(TARGET TSCLibc PROPERTY IMPORTED_LOCATION "@out@/lib/libTSCLibc@sharedLibExt@")
|
|
|
|
add_library(TSCBasic SHARED IMPORTED)
|
|
set_property(TARGET TSCBasic PROPERTY IMPORTED_LOCATION "@out@/lib/libTSCBasic@sharedLibExt@")
|
|
|
|
add_library(TSCUtility SHARED IMPORTED)
|
|
set_property(TARGET TSCUtility PROPERTY IMPORTED_LOCATION "@out@/lib/libTSCUtility@sharedLibExt@")
|
|
'';
|
|
|
|
ArgumentParser = ''
|
|
add_library(ArgumentParser SHARED IMPORTED)
|
|
set_property(TARGET ArgumentParser PROPERTY IMPORTED_LOCATION "@out@/lib/swift/@swiftOs@/libArgumentParser@sharedLibExt@")
|
|
|
|
add_library(ArgumentParserToolInfo SHARED IMPORTED)
|
|
set_property(TARGET ArgumentParserToolInfo PROPERTY IMPORTED_LOCATION "@out@/lib/swift/@swiftOs@/libArgumentParserToolInfo@sharedLibExt@")
|
|
'';
|
|
|
|
Yams = ''
|
|
add_library(Yams SHARED IMPORTED)
|
|
set_property(TARGET Yams PROPERTY IMPORTED_LOCATION "@out@/lib/swift/@swiftOs@/libYams@sharedLibExt@")
|
|
'';
|
|
|
|
LLBuild = ''
|
|
add_library(libllbuild SHARED IMPORTED)
|
|
set_property(TARGET libllbuild PROPERTY IMPORTED_LOCATION "@out@/lib/libllbuild@sharedLibExt@")
|
|
|
|
add_library(llbuildSwift SHARED IMPORTED)
|
|
set_property(TARGET llbuildSwift PROPERTY IMPORTED_LOCATION "@out@/lib/swift/pm/llbuild/libllbuildSwift@sharedLibExt@")
|
|
'';
|
|
|
|
SwiftDriver = ''
|
|
add_library(SwiftDriver SHARED IMPORTED)
|
|
set_property(TARGET SwiftDriver PROPERTY IMPORTED_LOCATION "@out@/lib/libSwiftDriver@sharedLibExt@")
|
|
|
|
add_library(SwiftDriverExecution SHARED IMPORTED)
|
|
set_property(TARGET SwiftDriverExecution PROPERTY IMPORTED_LOCATION "@out@/lib/libSwiftDriverExecution@sharedLibExt@")
|
|
|
|
add_library(SwiftOptions SHARED IMPORTED)
|
|
set_property(TARGET SwiftOptions PROPERTY IMPORTED_LOCATION "@out@/lib/libSwiftOptions@sharedLibExt@")
|
|
'';
|
|
|
|
SwiftCrypto = ''
|
|
add_library(Crypto SHARED IMPORTED)
|
|
set_property(TARGET Crypto PROPERTY IMPORTED_LOCATION "@out@/lib/swift/@swiftOs@/libCrypto@sharedLibExt@")
|
|
'';
|
|
}
|