diff options
author | Stéphan Kochen <git@stephank.nl> | 2022-11-15 13:05:58 +0100 |
---|---|---|
committer | Stéphan Kochen <git@stephank.nl> | 2022-11-15 14:24:25 +0100 |
commit | 449e2f1b017b232118ceb85606fec294bae5b983 (patch) | |
tree | eb19dba7b773c7eca4eb308313818d240e684904 /pkgs/development/compilers/swift/swift-docc | |
parent | 0e08b082b894e987e89acb32b38f68f32f65c3d0 (diff) |
swift: track version in a central sources.nix
Diffstat (limited to 'pkgs/development/compilers/swift/swift-docc')
-rw-r--r-- | pkgs/development/compilers/swift/swift-docc/default.nix | 26 |
1 files changed, 7 insertions, 19 deletions
diff --git a/pkgs/development/compilers/swift/swift-docc/default.nix b/pkgs/development/compilers/swift/swift-docc/default.nix index c3bb8f7fb9d51..ebdaefdaf8635 100644 --- a/pkgs/development/compilers/swift/swift-docc/default.nix +++ b/pkgs/development/compilers/swift/swift-docc/default.nix @@ -1,7 +1,6 @@ { lib , stdenv , callPackage -, fetchFromGitHub , swift , swiftpm , Foundation @@ -10,28 +9,17 @@ , LocalAuthentication }: let - # Generated by swiftpm2nix. - generated = callPackage ./generated { }; + sources = callPackage ../sources.nix { }; + generated = callPackage ./generated { }; # Generated by swiftpm2nix. in -stdenv.mkDerivation rec { +stdenv.mkDerivation { pname = "swift-docc"; - # Releases are made as part of the Swift toolchain, so versions should match. - version = "5.7"; - src = fetchFromGitHub { - owner = "apple"; - repo = "swift-docc"; - rev = "swift-${version}-RELEASE"; - hash = "sha256-WlXJMAnrlVPCM+iCIhG0Gyho76BsC2yVBEpX3m/WiIQ="; - }; + inherit (sources) version; + src = sources.swift-docc; # TODO: We could build this from `apple/swift-docc-render` source, but that # repository is not tagged. - render-artifact = fetchFromGitHub { - owner = "apple"; - repo = "swift-docc-render-artifact"; - rev = "swift-${version}-RELEASE"; - hash = "sha256-ttdurN/K7OX+I4577jG3YGeRs+GLUTc7BiiEZGmFD+s="; - }; + renderArtifact = sources.swift-docc-render-artifact; nativeBuildInputs = [ swift swiftpm ]; buildInputs = [ Foundation XCTest ] @@ -47,7 +35,7 @@ stdenv.mkDerivation rec { binPath="$(swiftpmBinPath)" mkdir -p $out/bin $out/share/docc cp $binPath/docc $out/bin/ - ln -s ${render-artifact}/dist $out/share/docc/render + ln -s $renderArtifact/dist $out/share/docc/render ''; meta = { |