Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

blesh: init at 2022-07-24 #181963

Merged
merged 8 commits into from
Jul 25, 2022
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions pkgs/shells/bash/blesh/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{ lib
, stdenvNoCC
, fetchFromGitHub
, git
, bashInteractive
, glibcLocales
, runtimeShell
}:

stdenvNoCC.mkDerivation rec {
name = "ble.sh";
SuperSandro2000 marked this conversation as resolved.
Show resolved Hide resolved
version = "2022-07-24";
SuperSandro2000 marked this conversation as resolved.
Show resolved Hide resolved

src = fetchFromGitHub {
owner = "akinomyoga";
repo = "ble.sh";
rev = "0b95d5d900b79a63e7f0834da5aa7276b8332a44";
hash = "sha256-s/RQKcAFcCUB3Xd/4uOsIgigOE0lCCeVC9K3dfnP/EQ=";
fetchSubmodules = true;
leaveDotGit = true;
};

nativeBuildInputs = [ git ];

doCheck = true;
checkInputs = [ bashInteractive glibcLocales ];
preCheck = "export LC_ALL=en_US.UTF-8";

installFlags = [ "INSDIR=$(out)/share" ];

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
installFlags = [ "INSDIR=$(out)/share" ];
installFlags = [ "PREFIX=$(out)" ];

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/ble.sh"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

blesh-share should return the data directory name but not the script file. Also, the install target is strange. Currently, the related script files are somehow installed in $(out)/share, but they should be installed in $(out)/share/blesh.

Suggested change
echo "$out/share/ble.sh"
echo "$out/share/blesh"

EOF
chmod +x "$out/bin/blesh-share"

mkdir -p "$out/share/lib"
cat <<EOF >"$out/share/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." >/dev/stderr

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer to use &2 over /dev/stderr. /dev/stderr is not POSIX.

Suggested change
echo "Ble.sh is installed by Nix. You can update it there." >/dev/stderr
echo "Ble.sh is installed by Nix. You can update it there." >&2

return 1
}
EOF
'';

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;
};
}
2 changes: 2 additions & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12378,6 +12378,8 @@ with pkgs;

yarn-bash-completion = callPackage ../shells/bash/yarn-completion { };

blesh = callPackage ../shells/bash/blesh { };
aiotter marked this conversation as resolved.
Show resolved Hide resolved

undistract-me = callPackage ../shells/bash/undistract-me { };

dash = callPackage ../shells/dash { };
Expand Down