2022-12-17 10:02:37 +00:00
|
|
|
{ lib
|
|
|
|
, stdenvNoCC
|
|
|
|
, fetchFromGitHub
|
2023-11-16 04:20:00 +00:00
|
|
|
, gitUpdater
|
2022-12-17 10:02:37 +00:00
|
|
|
, makeWrapper
|
2023-07-15 17:15:38 +00:00
|
|
|
, babashka-unwrapped
|
2022-12-17 10:02:37 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenvNoCC.mkDerivation rec {
|
|
|
|
pname = "bbin";
|
2024-05-15 15:35:15 +00:00
|
|
|
version = "0.2.3";
|
2022-12-17 10:02:37 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "babashka";
|
|
|
|
repo = "bbin";
|
|
|
|
rev = "v${version}";
|
2024-05-15 15:35:15 +00:00
|
|
|
sha256 = "sha256-tWk5HzDKff+wwqRjLYbjfio3aQC6Xz5vsMf/NLm+Scc=";
|
2022-12-17 10:02:37 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
|
|
|
|
dontConfigure = true;
|
|
|
|
dontBuild = true;
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
install -D bbin $out/bin/bbin
|
|
|
|
mkdir -p $out/share
|
|
|
|
cp -r docs $out/share/docs
|
|
|
|
wrapProgram $out/bin/bbin \
|
2023-07-15 17:15:38 +00:00
|
|
|
--prefix PATH : "${lib.makeBinPath [ babashka-unwrapped babashka-unwrapped.graalvmDrv ]}"
|
2022-12-17 10:02:37 +00:00
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
passthru = {
|
|
|
|
updateScript = gitUpdater { rev-prefix = "v"; };
|
|
|
|
};
|
|
|
|
|
2022-12-17 10:02:37 +00:00
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/babashka/bbin";
|
|
|
|
description = "Install any Babashka script or project with one command";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "bbin";
|
2022-12-17 10:02:37 +00:00
|
|
|
license = licenses.mit;
|
2023-07-15 17:15:38 +00:00
|
|
|
inherit (babashka-unwrapped.meta) platforms;
|
2022-12-17 10:02:37 +00:00
|
|
|
maintainers = with maintainers; [ sohalt ];
|
|
|
|
};
|
|
|
|
}
|