mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-09-18 13:50:04 +00:00
swiftPackages_ng.swift-docc: init at 6.2.4
This commit is contained in:
@@ -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 ];
|
||||
};
|
||||
})
|
||||
@@ -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": {
|
||||
|
||||
Reference in New Issue
Block a user