rc: unstable-2021-08-03 -> unstable-2023-06-14

This commit is contained in:
Anderson Torres 2023-08-02 22:52:47 -03:00
parent 631b5b9cc6
commit 763ed867f1

View file

@ -1,36 +1,74 @@
{ lib, stdenv, fetchFromGitHub, autoreconfHook, byacc
, ncurses, readline, pkgsStatic
, historySupport ? false, readlineSupport ? true }:
{ lib
, stdenv
, fetchFromGitHub
, byacc
, ed
, ncurses
, readline
, installShellFiles
, pkgsStatic
, historySupport ? true
, readlineSupport ? true
}:
stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
pname = "rc";
version = "unstable-2021-08-03";
version = "unstable-2023-06-14";
src = fetchFromGitHub {
owner = "rakitzis";
repo = "rc";
rev = "8ca9ab1305c3e30cd064290081d6e5a1fa841d26";
sha256 = "0744ars6y9zzsjr9xazms91qy6bi7msg2gg87526waziahfh4s4z";
rev = "4aaba1a9cb9fdbb8660696a87850836ffdb09599";
hash = "sha256-Yql3mt7hTO2W7wTfPje+X2zBGTHiNXGGXYORJewJIM8=";
};
strictDeps = true;
nativeBuildInputs = [ autoreconfHook byacc ];
outputs = [ "out" "man" ];
# acinclude.m4 wants headers for tgetent().
buildInputs = [ ncurses ]
++ lib.optionals readlineSupport [ readline ];
CPPFLAGS = ["-DSIGCLD=SIGCHLD"];
configureFlags = [
"--enable-def-interp=${stdenv.shell}" #183
] ++ lib.optionals historySupport [ "--with-history" ]
++ lib.optionals readlineSupport [ "--with-edit=readline" ];
#reproducible-build
# TODO: think on a less ugly fixup
postPatch = ''
substituteInPlace configure.ac \
--replace "$(git describe || echo '(git description unavailable)')" "${builtins.substring 0 7 src.rev}"
ed -v -s Makefile << EOS
# - remove reference to now-inexistent git index file
/version.h:/ s| .git/index||
# - manually insert the git revision string
/v=/ c
${"\t"}v=${builtins.substring 0 7 finalAttrs.src.rev}
.
/\.git\/index:/ d
w
q
EOS
'';
nativeBuildInputs = [
byacc
ed
installShellFiles
];
buildInputs = [
ncurses
]
++ lib.optionals readlineSupport [
readline
];
strictDeps = true;
makeFlags = [
"CC=${stdenv.cc.targetPrefix}cc"
"PREFIX=${placeholder "out"}"
"MANPREFIX=${placeholder "man"}/share/man"
"CPPFLAGS=\"-DSIGCLD=SIGCHLD\""
];
buildFlags = [
"all"
] ++ lib.optionals historySupport [
"history"
];
postInstall = lib.optionalString historySupport ''
installManPage history.1
'';
passthru = {
@ -38,13 +76,12 @@ stdenv.mkDerivation rec {
tests.static = pkgsStatic.rc;
};
meta = with lib; {
meta = {
homepage = "https://github.com/rakitzis/rc";
description = "The Plan 9 shell";
longDescription = "Byron Rakitzis' UNIX reimplementation of Tom Duff's Plan 9 shell";
homepage = "https://web.archive.org/web/20180820053030/tobold.org/article/rc";
license = with licenses; zlib;
maintainers = with maintainers; [ ramkromberg ];
license = lib.licenses.zlib;
maintainers = with lib.maintainers; [ ramkromberg AndersonTorres ];
platforms = lib.platforms.unix;
mainProgram = "rc";
platforms = with platforms; all;
};
}
})