code2prompt: init at 1.1.0

Apples fix
This commit is contained in:
heisfer 2024-06-08 13:19:30 +03:00 committed by Weijia Wang
parent 3b66427aef
commit 85c2e0daf5
2 changed files with 1746 additions and 0 deletions

1699
pkgs/by-name/co/code2prompt/Cargo.lock generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,47 @@
{
lib,
fetchFromGitHub,
rustPlatform,
pkg-config,
openssl,
stdenv,
darwin,
}:
rustPlatform.buildRustPackage rec {
pname = "code2prompt";
version = "1.1.0";
src = fetchFromGitHub {
owner = "mufeedvh";
repo = "code2prompt";
rev = "v${version}";
hash = "sha256-KZqh0Vq4Mn56PhUO1JUzVpNBAGOZqUAsj31Cj5K+Lyk=";
};
cargoLock = {
lockFile = ./Cargo.lock;
};
postPatch = ''
# src is missing Cargo.lock
ln -s ${./Cargo.lock} Cargo.lock
'';
nativeBuildInputs = [ pkg-config ];
buildInputs =
[ openssl ]
++ lib.optionals stdenv.isDarwin [
darwin.apple_sdk.frameworks.Security
darwin.apple_sdk.frameworks.AppKit
];
meta = {
description = "A CLI tool that converts your codebase into a single LLM prompt with a source tree, prompt templating, and token counting";
homepage = "https://github.com/mufeedvh/code2prompt";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ heisfer ];
mainProgram = "code2prompt";
};
}