swiftPackages_ng.swift-docc: init at 6.2.4

This commit is contained in:
Randy Eckenrode
2026-08-06 19:56:05 -04:00
parent 6c12143ea5
commit 4914173e34
2 changed files with 72 additions and 0 deletions

View File

@@ -0,0 +1,66 @@
{
lib,
fetchFromGitHub,
fetchSwiftPMDeps,
stdenv,
swift,
swift-docc-render,
swiftpm,
swift_release,
swift_sources,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "swift-docc";
version = swift_release;
src = fetchFromGitHub {
owner = "swiftlang";
repo = "swift-docc";
tag = "swift-${finalAttrs.version}-RELEASE";
inherit (swift_sources.swift-docc) hash;
};
postPatch =
# SignalTests.testTrappingSignal tries to access `/bin/bash`. Replace it with the shell in the stdenv.
''
substituteInPlace Tests/SwiftDocCUtilitiesTests/SignalTests.swift \
--replace-fail '/bin/bash' ${lib.escapeShellArg stdenv.shell}
'';
strictDeps = true;
swiftpmDeps = fetchSwiftPMDeps {
inherit (finalAttrs) pname version src;
inherit (swift_sources.swift-docc.swiftpmDeps) hash;
};
swiftpmFlags = [
# Otherwise fails to build with `error: module 'SwiftDocC' was not compiled for testing`.
"-Xswiftc"
"-enable-testing"
];
nativeBuildInputs = [
swift
swiftpm
];
doCheck = !stdenv.hostPlatform.isDarwin;
postInstall = ''
mkdir -p "$out/share/docc"
ln -s "${swift-docc-render}/dist" "$out/share/docc/render"
'';
__structuredAttrs = true;
meta = {
description = "Documentation compiler for Swift";
mainProgram = "docc";
homepage = "https://github.com/swiftlang/swift-docc";
platforms = lib.platforms.darwin ++ lib.platforms.linux;
license = lib.licenses.asl20;
teams = [ lib.teams.swift ];
};
})

View File

@@ -23,6 +23,12 @@
"swift-corelibs-xctest": {
"hash": "sha256-BbzY1kZUaHu7O29c8J7xDuelik6lhqmfSSskvvPZ7R4="
},
"swift-docc": {
"hash": "sha256-zu70RyYvnfhW3DdovSeLFXTNmdHrhdnSYCN8RisSkt8=",
"swiftpmDeps": {
"hash": "sha256-kJFuNw/pRn2A4UMvGcX3j04Faz44mriSz90u8hLdaZc="
}
},
"swift-docc-render": {
"hash": "sha256-uikFKvbjdU2BW3G0hCLah5Dt86DfAJ0etirX2nYVD+8=",
"npmDeps": {