lol

swiftPackages.Dispatch: 5.5 -> 5.7

+91 -43
+4
pkgs/development/compilers/swift/default.nix
··· 57 57 swift = swift-unwrapped; 58 58 }; 59 59 60 + Dispatch = if stdenv.isDarwin 61 + then null # part of libsystem 62 + else callPackage ./libdispatch { }; 63 + 60 64 }; 61 65 62 66 in self
+46
pkgs/development/compilers/swift/libdispatch/default.nix
··· 1 + { lib 2 + , stdenv 3 + , fetchFromGitHub 4 + , cmake 5 + , ninja 6 + , useSwift ? true, swift 7 + }: 8 + 9 + stdenv.mkDerivation rec { 10 + pname = "swift-corelibs-libdispatch"; 11 + 12 + # Releases are made as part of the Swift toolchain, so versions should match. 13 + version = "5.7"; 14 + src = fetchFromGitHub { 15 + owner = "apple"; 16 + repo = "swift-corelibs-libdispatch"; 17 + rev = "swift-${version}-RELEASE"; 18 + hash = "sha256-1qbXiC1k9+T+L6liqXKg6EZXqem6KEEx8OctuL4Kb2o="; 19 + }; 20 + 21 + outputs = [ "out" "dev" "man" ]; 22 + 23 + nativeBuildInputs = [ cmake ] 24 + ++ lib.optionals useSwift [ ninja swift ]; 25 + 26 + patches = [ ./disable-swift-overlay.patch ]; 27 + 28 + cmakeFlags = lib.optional useSwift "-DENABLE_SWIFT=ON"; 29 + 30 + postInstall = '' 31 + # Provide a CMake module. This is primarily used to glue together parts of 32 + # the Swift toolchain. Modifying the CMake config to do this for us is 33 + # otherwise more trouble. 34 + mkdir -p $dev/lib/cmake/dispatch 35 + export dylibExt="${stdenv.hostPlatform.extensions.sharedLibrary}" 36 + substituteAll ${./glue.cmake} $dev/lib/cmake/dispatch/dispatchConfig.cmake 37 + ''; 38 + 39 + meta = { 40 + description = "Grand Central Dispatch"; 41 + homepage = "https://github.com/apple/swift-corelibs-libdispatch"; 42 + platforms = lib.platforms.linux; 43 + license = lib.licenses.asl20; 44 + maintainers = with lib.maintainers; [ cmm dtzWill trepetti dduan trundle stephank ]; 45 + }; 46 + }
+35
pkgs/development/compilers/swift/libdispatch/disable-swift-overlay.patch
··· 1 + Enabling Swift support is normally intended for building an overlay for a 2 + Swift SDK, which changes the installation layout. Prevent this. 3 + 4 + --- a/CMakeLists.txt 5 + +++ b/CMakeLists.txt 6 + @@ -287,7 +287,7 @@ configure_file("${PROJECT_SOURCE_DIR}/cmake/config.h.in" 7 + add_compile_definitions($<$<OR:$<COMPILE_LANGUAGE:C>,$<COMPILE_LANGUAGE:CXX>>:HAVE_CONFIG_H>) 8 + 9 + 10 + -if(ENABLE_SWIFT) 11 + +if(0) 12 + set(INSTALL_TARGET_DIR "${CMAKE_INSTALL_LIBDIR}/swift$<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:_static>/$<LOWER_CASE:${CMAKE_SYSTEM_NAME}>" CACHE PATH "Path where the libraries will be installed") 13 + set(INSTALL_DISPATCH_HEADERS_DIR "${CMAKE_INSTALL_LIBDIR}/swift$<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:_static>/dispatch" CACHE PATH "Path where the headers will be installed for libdispatch") 14 + set(INSTALL_BLOCK_HEADERS_DIR "${CMAKE_INSTALL_LIBDIR}/swift$<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:_static>/Block" CACHE PATH "Path where the headers will be installed for the blocks runtime") 15 + --- a/man/CMakeLists.txt 16 + +++ b/man/CMakeLists.txt 17 + @@ -1,6 +1,6 @@ 18 + 19 + # TODO(compnerd) add symlinks 20 + -if(NOT ENABLE_SWIFT) 21 + +if(1) 22 + install(FILES 23 + dispatch.3 24 + dispatch_after.3 25 + --- a/src/swift/CMakeLists.txt 26 + +++ b/src/swift/CMakeLists.txt 27 + @@ -47,7 +47,7 @@ get_swift_host_arch(swift_arch) 28 + install(FILES 29 + ${CMAKE_CURRENT_BINARY_DIR}/swift/Dispatch.swiftmodule 30 + ${CMAKE_CURRENT_BINARY_DIR}/swift/Dispatch.swiftdoc 31 + - DESTINATION ${INSTALL_TARGET_DIR}/${swift_arch}) 32 + + DESTINATION ${INSTALL_TARGET_DIR}/swift) 33 + set_property(GLOBAL APPEND PROPERTY DISPATCH_EXPORTS swiftDispatch) 34 + install(TARGETS swiftDispatch 35 + EXPORT dispatchExports
+5
pkgs/development/compilers/swift/libdispatch/glue.cmake
··· 1 + add_library(dispatch SHARED IMPORTED) 2 + set_property(TARGET dispatch PROPERTY IMPORTED_LOCATION "@out@/lib/libdispatch@dylibExt@") 3 + 4 + add_library(swiftDispatch SHARED IMPORTED) 5 + set_property(TARGET swiftDispatch PROPERTY IMPORTED_LOCATION "@out@/lib/libswiftDispatch@dylibExt@")
-42
pkgs/development/libraries/swift-corelibs-libdispatch/default.nix
··· 1 - { lib 2 - , clangStdenv 3 - , fetchFromGitHub 4 - , cmake 5 - , ninja 6 - , libbsd 7 - , libsystemtap 8 - }: 9 - 10 - let 11 - version = "5.5"; 12 - in clangStdenv.mkDerivation { 13 - pname = "swift-corelibs-libdispatch"; 14 - inherit version; 15 - 16 - outputs = [ "out" "dev" "man" ]; 17 - 18 - src = fetchFromGitHub { 19 - owner = "apple"; 20 - repo = "swift-corelibs-libdispatch"; 21 - rev = "swift-${version}-RELEASE"; 22 - sha256 = "sha256-MbLgmS6qRSRT+2dGqbYTNb5MTM4Wz/grDXFk1kup+jk="; 23 - }; 24 - 25 - nativeBuildInputs = [ 26 - cmake 27 - ninja 28 - ]; 29 - 30 - buildInputs = [ 31 - libbsd 32 - libsystemtap 33 - ]; 34 - 35 - meta = { 36 - description = "Grand Central Dispatch"; 37 - homepage = "https://github.com/apple/swift-corelibs-libdispatch"; 38 - platforms = lib.platforms.linux; 39 - license = lib.licenses.asl20; 40 - maintainers = [ lib.maintainers.cmm ]; 41 - }; 42 - }
+1 -1
pkgs/top-level/all-packages.nix
··· 37567 37567 37568 37568 mictray = callPackage ../tools/audio/mictray { }; 37569 37569 37570 - swift-corelibs-libdispatch = callPackage ../development/libraries/swift-corelibs-libdispatch { }; 37570 + swift-corelibs-libdispatch = swiftPackages.Dispatch; 37571 37571 37572 37572 swaysettings = callPackage ../applications/misc/swaysettings { }; 37573 37573