2022-11-08 11:19:05 +00:00
|
|
|
{ lib
|
|
|
|
, stdenvNoCC
|
|
|
|
, fetchFromGitHub
|
2023-11-01 14:18:15 +00:00
|
|
|
, gitUpdater
|
2022-11-08 11:19:05 +00:00
|
|
|
, makeWrapper
|
2023-07-02 14:20:18 +00:00
|
|
|
, babashka-unwrapped
|
2022-11-08 11:19:05 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenvNoCC.mkDerivation rec {
|
|
|
|
pname = "bbin";
|
2023-11-01 13:44:37 +00:00
|
|
|
version = "0.2.1";
|
2022-11-08 11:19:05 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "babashka";
|
|
|
|
repo = "bbin";
|
|
|
|
rev = "v${version}";
|
2023-11-01 13:44:37 +00:00
|
|
|
sha256 = "sha256-mF8+Fm1vwLUw5l2PqV+vFFlr6y2JpKBwc+J3PdKQ6Fo=";
|
2022-11-08 11:19:05 +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-02 14:20:18 +00:00
|
|
|
--prefix PATH : "${lib.makeBinPath [ babashka-unwrapped babashka-unwrapped.graalvmDrv ]}"
|
2022-11-08 11:19:05 +00:00
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
2023-11-01 14:18:15 +00:00
|
|
|
passthru = {
|
|
|
|
updateScript = gitUpdater { rev-prefix = "v"; };
|
|
|
|
};
|
|
|
|
|
2022-11-08 11:19:05 +00:00
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/babashka/bbin";
|
|
|
|
description = "Install any Babashka script or project with one command";
|
|
|
|
license = licenses.mit;
|
2023-07-02 14:20:18 +00:00
|
|
|
inherit (babashka-unwrapped.meta) platforms;
|
2022-11-08 11:19:05 +00:00
|
|
|
maintainers = with maintainers; [ sohalt ];
|
|
|
|
};
|
|
|
|
}
|