diff --git a/pkgs/shells/rc-9front/default.nix b/pkgs/shells/rc-9front/default.nix new file mode 100644 index 000000000000..9779e08885b8 --- /dev/null +++ b/pkgs/shells/rc-9front/default.nix @@ -0,0 +1,45 @@ +{ +lib +, stdenv +, fetchgit +, byacc +, installShellFiles +}: + +stdenv.mkDerivation rec { + pname = "rc-9front"; + version = "unstable-2022-11-01"; + + src = fetchgit { + url = "git://shithub.us/cinap_lenrek/rc"; + rev = "69041639483e16392e3013491fcb382efd2b9374"; + hash = "sha256-xc+EfC4bc9ZA97jCQ6CGCzeLGf+Hx3/syl090/x4ew4="; + }; + + strictDeps = true; + nativeBuildInputs = [ byacc installShellFiles ]; + patches = [ ./path.patch ]; + + buildPhase = '' + make PREFIX=$out + ''; + + installPhase = '' + install -Dm755 -t $out/bin/ rc + installManPage rc.1 + mkdir -p $out/lib + install -m644 rcmain.unix $out/lib/rcmain + ''; + + passthru.shellPath = "/bin/rc"; + + meta = with lib; { + description = "The 9front shell"; + longDescription = "unix port of 9front rc"; + homepage = "http://shithub.us/cinap_lenrek/rc/HEAD/info.html"; + license = licenses.mit; + maintainers = with maintainers; [ moody ]; + mainProgram = "rc"; + platforms = platforms.all; + }; +} diff --git a/pkgs/shells/rc-9front/path.patch b/pkgs/shells/rc-9front/path.patch new file mode 100644 index 000000000000..7deef2cebfcd --- /dev/null +++ b/pkgs/shells/rc-9front/path.patch @@ -0,0 +1,13 @@ +diff --git a/rcmain.unix b/rcmain.unix +index 7ccbe1b..691f493 100644 +--- a/rcmain.unix ++++ b/rcmain.unix +@@ -13,7 +13,7 @@ if(~ $rcname ?.out) prompt=('broken! ' ' ') + if(flag p) path=/bin + if not { + finit +- if(~ $#path 0) path=(. /bin /usr/bin /usr/local/bin) ++ if(~ $#path 0) path=`:{/usr/bin/env echo -n $PATH} + } + fn sigexit + if(! ~ $#cflag 0){ diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 21b83d86d6d1..dd3f7b9dd4f6 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -12003,6 +12003,8 @@ with pkgs; rc = callPackage ../shells/rc { }; + rc-9front = callPackage ../shells/rc-9front { }; + rcon = callPackage ../tools/networking/rcon { }; rconc = callPackage ../tools/networking/rconc { };