Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kcl: init at 0.8.5 #302285

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions pkgs/by-name/kc/kcl/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{ stdenv, fetchurl, lib }:

stdenv.mkDerivation rec {
pname = "kcl";
version = "0.8.4";

src = if stdenv.isDarwin && stdenv.isAarch64 then fetchurl {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When having this many sources, it might be advisable to create a sources.json and then read the URL endings and hashes from there. For reference, see e.g. the tabnine package.

url = "https://github.com/kcl-lang/cli/releases/download/v${version}/kcl-v${version}-darwin-arm64.tar.gz";
sha256 = "830c5cd7e0dd500c777a26d87924472589d389b8d61c936e6d67df85046fe2de";
} else if stdenv.isDarwin && stdenv.isx86_64 then fetchurl {
url = "https://github.com/kcl-lang/cli/releases/download/v${version}/kcl-v${version}-darwin-amd64.tar.gz";
sha256 = "4cca464d25df170f1679e1b5bd72cba886a9e5659f3af624953a132d11625378";
} else if stdenv.isLinux && stdenv.isAarch64 then fetchurl {
url = "https://github.com/kcl-lang/cli/releases/download/v${version}/kcl-v${version}-linux-arm64.tar.gz";
sha256 = "0f489d2a85c041a36c804cc1026bb5d705059067bdfc895bc288a2293cf87ca0";
} else if stdenv.isLinux && stdenv.isx86_64 then fetchurl {
url = "https://github.com/kcl-lang/cli/releases/download/v${version}/kcl-v${version}-linux-amd64.tar.gz";
sha256 = "9a86ef943ca7df1a21801fb91be8092d04835d1d555c146da89c1149d33a4c42";
} else throw "Unsupported platform";

unpackPhase = "tar -xzf $src";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
unpackPhase = "tar -xzf $src";

Unpacking TAR files should happen by default: https://nixos.org/manual/nixpkgs/stable/#tar-files


installPhase = ''
mkdir -p $out/bin
cp kcl $out/bin/
'';
Comment on lines +23 to +26
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
installPhase = ''
mkdir -p $out/bin
cp kcl $out/bin/
'';
installPhase = ''
runHook preInstall
mkdir -p $out/bin
cp kcl $out/bin/
runHook postInstall
'';


meta = with lib; {
description = "KCL Command Line Interface";
homepage = "https://github.com/kcl-lang/kcl";
license = licenses.asl20;
maintainers = with maintainers; [ kcl-lang ];
platforms = platforms.darwin ++ platforms.linux;
};
}