2022-05-18 14:49:53 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, autoreconfHook, byacc
|
2022-09-22 12:36:57 +00:00
|
|
|
, ncurses, readline, pkgsStatic
|
2022-05-18 14:49:53 +00:00
|
|
|
, historySupport ? false, readlineSupport ? true }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "rc";
|
2022-05-18 14:49:53 +00:00
|
|
|
version = "unstable-2021-08-03";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "rakitzis";
|
|
|
|
repo = "rc";
|
|
|
|
rev = "8ca9ab1305c3e30cd064290081d6e5a1fa841d26";
|
|
|
|
sha256 = "0744ars6y9zzsjr9xazms91qy6bi7msg2gg87526waziahfh4s4z";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
strictDeps = true;
|
|
|
|
nativeBuildInputs = [ autoreconfHook byacc ];
|
|
|
|
|
|
|
|
# acinclude.m4 wants headers for tgetent().
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [ ncurses ]
|
2022-05-18 14:49:53 +00:00
|
|
|
++ lib.optionals readlineSupport [ readline ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-09-22 12:36:57 +00:00
|
|
|
CPPFLAGS = ["-DSIGCLD=SIGCHLD"];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
configureFlags = [
|
|
|
|
"--enable-def-interp=${stdenv.shell}" #183
|
2021-01-15 22:18:51 +00:00
|
|
|
] ++ lib.optionals historySupport [ "--with-history" ]
|
2022-05-18 14:49:53 +00:00
|
|
|
++ lib.optionals readlineSupport [ "--with-edit=readline" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
#reproducible-build
|
|
|
|
postPatch = ''
|
2020-04-24 23:36:52 +00:00
|
|
|
substituteInPlace configure.ac \
|
2022-05-18 14:49:53 +00:00
|
|
|
--replace "$(git describe || echo '(git description unavailable)')" "${builtins.substring 0 7 src.rev}"
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2022-09-22 12:36:57 +00:00
|
|
|
passthru = {
|
|
|
|
shellPath = "/bin/rc";
|
|
|
|
tests.static = pkgsStatic.rc;
|
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "The Plan 9 shell";
|
2022-05-18 14:49:53 +00:00
|
|
|
longDescription = "Byron Rakitzis' UNIX reimplementation of Tom Duff's Plan 9 shell";
|
|
|
|
homepage = "https://web.archive.org/web/20180820053030/tobold.org/article/rc";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = with licenses; zlib;
|
|
|
|
maintainers = with maintainers; [ ramkromberg ];
|
2022-05-18 14:49:53 +00:00
|
|
|
mainProgram = "rc";
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = with platforms; all;
|
|
|
|
};
|
|
|
|
}
|