2022-08-12 12:06:08 +00:00
|
|
|
{ lib
|
|
|
|
, stdenvNoCC
|
2022-12-17 10:02:37 +00:00
|
|
|
, fetchzip
|
|
|
|
, runtimeShell
|
2022-08-12 12:06:08 +00:00
|
|
|
, bashInteractive
|
|
|
|
, glibcLocales
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenvNoCC.mkDerivation rec {
|
|
|
|
name = "blesh";
|
2022-12-17 10:02:37 +00:00
|
|
|
version = "unstable-2022-07-29";
|
|
|
|
|
|
|
|
src = fetchzip {
|
|
|
|
url = "https://github.com/akinomyoga/ble.sh/releases/download/nightly/ble-nightly-20220729+a22e145.tar.xz";
|
|
|
|
sha256 = "088jv02y40pjcfzgrbx8n6aksznfh6zl0j5siwfw3pmwn3i16njw";
|
2022-08-12 12:06:08 +00:00
|
|
|
};
|
|
|
|
|
2022-12-17 10:02:37 +00:00
|
|
|
dontBuild = true;
|
2022-08-12 12:06:08 +00:00
|
|
|
|
|
|
|
doCheck = true;
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [ bashInteractive glibcLocales ];
|
2022-08-12 12:06:08 +00:00
|
|
|
preCheck = "export LC_ALL=en_US.UTF-8";
|
|
|
|
|
2022-12-17 10:02:37 +00:00
|
|
|
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
|
|
|
|
'';
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
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.
|
2022-12-17 10:02:37 +00:00
|
|
|
echo "$out/share/blesh"
|
2022-08-12 12:06:08 +00:00
|
|
|
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";
|
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = with maintainers; [ aiotter ];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|