2024-06-30 08:12:46 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenvNoCC,
|
|
|
|
fetchzip,
|
|
|
|
runtimeShell,
|
|
|
|
bashInteractive,
|
|
|
|
glibcLocales,
|
2024-05-02 00:46:19 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenvNoCC.mkDerivation rec {
|
|
|
|
pname = "blesh";
|
|
|
|
version = "0.4.0-devel3";
|
|
|
|
|
|
|
|
src = fetchzip {
|
|
|
|
url = "https://github.com/akinomyoga/ble.sh/releases/download/v${version}/ble-${version}.tar.xz";
|
|
|
|
sha256 = "sha256-kGLp8RaInYSrJEi3h5kWEOMAbZV/gEPFUjOLgBuMhCI=";
|
|
|
|
};
|
|
|
|
|
|
|
|
dontBuild = true;
|
|
|
|
|
|
|
|
doCheck = true;
|
2024-06-30 08:12:46 +00:00
|
|
|
nativeCheckInputs = [
|
|
|
|
bashInteractive
|
|
|
|
glibcLocales
|
|
|
|
];
|
2024-05-02 00:46:19 +00:00
|
|
|
preCheck = "export LC_ALL=en_US.UTF-8";
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
mkdir -p "$out/share/blesh/lib"
|
|
|
|
|
|
|
|
cat <<EOF >"$out/share/blesh/lib/_package.sh"
|
|
|
|
_ble_base_package_type=nix
|
|
|
|
|
|
|
|
function ble/base/package:nix/update {
|
|
|
|
echo "Ble.sh is installed by Nix. You can update it there." >&2
|
|
|
|
return 1
|
|
|
|
}
|
|
|
|
EOF
|
|
|
|
|
|
|
|
cp -rv $src/* $out/share/blesh
|
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
mkdir -p "$out/bin"
|
|
|
|
cat <<EOF >"$out/bin/blesh-share"
|
|
|
|
#!${runtimeShell}
|
|
|
|
# Run this script to find the ble.sh shared folder
|
|
|
|
# where all the shell scripts are living.
|
|
|
|
echo "$out/share/blesh"
|
|
|
|
EOF
|
|
|
|
chmod +x "$out/bin/blesh-share"
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/akinomyoga/ble.sh";
|
|
|
|
description = "Bash Line Editor -- a full-featured line editor written in pure Bash";
|
|
|
|
mainProgram = "blesh-share";
|
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = with maintainers; [ aiotter ];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|