From d8627201b1355047ae657f1b9d21b817c9935175 Mon Sep 17 00:00:00 2001
From: Andrew Esh <andrew.esh@qterics.com>
Date: Wed, 17 May 2017 13:44:05 -0500
Subject: [PATCH 09/25] _common_ Update soname format for Android

---
 recipes/libiconv.recipe                            |  9 +++--
 .../0001-Update-soname-handling-for-Android.patch  | 43 ++++++++++++++++++++++
 ...h => 0002-Use-correct-autotools-versions.patch} |  6 +--
 ...id.patch => 0003-Add-support-for-Android.patch} |  6 +--
 ...-fix-build-with-Android-s-Bionic-fox-x86.patch} |  6 +--
 ...ame-locale_charset-for-libiconv-not-libc.patch} |  6 +--
 6 files changed, 60 insertions(+), 16 deletions(-)
 create mode 100644 recipes/libiconv/0001-Update-soname-handling-for-Android.patch
 rename recipes/libiconv/{0001-Use-correct-autotools-versions.patch => 0002-Use-correct-autotools-versions.patch} (91%)
 rename recipes/libiconv/{0002-Add-support-for-Android.patch => 0003-Add-support-for-Android.patch} (92%)
 rename recipes/libiconv/{0003-stdint-fix-build-with-Android-s-Bionic-fox-x86.patch => 0004-stdint-fix-build-with-Android-s-Bionic-fox-x86.patch} (86%)
 rename recipes/libiconv/{0004-lib-Only-rename-locale_charset-for-libiconv-not-libc.patch => 0005-lib-Only-rename-locale_charset-for-libiconv-not-libc.patch} (84%)

diff --git a/recipes/libiconv.recipe b/recipes/libiconv.recipe
index 589e180..d070c48 100644
--- a/recipes/libiconv.recipe
+++ b/recipes/libiconv.recipe
@@ -8,10 +8,11 @@ class Recipe(recipe.Recipe):
     licenses = [License.LGPLv2Plus]
     stype = SourceType.TARBALL
     url = 'http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz'
-    patches = ['libiconv/0001-Use-correct-autotools-versions.patch',
-               'libiconv/0002-Add-support-for-Android.patch',
-               'libiconv/0003-stdint-fix-build-with-Android-s-Bionic-fox-x86.patch',
-               'libiconv/0004-lib-Only-rename-locale_charset-for-libiconv-not-libc.patch',]
+    patches = ['libiconv/0001-Update-soname-handling-for-Android.patch',
+               'libiconv/0002-Use-correct-autotools-versions.patch',
+               'libiconv/0003-Add-support-for-Android.patch',
+               'libiconv/0004-stdint-fix-build-with-Android-s-Bionic-fox-x86.patch',
+               'libiconv/0005-lib-Only-rename-locale_charset-for-libiconv-not-libc.patch',]
 
     configure_options = '--disable-nls --enable-static'
     platform_deps = {Platform.WINDOWS: ['gettext']}
diff --git a/recipes/libiconv/0001-Update-soname-handling-for-Android.patch b/recipes/libiconv/0001-Update-soname-handling-for-Android.patch
new file mode 100644
index 0000000..1f9cf28
--- /dev/null
+++ b/recipes/libiconv/0001-Update-soname-handling-for-Android.patch
@@ -0,0 +1,43 @@
+From cbf4536be1d1e406a71045e4c92492950175881f Mon Sep 17 00:00:00 2001
+From: Andrew Esh <andrew.esh@qterics.com>
+Date: Tue, 18 Oct 2016 16:02:45 -0500
+Subject: [PATCH 1/5] Update soname handling for Android
+
+---
+ configure | 20 ++++++++++++++++++++
+ 1 file changed, 20 insertions(+)
+
+diff --git a/configure b/configure
+index e511b04..043da88 100755
+--- a/configure
++++ b/configure
+@@ -12207,6 +12207,26 @@ linux*oldld* | linux*aout* | linux*coff*)
+   dynamic_linker=no
+   ;;
+ 
++linux*android*)
++  version_type=none # Android doesn't support versioned libraries.
++  need_lib_prefix=no
++  need_version=no
++  library_names_spec='$libname$release$shared_ext'
++  soname_spec='$libname$release$shared_ext'
++  finish_cmds=
++  shlibpath_var=LD_LIBRARY_PATH
++  shlibpath_overrides_runpath=yes
++
++  # This implies no fast_install, which is unacceptable.
++  # Some rework will be needed to allow for fast_install
++  # before this can be enabled.
++  hardcode_into_libs=yes
++
++  dynamic_linker='Android linker'
++  # Don't embed -rpath directories since the linker doesn't support them.
++  hardcode_libdir_flag_spec='-L$libdir'
++  ;;
++
+ # This must be Linux ELF.
+ linux* | k*bsd*-gnu | kopensolaris*-gnu)
+   version_type=linux
+-- 
+2.7.4
+
diff --git a/recipes/libiconv/0001-Use-correct-autotools-versions.patch b/recipes/libiconv/0002-Use-correct-autotools-versions.patch
similarity index 91%
rename from recipes/libiconv/0001-Use-correct-autotools-versions.patch
rename to recipes/libiconv/0002-Use-correct-autotools-versions.patch
index 751bc4b..69cf9b4 100644
--- a/recipes/libiconv/0001-Use-correct-autotools-versions.patch
+++ b/recipes/libiconv/0002-Use-correct-autotools-versions.patch
@@ -1,7 +1,7 @@
-From 14da1c1216fcbdecf4956d73e8be3278d0caaab4 Mon Sep 17 00:00:00 2001
+From 635e1941867c3a8c2cc33ed1c02442060b424b3e Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= <sebastian.droege@collabora.co.uk>
 Date: Tue, 21 Aug 2012 13:37:42 +0200
-Subject: [PATCH 1/3] Use correct autotools versions
+Subject: [PATCH 2/5] Use correct autotools versions
 
 ---
  Makefile.devel            | 8 ++++----
@@ -61,5 +61,5 @@ index 544059a..c8ac0a8 100644
  RM = rm -f
  
 -- 
-1.8.1.2
+2.7.4
 
diff --git a/recipes/libiconv/0002-Add-support-for-Android.patch b/recipes/libiconv/0003-Add-support-for-Android.patch
similarity index 92%
rename from recipes/libiconv/0002-Add-support-for-Android.patch
rename to recipes/libiconv/0003-Add-support-for-Android.patch
index 80f852e..9adddeb 100644
--- a/recipes/libiconv/0002-Add-support-for-Android.patch
+++ b/recipes/libiconv/0003-Add-support-for-Android.patch
@@ -1,7 +1,7 @@
-From 9a20774d34736e9c5b7464ff9105001cf929c720 Mon Sep 17 00:00:00 2001
+From 014c29dca5789b13a0b21a3f582b636e40f835bc Mon Sep 17 00:00:00 2001
 From: Andoni Morales Alastruey <ylatuya@gmail.com>
 Date: Tue, 29 Oct 2013 01:41:43 +0100
-Subject: [PATCH 2/3] Add support for Android
+Subject: [PATCH 3/5] Add support for Android
 
 ---
  srclib/stdint.in.h | 11 +++++++++++
@@ -35,5 +35,5 @@ index b6d08c7..bd62bea 100644
 +#endif /* !(defined __ANDROID__ && ...) */
  #endif /* !defined _@GUARD_PREFIX@_STDINT_H && !defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H */
 -- 
-1.8.1.2
+2.7.4
 
diff --git a/recipes/libiconv/0003-stdint-fix-build-with-Android-s-Bionic-fox-x86.patch b/recipes/libiconv/0004-stdint-fix-build-with-Android-s-Bionic-fox-x86.patch
similarity index 86%
rename from recipes/libiconv/0003-stdint-fix-build-with-Android-s-Bionic-fox-x86.patch
rename to recipes/libiconv/0004-stdint-fix-build-with-Android-s-Bionic-fox-x86.patch
index f77900c..b5a0b33 100644
--- a/recipes/libiconv/0003-stdint-fix-build-with-Android-s-Bionic-fox-x86.patch
+++ b/recipes/libiconv/0004-stdint-fix-build-with-Android-s-Bionic-fox-x86.patch
@@ -1,7 +1,7 @@
-From 553f9a811245684009c4588a90afbdfa2a42e2dc Mon Sep 17 00:00:00 2001
+From 49b263313587dd34d0b9f95aba41de602c8602b8 Mon Sep 17 00:00:00 2001
 From: Andoni Morales Alastruey <ylatuya@gmail.com>
 Date: Tue, 15 Jan 2013 11:41:52 +0100
-Subject: [PATCH 3/3] stdint: fix build with Android's Bionic fox x86
+Subject: [PATCH 4/5] stdint: fix build with Android's Bionic fox x86
 
 * lib/stdint.in.h: fix check to test if included-fixed/sys/types.h
 was already included as _SSIZE_T_DEFINED_ might also be defined
@@ -26,5 +26,5 @@ index bd62bea..1ada667 100644
  #else
  
 -- 
-1.8.1.2
+2.7.4
 
diff --git a/recipes/libiconv/0004-lib-Only-rename-locale_charset-for-libiconv-not-libc.patch b/recipes/libiconv/0005-lib-Only-rename-locale_charset-for-libiconv-not-libc.patch
similarity index 84%
rename from recipes/libiconv/0004-lib-Only-rename-locale_charset-for-libiconv-not-libc.patch
rename to recipes/libiconv/0005-lib-Only-rename-locale_charset-for-libiconv-not-libc.patch
index ff7aa9c..ab7701c 100644
--- a/recipes/libiconv/0004-lib-Only-rename-locale_charset-for-libiconv-not-libc.patch
+++ b/recipes/libiconv/0005-lib-Only-rename-locale_charset-for-libiconv-not-libc.patch
@@ -1,7 +1,7 @@
-From 9dd3534f278e4104b1d6a2d1e8d5ec5da82ee9e7 Mon Sep 17 00:00:00 2001
+From 0e01db57925d0e9a9a11b593c2c66d56ba296cc2 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= <sebastian@centricular.com>
 Date: Fri, 14 Aug 2015 13:41:59 +0200
-Subject: [PATCH] lib: Only rename locale_charset() for libiconv, not
+Subject: [PATCH 5/5] lib: Only rename locale_charset() for libiconv, not
  libcharset
 
 If we rename it for both, both will still conflict with each other.
@@ -25,5 +25,5 @@ index a538cce..5657510 100644
  LDFLAGS = @LDFLAGS@ $(LDFLAGS_@WOE32DLL@)
  LDFLAGS_yes = -Wl,--export-all-symbols
 -- 
-2.5.0
+2.7.4
 
-- 
2.15.0

