about summary refs log tree commit diff
path: root/pkgs/shells
diff options
context:
space:
mode:
authorAnderson Torres <torres.anderson.85@protonmail.com>2023-08-19 21:46:10 -0300
committerAnderson Torres <torres.anderson.85@protonmail.com>2023-08-21 10:09:05 +0000
commitd939536baa6dc0b83d3d267e952a15b2dd65ff65 (patch)
treee3be4b4efd1d2bd2d065ec2966371bcbca3bcd11 /pkgs/shells
parent2552d297ccf112dba323c7c27e9d77924c3f858c (diff)
rc: enable lineEditingLibrary
Diffstat (limited to 'pkgs/shells')
-rw-r--r--pkgs/shells/rc/default.nix14
1 files changed, 11 insertions, 3 deletions
diff --git a/pkgs/shells/rc/default.nix b/pkgs/shells/rc/default.nix
index 422eb3d506ed9..1e1e968e73330 100644
--- a/pkgs/shells/rc/default.nix
+++ b/pkgs/shells/rc/default.nix
@@ -1,16 +1,23 @@
 { lib
 , stdenv
 , fetchFromGitHub
+, pkgsStatic
 , byacc
 , ed
 , ncurses
 , readline
 , installShellFiles
-, pkgsStatic
 , historySupport ? true
 , readlineSupport ? true
+, lineEditingLibrary ? if (stdenv.hostPlatform.isDarwin
+                           || stdenv.hostPlatform.isStatic)
+                       then "null"
+                       else "readline"
 }:
 
+assert lib.elem lineEditingLibrary [ "null" "edit" "editline" "readline" "vrl" ];
+assert !(lib.elem lineEditingLibrary [ "edit" "editline" "vrl" ]); # broken
+assert (lineEditingLibrary == "readline") -> readlineSupport;
 stdenv.mkDerivation (finalAttrs: {
   pname = "rc";
   version = "unstable-2023-06-14";
@@ -59,6 +66,7 @@ stdenv.mkDerivation (finalAttrs: {
     "PREFIX=${placeholder "out"}"
     "MANPREFIX=${placeholder "man"}/share/man"
     "CPPFLAGS=\"-DSIGCLD=SIGCHLD\""
+    "EDIT=${lineEditingLibrary}"
   ];
 
   buildFlags = [
@@ -79,9 +87,9 @@ stdenv.mkDerivation (finalAttrs: {
   meta = {
     homepage = "https://github.com/rakitzis/rc";
     description = "The Plan 9 shell";
-    license = lib.licenses.zlib;
+    license = [ lib.licenses.zlib ];
+    mainProgram = "rc";
     maintainers = with lib.maintainers; [ ramkromberg AndersonTorres ];
     platforms = lib.platforms.unix;
-    mainProgram = "rc";
   };
 })