2022-07-25 20:36:50 +02:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
2022-11-15 13:05:58 +01:00
|
|
|
callPackage,
|
2022-07-25 20:36:50 +02:00
|
|
|
cmake,
|
|
|
|
ninja,
|
|
|
|
useSwift ? true,
|
|
|
|
swift,
|
|
|
|
}:
|
|
|
|
|
2022-11-21 19:18:10 +01:00
|
|
|
let
|
|
|
|
sources = callPackage ../sources.nix { };
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation {
|
2022-07-25 20:36:50 +02:00
|
|
|
pname = "swift-corelibs-libdispatch";
|
|
|
|
|
2022-11-15 13:05:58 +01:00
|
|
|
inherit (sources) version;
|
|
|
|
src = sources.swift-corelibs-libdispatch;
|
2022-07-25 20:36:50 +02:00
|
|
|
|
|
|
|
outputs = [
|
|
|
|
"out"
|
|
|
|
"dev"
|
|
|
|
"man"
|
|
|
|
];
|
2024-12-10 20:26:33 +01:00
|
|
|
|
2022-07-25 20:36:50 +02:00
|
|
|
nativeBuildInputs =
|
|
|
|
[ cmake ]
|
|
|
|
++ lib.optionals useSwift [
|
|
|
|
ninja
|
|
|
|
swift
|
|
|
|
];
|
|
|
|
|
|
|
|
patches = [ ./disable-swift-overlay.patch ];
|
|
|
|
|
|
|
|
cmakeFlags = lib.optional useSwift "-DENABLE_SWIFT=ON";
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
# Provide a CMake module. This is primarily used to glue together parts of
|
|
|
|
# the Swift toolchain. Modifying the CMake config to do this for us is
|
|
|
|
# otherwise more trouble.
|
|
|
|
mkdir -p $dev/lib/cmake/dispatch
|
|
|
|
export dylibExt="${stdenv.hostPlatform.extensions.sharedLibrary}"
|
|
|
|
substituteAll ${./glue.cmake} $dev/lib/cmake/dispatch/dispatchConfig.cmake
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Grand Central Dispatch";
|
|
|
|
homepage = "https://github.com/apple/swift-corelibs-libdispatch";
|
|
|
|
platforms = lib.platforms.linux;
|
|
|
|
license = lib.licenses.asl20;
|
2024-07-17 13:13:06 -03:00
|
|
|
maintainers = with lib.maintainers; [ cmm ];
|
|
|
|
teams = [ lib.teams.swift ];
|
2022-07-25 20:36:50 +02:00
|
|
|
};
|
|
|
|
}
|