Files
nixpkgs/pkgs/by-name/kc/kcl/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

79 lines
1.8 KiB
Nix

{
buildGoModule,
fetchFromGitHub,
installShellFiles,
kclvm_cli,
kclvm,
lib,
nix-update-script,
stdenv,
}:
buildGoModule rec {
pname = "kcl";
version = "0.11.3";
src = fetchFromGitHub {
owner = "kcl-lang";
repo = "cli";
rev = "v${version}";
hash = "sha256-LJ+Mclw/dMyOeUHg6TAckSbvDGFYCf6mMGzDmiIQVZc=";
};
vendorHash = "sha256-jNQ0g7BGXUoYKV5RkU/f9GrSC3ygeZv83SekAmyKLxc=";
subPackages = [ "cmd/kcl" ];
ldflags = [
"-w -s"
"-X=kcl-lang.io/cli/pkg/version.version=v${version}"
];
nativeBuildInputs = [
installShellFiles
];
buildInputs = [
kclvm
kclvm_cli
];
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
export HOME=$(mktemp -d)
for shell in bash fish zsh; do
installShellCompletion --cmd kcl \
--$shell <($out/bin/kcl completion $shell)
done
'';
doInstallCheck = true;
installCheckPhase = ''
runHook preInstallCheck
set -o pipefail
$out/bin/kcl --version | grep $version
$out/bin/kcl <(echo 'hello = "KCL"') | grep "hello: KCL"
runHook postInstallCheck
'';
# By default, libs and bins are stripped. KCL will crash on darwin if they are.
dontStrip = stdenv.hostPlatform.isDarwin;
doCheck = true;
updateScript = nix-update-script { };
meta = {
description = "Command line interface for KCL programming language";
changelog = "https://github.com/kcl-lang/cli/releases/tag/v${version}";
homepage = "https://github.com/kcl-lang/cli";
license = lib.licenses.asl20;
platforms = lib.platforms.linux ++ lib.platforms.darwin;
maintainers = with lib.maintainers; [
peefy
selfuryon
];
mainProgram = "kcl";
broken = stdenv.buildPlatform != stdenv.hostPlatform;
};
}