Skip to content

Commit

Permalink
Update glib fixes for iconv and libintl. both now provide pkg-config,…
Browse files Browse the repository at this point in the history
… can be found using 'dependency'
  • Loading branch information
ViliusSutkus89 committed Jun 21, 2019
1 parent 0f98b60 commit d8ca7ef
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
20 changes: 6 additions & 14 deletions 3rdparty/packages/FixGlibSource.sh
Original file line number Diff line number Diff line change
@@ -1,21 +1,13 @@
#!/usr/bin/env bash
set -euo pipefail
SRC=$1/meson.build
THIRDPARTY_LIBDIR=$2/lib
THIRDPARTY_LIBDIR_SLASH_ESCAPED="${THIRDPARTY_LIBDIR//\//\\\/}\/"
MESON_BUILD_FILE=$1/meson.build
ANDROID_ABI_LEVEL=$2

ANDROID_ABI_LEVEL=$3

echo "Before patching: "
grep "find_library('iconv'" $SRC
sed -i "s/find_library('iconv')/find_library('iconv', dirs: '${THIRDPARTY_LIBDIR_SLASH_ESCAPED}')/g" $SRC

echo ""
echo "After patching: "
grep "find_library('iconv'" $SRC
sed -i "s/cc.find_library('iconv')/dependency('iconv')/g" $MESON_BUILD_FILE

sed -i "s/cc.find_library('intl'/dependency('intl'/g" $MESON_BUILD_FILE

if [ "${ANDROID_ABI_LEVEL}" -lt "21" ]; then
echo "Patching $SRC to not use stpcpy. Meson detects it, however it is not avail."
sed -i "s/glib_conf.set('HAVE_STPCPY', 1)/#glib_conf.set('HAVE_STPCPY', 1)/g" $SRC
echo "Patching $MESON_BUILD_FILE to not use stpcpy. Meson detects it, however it is not avail."
sed -i "s/glib_conf.set('HAVE_STPCPY', 1)/#glib_conf.set('HAVE_STPCPY', 1)/g" $MESON_BUILD_FILE
fi
1 change: 0 additions & 1 deletion 3rdparty/packages/glib-2.0.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,5 @@ ExternalProjectMeson(glib-2.0
UPDATE_COMMAND
${CMAKE_CURRENT_SOURCE_DIR}/packages/FixGlibSource.sh
${CMAKE_CURRENT_BINARY_DIR}/glib-2.0-prefix/src/glib-2.0/
${THIRDPARTY_PREFIX}
${ANDROID_NATIVE_API_LEVEL}
)

0 comments on commit d8ca7ef

Please sign in to comment.