2021-09-18 10:52:07 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2022-07-14 12:49:19 +00:00
|
|
|
, fetchFromGitHub
|
2021-09-18 10:52:07 +00:00
|
|
|
, meson
|
2022-07-14 12:49:19 +00:00
|
|
|
, ncurses
|
2021-09-18 10:52:07 +00:00
|
|
|
, ninja
|
|
|
|
, pkg-config
|
|
|
|
}:
|
|
|
|
|
2022-07-14 12:49:19 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2021-09-18 10:52:07 +00:00
|
|
|
pname = "loksh";
|
2022-07-14 12:49:19 +00:00
|
|
|
version = "7.1";
|
2021-09-18 10:52:07 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "dimkr";
|
2022-07-14 12:49:19 +00:00
|
|
|
repo = finalAttrs.pname;
|
|
|
|
rev = finalAttrs.version;
|
2021-09-18 10:52:07 +00:00
|
|
|
fetchSubmodules = true;
|
2022-07-14 12:49:19 +00:00
|
|
|
sha256 = "sha256-APjY7wQUfUTXe3TRKWkDmMZuax0MpuU/KmgZfogdAGU=";
|
2021-09-18 10:52:07 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
meson
|
|
|
|
ninja
|
|
|
|
pkg-config
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
ncurses
|
|
|
|
];
|
|
|
|
|
2022-07-14 12:49:19 +00:00
|
|
|
strictDeps = true;
|
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
postInstall = ''
|
|
|
|
mv $out/bin/ksh $out/bin/loksh
|
|
|
|
mv $out/share/man/man1/ksh.1 $out/share/man/man1/loksh.1
|
|
|
|
mv $out/share/man/man1/sh.1 $out/share/man/man1/loksh-sh.1
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/dimkr/loksh";
|
2022-07-14 12:49:19 +00:00
|
|
|
description = "Linux port of OpenBSD's ksh";
|
|
|
|
longDescription = ''
|
|
|
|
loksh is a Linux port of OpenBSD's ksh.
|
|
|
|
|
|
|
|
Unlike other ports of ksh, loksh targets only one platform, follows
|
|
|
|
upstream closely and keeps changes to a minimum. loksh does not add any
|
|
|
|
extra features; this reduces the risk of introducing security
|
|
|
|
vulnerabilities and makes loksh a good fit for resource-constrained
|
|
|
|
systems.
|
|
|
|
'';
|
2021-09-18 10:52:07 +00:00
|
|
|
license = licenses.publicDomain;
|
|
|
|
maintainers = with maintainers; [ cameronnemo ];
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
2022-07-14 12:49:19 +00:00
|
|
|
|
|
|
|
passthru = {
|
|
|
|
shellPath = "/bin/loksh";
|
|
|
|
};
|
|
|
|
})
|