From b6b80960e272e3e4b0be58715e4ead216e0b50e8 Mon Sep 17 00:00:00 2001
From: Thomas Gatzweiler <mail@thomasgatzweiler.com>
Date: Mon, 14 Aug 2017 17:19:30 +0200
Subject: [PATCH] Add recipe for readline

---
 recipes/readline/01-config-sub.patch | 21 +++++++++++++++
 recipes/readline/recipe.sh           | 39 ++++++++++++++++++++++++++++
 2 files changed, 60 insertions(+)
 create mode 100644 recipes/readline/01-config-sub.patch
 create mode 100644 recipes/readline/recipe.sh

diff --git a/recipes/readline/01-config-sub.patch b/recipes/readline/01-config-sub.patch
new file mode 100644
index 000000000..7b632e527
--- /dev/null
+++ b/recipes/readline/01-config-sub.patch
@@ -0,0 +1,21 @@
+diff -ru source/support/config.sub source-new/support/config.sub
+--- source/support/config.sub	2013-12-17 16:49:47.000000000 +0100
++++ source-new/support/config.sub	2017-08-14 09:09:20.158401733 +0200
+@@ -2,7 +2,7 @@
+ # Configuration validation subroutine script.
+ #   Copyright 1992-2013 Free Software Foundation, Inc.
+ 
+-timestamp='2013-10-01'
++timestamp='2017-08-14'
+ 
+ # This file is free software; you can redistribute it and/or modify it
+ # under the terms of the GNU General Public License as published by
+@@ -1351,7 +1351,7 @@
+ 	# The portable systems comes first.
+ 	# Each alternative MUST END IN A *, to match a version number.
+ 	# -sysv* is not here because it comes later, after sysvr4.
+-	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
++	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* | -redox* \
+ 	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
+ 	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
+ 	      | -sym* | -kopensolaris* | -plan9* \
diff --git a/recipes/readline/recipe.sh b/recipes/readline/recipe.sh
new file mode 100644
index 000000000..773901ceb
--- /dev/null
+++ b/recipes/readline/recipe.sh
@@ -0,0 +1,39 @@
+VERSION=7.0
+TAR=http://ftp.gnu.org/gnu/readline/readline-$VERSION.tar.gz
+BUILD_DEPENDS=(ncurses)
+
+function recipe_version {
+    echo "$VERSION"
+    skip=1
+}
+
+function recipe_update {
+    echo "skipping update"
+    skip=1
+}
+
+function recipe_build {
+    sysroot="${PWD}/../sysroot"
+    export LDFLAGS="-L$sysroot/lib"
+    export CFLAGS="-I$sysroot/include"
+    ./configure --disable-shared --host=${HOST} --prefix=""
+    make
+    skip=1
+}
+
+function recipe_test {
+    echo "skipping test"
+    skip=1
+}
+
+function recipe_clean {
+    make clean
+    skip=1
+}
+
+function recipe_stage {
+    dest="$(realpath $1)"
+    make DESTDIR="$dest" install
+    rm -rf "$1"/share/{doc,info,man}
+    skip=1
+}
-- 
GitLab