2021-05-20 23:08:51 +00:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub, readline }:
|
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "hilbish";
|
2021-06-28 23:13:55 +00:00
|
|
|
version = "0.5.1";
|
2021-05-20 23:08:51 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2021-06-28 23:13:55 +00:00
|
|
|
owner = "Rosettea";
|
2021-05-20 23:08:51 +00:00
|
|
|
repo = "Hilbish";
|
|
|
|
rev = "v${version}";
|
2021-10-08 15:17:17 +00:00
|
|
|
sha256 = "sha256-557Je9KeBpkZxVAxcjWAhybIJJYlzhtbnIyZh0rCRUc=";
|
|
|
|
fetchSubmodules = true;
|
2021-05-20 23:08:51 +00:00
|
|
|
};
|
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
vendorSha256 = "sha256-8l+Kb1ADMLwv0Hf/ikok8eUcEEST07rhk8BjHxJI0lc=";
|
2021-05-20 23:08:51 +00:00
|
|
|
|
|
|
|
buildInputs = [ readline ];
|
|
|
|
|
2021-10-08 15:17:17 +00:00
|
|
|
ldflags = [ "-s" "-w" ];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
# in master vars.go is called vars_linux.go
|
|
|
|
substituteInPlace vars.go \
|
|
|
|
--replace "/usr/share" "${placeholder "out"}/share/"
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
mkdir -p "$out/share/hilbish"
|
|
|
|
|
|
|
|
cp .hilbishrc.lua $out/share/hilbish/
|
|
|
|
cp -r libs -t $out/share/hilbish/
|
|
|
|
cp preload.lua $out/share/hilbish/
|
|
|
|
'';
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "An interactive Unix-like shell written in Go";
|
2021-06-28 23:13:55 +00:00
|
|
|
changelog = "https://github.com/Rosettea/Hilbish/releases/tag/v${version}";
|
|
|
|
homepage = "https://github.com/Rosettea/Hilbish";
|
2021-05-20 23:08:51 +00:00
|
|
|
maintainers = with maintainers; [ fortuneteller2k ];
|
|
|
|
license = licenses.mit;
|
|
|
|
platforms = platforms.linux; # only officially supported on Linux
|
|
|
|
};
|
|
|
|
}
|