cgtcalc: init at 0-unstable-2025-10-11

Using upstream 1cf63741ddc0a5070680cb1339ad0abff0b7d69b, which is the
last to build with swift <6.

Not to be confused with cgt-calc, written in python.
This commit is contained in:
Daniel Woffinden
2026-02-20 20:53:19 +00:00
parent 31633b8253
commit 2576304f74
3 changed files with 90 additions and 0 deletions
@@ -0,0 +1,7 @@
# This file was generated by swiftpm2nix.
{
workspaceStateFile = ./workspace-state.json;
hashes = {
"swift-argument-parser" = "sha256-lWQ9mzfRxHcy00Cqyrsm9rOlQzkpU1lNBmiK7MMp6dU=";
};
}
@@ -0,0 +1,25 @@
{
"object": {
"artifacts": [],
"dependencies": [
{
"basedOn": null,
"packageRef": {
"identity": "swift-argument-parser",
"kind": "remoteSourceControl",
"location": "https://github.com/apple/swift-argument-parser",
"name": "swift-argument-parser"
},
"state": {
"checkoutState": {
"revision": "f3c9084a71ef4376f2fabbdf1d3d90a49f1fabdb",
"version": "1.1.2"
},
"name": "sourceControlCheckout"
},
"subpath": "swift-argument-parser"
}
]
},
"version": 6
}
+58
View File
@@ -0,0 +1,58 @@
{
fetchFromGitHub,
lib,
nix-update-script,
stdenv,
swift,
swiftPackages,
swiftpm,
swiftpm2nix,
}:
let
generated = swiftpm2nix.helpers ./generated;
in
stdenv.mkDerivation (finalAttrs: {
pname = "cgtcalc";
version = "0-unstable-2025-10-11";
src = fetchFromGitHub {
owner = "mattjgalloway";
repo = "cgtcalc";
# Repo has no tags or releases.
# This is the last commit before requiring Swift 6
rev = "1cf63741ddc0a5070680cb1339ad0abff0b7d69b";
hash = "sha256-+qgvl5y9ipVQIZlLZbkzkqb9bO7X9VGDvVsloOLZU/k=";
};
nativeBuildInputs = [
swift
swiftpm
];
configurePhase = generated.configure;
installPhase = ''
runHook preInstall
mkdir -p $out/bin
cp $(swiftpmBinPath)/cgtcalc $out/bin/
runHook postInstall
'';
buildInputs = [
swiftPackages.XCTest
];
# libIndexStore.so: cannot open shared object file: No such file or directory
# https://github.com/NixOS/nixpkgs/issues/379859
doCheck = false;
passthru.updateScript = nix-update-script { };
meta = {
description = "UK capital gains tax calculator written in Swift";
homepage = "https://github.com/mattjgalloway/cgtcalc";
license = lib.licenses.mit;
maintainers = [ lib.maintainers.dwoffinden ];
mainProgram = "cgtcalc";
platforms = lib.platforms.all;
};
})