about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/readline
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/readline')
-rw-r--r--nixpkgs/pkgs/development/libraries/readline/6.3.nix68
-rw-r--r--nixpkgs/pkgs/development/libraries/readline/7.0.nix63
-rw-r--r--nixpkgs/pkgs/development/libraries/readline/8.2.nix96
-rw-r--r--nixpkgs/pkgs/development/libraries/readline/android.patch16
-rw-r--r--nixpkgs/pkgs/development/libraries/readline/link-against-ncurses.patch18
-rw-r--r--nixpkgs/pkgs/development/libraries/readline/no-arch_only-6.3.patch13
-rw-r--r--nixpkgs/pkgs/development/libraries/readline/no-arch_only-8.2.patch13
-rw-r--r--nixpkgs/pkgs/development/libraries/readline/readline-6.3-patches.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/readline/readline-7.0-patches.nix9
-rw-r--r--nixpkgs/pkgs/development/libraries/readline/readline-8.2-patches.nix14
l---------nixpkgs/pkgs/development/libraries/readline/update-patch-set.sh1
11 files changed, 323 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/readline/6.3.nix b/nixpkgs/pkgs/development/libraries/readline/6.3.nix
new file mode 100644
index 000000000000..aff16c3e4184
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/readline/6.3.nix
@@ -0,0 +1,68 @@
+{ fetchurl, lib, stdenv, ncurses }:
+
+stdenv.mkDerivation {
+  pname = "readline";
+  version = "6.3p08";
+
+  src = fetchurl {
+    url = "mirror://gnu/readline/readline-6.3.tar.gz";
+    sha256 = "0hzxr9jxqqx5sxsv9vmlxdnvlr9vi4ih1avjb869hbs6p5qn1fjn";
+  };
+
+  outputs = [ "out" "dev" "man" "doc" "info" ];
+
+  strictDeps = true;
+  propagatedBuildInputs = [ ncurses ];
+
+  patchFlags = [ "-p0" ];
+
+  configureFlags = lib.optional (stdenv.hostPlatform != stdenv.buildPlatform)
+    # This test requires running host code
+    "bash_cv_wcwidth_broken=no";
+
+  patches =
+    [ ./link-against-ncurses.patch
+      ./no-arch_only-6.3.patch
+    ] ++ lib.optional stdenv.hostPlatform.useAndroidPrebuilt ./android.patch
+    ++
+    (let
+       patch = nr: sha256:
+         fetchurl {
+           url = "mirror://gnu/readline/readline-6.3-patches/readline63-${nr}";
+           inherit sha256;
+         };
+     in
+       import ./readline-6.3-patches.nix patch);
+
+  env = lib.optionalAttrs stdenv.cc.isClang {
+    NIX_CFLAGS_COMPILE = "-Wno-error=implicit-function-declaration";
+  };
+
+  meta = with lib; {
+    description = "Library for interactive line editing";
+
+    longDescription = ''
+      The GNU Readline library provides a set of functions for use by
+      applications that allow users to edit command lines as they are
+      typed in.  Both Emacs and vi editing modes are available.  The
+      Readline library includes additional functions to maintain a
+      list of previously-entered command lines, to recall and perhaps
+      reedit those lines, and perform csh-like history expansion on
+      previous commands.
+
+      The history facilities are also placed into a separate library,
+      the History library, as part of the build process.  The History
+      library may be used without Readline in applications which
+      desire its capabilities.
+    '';
+
+    homepage = "https://savannah.gnu.org/projects/readline/";
+
+    license = licenses.gpl3Plus;
+
+    maintainers = [ ];
+
+    platforms = platforms.unix;
+    branch = "6.3";
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/readline/7.0.nix b/nixpkgs/pkgs/development/libraries/readline/7.0.nix
new file mode 100644
index 000000000000..3b643a9e15fe
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/readline/7.0.nix
@@ -0,0 +1,63 @@
+{ fetchurl, lib, stdenv, ncurses
+}:
+
+stdenv.mkDerivation rec {
+  pname = "readline";
+  version = "7.0p${toString (builtins.length upstreamPatches)}";
+
+  src = fetchurl {
+    url = "mirror://gnu/readline/readline-${meta.branch}.tar.gz";
+    sha256 = "0d13sg9ksf982rrrmv5mb6a2p4ys9rvg9r71d6il0vr8hmql63bm";
+  };
+
+  outputs = [ "out" "dev" "man" "doc" "info" ];
+
+  strictDeps = true;
+  propagatedBuildInputs = [ ncurses ];
+
+  patchFlags = [ "-p0" ];
+
+  upstreamPatches =
+    (let
+       patch = nr: sha256:
+         fetchurl {
+           url = "mirror://gnu/readline/readline-${meta.branch}-patches/readline70-${nr}";
+           inherit sha256;
+         };
+     in
+       import ./readline-7.0-patches.nix patch);
+
+  patches =
+    [ ./link-against-ncurses.patch
+      ./no-arch_only-6.3.patch
+    ]
+    ++ upstreamPatches;
+
+  meta = with lib; {
+    description = "Library for interactive line editing";
+
+    longDescription = ''
+      The GNU Readline library provides a set of functions for use by
+      applications that allow users to edit command lines as they are
+      typed in.  Both Emacs and vi editing modes are available.  The
+      Readline library includes additional functions to maintain a
+      list of previously-entered command lines, to recall and perhaps
+      reedit those lines, and perform csh-like history expansion on
+      previous commands.
+
+      The history facilities are also placed into a separate library,
+      the History library, as part of the build process.  The History
+      library may be used without Readline in applications which
+      desire its capabilities.
+    '';
+
+    homepage = "https://savannah.gnu.org/projects/readline/";
+
+    license = licenses.gpl3Plus;
+
+    maintainers = [ ];
+
+    platforms = platforms.unix;
+    branch = "7.0";
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/readline/8.2.nix b/nixpkgs/pkgs/development/libraries/readline/8.2.nix
new file mode 100644
index 000000000000..72e3370576e7
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/readline/8.2.nix
@@ -0,0 +1,96 @@
+{ lib, stdenv
+, fetchpatch, fetchurl
+, ncurses, termcap
+, curses-library ?
+    if stdenv.hostPlatform.isWindows
+    then termcap
+    else ncurses
+}:
+
+stdenv.mkDerivation rec {
+  pname = "readline";
+  version = "8.2p${toString (builtins.length upstreamPatches)}";
+
+  src = fetchurl {
+    url = "mirror://gnu/readline/readline-${meta.branch}.tar.gz";
+    sha256 = "sha256-P+txcfFqhO6CyhijbXub4QmlLAT0kqBTMx19EJUAfDU=";
+  };
+
+  outputs = [ "out" "dev" "man" "doc" "info" ];
+
+  strictDeps = true;
+  propagatedBuildInputs = [ curses-library ];
+
+  patchFlags = [ "-p0" ];
+
+  upstreamPatches =
+    (let
+       patch = nr: sha256:
+         fetchurl {
+           url = "mirror://gnu/readline/readline-${meta.branch}-patches/readline82-${nr}";
+           inherit sha256;
+         };
+     in
+       import ./readline-8.2-patches.nix patch);
+
+  patches = lib.optionals (curses-library.pname == "ncurses") [
+    ./link-against-ncurses.patch
+  ] ++ [
+    ./no-arch_only-8.2.patch
+  ]
+  ++ upstreamPatches
+  ++ lib.optionals stdenv.hostPlatform.isWindows [
+    (fetchpatch {
+      name = "0001-sigwinch.patch";
+      url = "https://github.com/msys2/MINGW-packages/raw/90e7536e3b9c3af55c336d929cfcc32468b2f135/mingw-w64-readline/0001-sigwinch.patch";
+      stripLen = 1;
+      hash = "sha256-sFK6EJrSNl0KLWqFv5zBXaQRuiQoYIZVoZfa8BZqfKA=";
+    })
+    (fetchpatch {
+      name = "0002-event-hook.patch";
+      url = "https://github.com/msys2/MINGW-packages/raw/3476319d2751a676b911f3de9e1ec675081c03b8/mingw-w64-readline/0002-event-hook.patch";
+      stripLen = 1;
+      hash = "sha256-F8ytYuIjBtH83ZCJdf622qjwSw+wZEVyu53E/mPsoAo=";
+    })
+    (fetchpatch {
+      name = "0003-fd_set.patch";
+      url = "https://github.com/msys2/MINGW-packages/raw/35830ab27e5ed35c2a8d486961ab607109f5af50/mingw-w64-readline/0003-fd_set.patch";
+      stripLen = 1;
+      hash = "sha256-UiaXZRPjKecpSaflBMCphI2kqOlcz1JkymlCrtpMng4=";
+    })
+    (fetchpatch {
+      name = "0004-locale.patch";
+      url = "https://github.com/msys2/MINGW-packages/raw/f768c4b74708bb397a77e3374cc1e9e6ef647f20/mingw-w64-readline/0004-locale.patch";
+      stripLen = 1;
+      hash = "sha256-dk4343KP4EWXdRRCs8GRQlBgJFgu1rd79RfjwFD/nJc=";
+    })
+  ];
+
+  meta = with lib; {
+    description = "Library for interactive line editing";
+
+    longDescription = ''
+      The GNU Readline library provides a set of functions for use by
+      applications that allow users to edit command lines as they are
+      typed in.  Both Emacs and vi editing modes are available.  The
+      Readline library includes additional functions to maintain a
+      list of previously-entered command lines, to recall and perhaps
+      reedit those lines, and perform csh-like history expansion on
+      previous commands.
+
+      The history facilities are also placed into a separate library,
+      the History library, as part of the build process.  The History
+      library may be used without Readline in applications which
+      desire its capabilities.
+    '';
+
+    homepage = "https://savannah.gnu.org/projects/readline/";
+
+    license = licenses.gpl3Plus;
+
+    maintainers = with maintainers; [ dtzWill ];
+
+    platforms = platforms.unix ++ platforms.windows;
+    branch = "8.2";
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/readline/android.patch b/nixpkgs/pkgs/development/libraries/readline/android.patch
new file mode 100644
index 000000000000..7e81774be369
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/readline/android.patch
@@ -0,0 +1,16 @@
+diff --git histlib.h histlib.h
+index c938a10..925ab72 100644
+--- histlib.h
++++ histlib.h
+@@ -51,9 +51,9 @@
+ #endif
+ 
+ #ifndef member
+-#  ifndef strchr
++#  if !defined (strchr) && !defined (__STDC__)
+ extern char *strchr ();
+-#  endif
++#  endif /* !strchr && !__STDC__ */
+ #define member(c, s) ((c) ? ((char *)strchr ((s), (c)) != (char *)NULL) : 0)
+ #endif
+ 
diff --git a/nixpkgs/pkgs/development/libraries/readline/link-against-ncurses.patch b/nixpkgs/pkgs/development/libraries/readline/link-against-ncurses.patch
new file mode 100644
index 000000000000..0fd0598f4650
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/readline/link-against-ncurses.patch
@@ -0,0 +1,18 @@
+This patch is to make sure that `libncurses' is among the `NEEDED'
+dependencies of `libreadline.so' and `libhistory.so'.
+
+Failing to do that, applications linking against Readline are
+forced to explicitly link against libncurses as well; in addition,
+this trick doesn't work when using GNU ld's `--as-needed'.
+
+--- shlib/Makefile.in	2009-01-06 18:03:22.000000000 +0100
++++ shlib/Makefile.in	2009-07-27 14:43:25.000000000 +0200
+@@ -84,7 +84,7 @@ SHOBJ_LDFLAGS = @SHOBJ_LDFLAGS@
+ SHOBJ_XLDFLAGS = @SHOBJ_XLDFLAGS@
+ SHOBJ_LIBS = @SHOBJ_LIBS@
+ 
+-SHLIB_XLDFLAGS = @LDFLAGS@ @SHLIB_XLDFLAGS@
++SHLIB_XLDFLAGS = @LDFLAGS@ @SHLIB_XLDFLAGS@ -lncurses
+ SHLIB_LIBS = @SHLIB_LIBS@
+ 
+ SHLIB_DOT = @SHLIB_DOT@
diff --git a/nixpkgs/pkgs/development/libraries/readline/no-arch_only-6.3.patch b/nixpkgs/pkgs/development/libraries/readline/no-arch_only-6.3.patch
new file mode 100644
index 000000000000..7c46dbad962a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/readline/no-arch_only-6.3.patch
@@ -0,0 +1,13 @@
+diff -ru -x '*~' readline-6.3-orig/support/shobj-conf readline-6.3/support/shobj-conf
+--- support/shobj-conf	2014-02-24 03:06:29.000000000 +0100
++++ support/shobj-conf	2014-07-22 11:18:52.000000000 +0200
+@@ -194,9 +194,6 @@
+ 	# Darwin 8 == Mac OS X 10.4; Mac OS X 10.N == Darwin N+4
+ 	*)
+ 		case "${host_os}" in
+-		darwin[89]*|darwin1[012]*)
+-			SHOBJ_ARCHFLAGS='-arch_only `/usr/bin/arch`'
+-			;;
+ 		 *) 	# Mac OS X 10.9 (Mavericks) and later
+ 			SHOBJ_ARCHFLAGS=
+ 			# for 32 and 64bit universal library
diff --git a/nixpkgs/pkgs/development/libraries/readline/no-arch_only-8.2.patch b/nixpkgs/pkgs/development/libraries/readline/no-arch_only-8.2.patch
new file mode 100644
index 000000000000..06f01ec0891f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/readline/no-arch_only-8.2.patch
@@ -0,0 +1,13 @@
+diff -ru -x '*~' readline-6.3-orig/support/shobj-conf readline-6.3/support/shobj-conf
+--- support/shobj-conf	2014-02-24 03:06:29.000000000 +0100
++++ support/shobj-conf	2014-07-22 11:18:52.000000000 +0200
+@@ -159,9 +159,6 @@
+ 	# Darwin 8 == Mac OS X 10.4; Mac OS X 10.N == Darwin N+4
+ 	*)
+ 		case "${host_os}" in
+-		darwin[89]*|darwin1[012]*)
+-			SHOBJ_ARCHFLAGS=
+-			;;
+ 		 *) 	# Mac OS X 10.9 (Mavericks) and later
+ 			SHOBJ_ARCHFLAGS=
+ 			# for 32 and 64bit universal library
diff --git a/nixpkgs/pkgs/development/libraries/readline/readline-6.3-patches.nix b/nixpkgs/pkgs/development/libraries/readline/readline-6.3-patches.nix
new file mode 100644
index 000000000000..d0aaaf38f706
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/readline/readline-6.3-patches.nix
@@ -0,0 +1,12 @@
+# Automatically generated by `update-patch-set.sh'; do not edit.
+
+patch: [
+(patch "001" "0vqlj22mkbn3x42qx2iqir7capx462dhagbzdw6hwxgfxavbny8s")
+(patch "002" "19g0l6vlfcqzwfwjj1slkmxzndjp4543hwrf26g8z216lp3h9qrr")
+(patch "003" "0bx53k876w8vwf4h2s6brr1i46ym87gi71bh8zl89n0gn3cbshgc")
+(patch "004" "1k2m8dg1awmjhmivdbx1c25866gfbpg0fy4845n8cw15zc3bjis5")
+(patch "005" "0jr7c28bzn882as5i54l53bhi723s1nkvzmwlh3rj6ld4bwqhxw7")
+(patch "006" "0mp5zgx50792gigkmjap3d0zpdv5qanii8djab7j6z69qsrpl8sw")
+(patch "007" "1sjv9w0mglh395i6hlq3ck7wdxvi2wyddlyb2j0jwg7cmnibayad")
+(patch "008" "11rpqhsxd132gc8455v51ma3a5zshznb0mh2p0zc5skcab7r7h1v")
+]
diff --git a/nixpkgs/pkgs/development/libraries/readline/readline-7.0-patches.nix b/nixpkgs/pkgs/development/libraries/readline/readline-7.0-patches.nix
new file mode 100644
index 000000000000..c34ef2bf97bb
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/readline/readline-7.0-patches.nix
@@ -0,0 +1,9 @@
+# Automatically generated by `update-patch-set.sh'; do not edit.
+
+patch: [
+(patch "001" "0xm3sxvwmss7ddyfb11n6pgcqd1aglnpy15g143vzcf75snb7hcs")
+(patch "002" "0n1dxmqsbjgrfxb1hgk5c6lsraw4ncbnzxlsx7m35nym6lncjiw7")
+(patch "003" "1027kmymniizcy0zbdlrczxfx3clxcdln5yq05q9yzlc6y9slhwy")
+(patch "004" "0r3bbaf12iz8m02z6p3fzww2m365fhn71xmzab2p62gj54s6h9gr")
+(patch "005" "0lxpa4f72y2nsgj6fgrhjk2nmmxvccys6aciwfxwchb5f21rq5fa")
+]
diff --git a/nixpkgs/pkgs/development/libraries/readline/readline-8.2-patches.nix b/nixpkgs/pkgs/development/libraries/readline/readline-8.2-patches.nix
new file mode 100644
index 000000000000..77d5c495bac1
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/readline/readline-8.2-patches.nix
@@ -0,0 +1,14 @@
+# Automatically generated by `update-patch-set.sh'; do not edit.
+
+patch: [
+(patch "001" "1xxgfgr6hn3ads8m8xsrdi1kbx1f3s69k0danpd9x4haqhg7zydv")
+(patch "002" "0ly0siy6qy3l7hv12847adpfa34yq1w4qz9qkw6vrxv25j106rg0")
+(patch "003" "1c5cwvvkx9mfmpaapymq9cavmzh4fnagkjlchsqx4vml8sx8gx94")
+(patch "004" "1b15sndx9v5vj3x1f3h73099nlagknx4rbfpd5ldrbw2xgm2wmvr")
+(patch "005" "16ac25jz1a1mgkpfp1sydqf6qpsfh0s0dcmrnjpqbhg5va3s6av2")
+(patch "006" "18gmh6y3klh0vv28cyqz4is3rlb32pl7f1kf5r482kfjq3w5zd67")
+(patch "007" "1xmnpahs983n4w0gn3j0wr8nh1dpva33yj7fvfmhm46ph2wsa4ar")
+(patch "008" "0smjjzhwxi2ibpdisnk53lh1pzgka6rhlqyh3662xy69v34ysxx1")
+(patch "009" "05m1fwbs7mbs3pz3pg87gbbayandrrcgaqawzliqb6g1jbk8b61x")
+(patch "010" "0k3vyrjs2g6y2cfs03l2gp37fhxgqpiwvxb1c7z4q88cbb32x3km")
+]
diff --git a/nixpkgs/pkgs/development/libraries/readline/update-patch-set.sh b/nixpkgs/pkgs/development/libraries/readline/update-patch-set.sh
new file mode 120000
index 000000000000..d4f5cd2f3126
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/readline/update-patch-set.sh
@@ -0,0 +1 @@
+../../../shells/bash/update-patch-set.sh
\ No newline at end of file