mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-18 11:40:45 +00:00
kcl: 0.8.9 -> 0.9.3
Also adds support to macos aarch64 platform
This commit is contained in:
parent
7201d9ce9e
commit
cab3d18c17
|
@ -1,44 +1,59 @@
|
|||
{ lib
|
||||
, stdenv
|
||||
, buildGoModule
|
||||
, fetchFromGitHub
|
||||
, kclvm_cli
|
||||
, kclvm
|
||||
, makeWrapper
|
||||
, installShellFiles
|
||||
, darwin
|
||||
,
|
||||
}:
|
||||
buildGoModule rec {
|
||||
pname = "kcl";
|
||||
version = "0.8.9";
|
||||
version = "0.9.3";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "kcl-lang";
|
||||
repo = "cli";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-slU3n7YCV5VfvXArzlcITb9epdu/gyXlAWq9KLjGdJA=";
|
||||
hash = "sha256-QUVTRlzG8hT+iQx5dSycbRDAyeknjwGOWynCRw3oxlo=";
|
||||
};
|
||||
|
||||
vendorHash = "sha256-Xv8Tfq9Kb1xGFCWZQwBFDX9xZW9j99td/DUb7jBtkpE=";
|
||||
vendorHash = "sha256-AP1MOlnoTnD7luNR+1QtAdMiJL8tEEwJocT+9wBRgAo=";
|
||||
|
||||
# By default, libs and bins are stripped. KCL will crash on darwin if they are.
|
||||
dontStrip = stdenv.isDarwin;
|
||||
|
||||
ldflags = [
|
||||
"-w -s"
|
||||
"-X=kcl-lang.io/cli/pkg/version.version=v${version}"
|
||||
];
|
||||
|
||||
nativeBuildInputs = [ makeWrapper installShellFiles ];
|
||||
buildInputs = [ kclvm kclvm_cli ];
|
||||
nativeBuildInputs = [ makeWrapper installShellFiles ] ++ (
|
||||
lib.optionals stdenv.isDarwin [ darwin.cctools ]
|
||||
);
|
||||
|
||||
buildInputs = [ kclvm kclvm_cli ] ++ (
|
||||
lib.optional stdenv.isDarwin [
|
||||
darwin.apple_sdk.frameworks.Security
|
||||
darwin.apple_sdk.frameworks.CoreServices
|
||||
darwin.apple_sdk.frameworks.SystemConfiguration
|
||||
]
|
||||
);
|
||||
|
||||
subPackages = [ "cmd/kcl" ];
|
||||
|
||||
# env vars https://github.com/kcl-lang/kcl-go/blob/main/pkg/env/env.go#L29
|
||||
postFixup = ''
|
||||
wrapProgram $out/bin/kcl \
|
||||
--set PATH ${lib.makeBinPath [kclvm_cli]} \
|
||||
--set KCL_LIB_HOME ${lib.makeLibraryPath [kclvm]} \
|
||||
--set KCL_GO_DISABLE_INSTALL_ARTIFACT false \
|
||||
--prefix PATH : "${lib.makeBinPath [kclvm kclvm_cli]}" \
|
||||
--prefix KCL_LIB_HOME : "${lib.makeLibraryPath [kclvm]}" \
|
||||
--prefix KCL_GO_DISABLE_INSTALL_ARTIFACT : false
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
export HOME=$(mktemp -d)
|
||||
installShellCompletion --cmd kcl \
|
||||
--bash <($out/bin/kcl completion bash) \
|
||||
--fish <($out/bin/kcl completion fish) \
|
||||
|
@ -49,7 +64,7 @@ buildGoModule rec {
|
|||
description = "A command line interface for KCL programming language";
|
||||
homepage = "https://github.com/kcl-lang/cli";
|
||||
license = licenses.asl20;
|
||||
platforms = platforms.linux;
|
||||
platforms = platforms.linux ++ platforms.darwin;
|
||||
maintainers = with maintainers; [ selfuryon peefy ];
|
||||
mainProgram = "kcl";
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue