summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorGonzalo Exequiel Pedone2024-02-09 19:23:12 -0300
committerGonzalo Exequiel Pedone2024-02-09 19:23:12 -0300
commit6841761cd6c25983c79d53c6e730491ce9275e13 (patch)
treeda5341b9a33b5306e640b8622f6c1746ffe6718b
downloadaur-6841761cd6c25983c79d53c6e730491ce9275e13.tar.gz
New package.
-rw-r--r--.SRCINFO22
-rw-r--r--.gitignore6
-rw-r--r--0001-Fix-build.patch75
-rw-r--r--PKGBUILD61
4 files changed, 164 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..e3be862cb727
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,22 @@
+pkgbase = android-x86-glib2
+ pkgdesc = Low level core library (android)
+ pkgver = 2.78.3
+ pkgrel = 1
+ url = https://wiki.gnome.org/Projects/GLib
+ arch = any
+ license = LGPL2.1
+ makedepends = android-meson
+ depends = android-x86-libffi
+ depends = android-x86-pcre2
+ depends = android-x86-gettext
+ depends = android-x86-zlib
+ options = !strip
+ options = !buildflags
+ options = staticlibs
+ options = !emptydirs
+ source = https://download.gnome.org/sources/glib/2.78/glib-2.78.3.tar.xz
+ source = 0001-Fix-build.patch
+ sha256sums = 609801dd373796e515972bf95fc0b2daa44545481ee2f465c4f204d224b2bc21
+ sha256sums = 26ec88e5fe6f13a5ea024384a01eb6f9ac2d1e93bdb4e47641339963c187353c
+
+pkgname = android-x86-glib2
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..498d7345e533
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,6 @@
+glib/
+pkg/
+src/
+*.log
+*.tar
+*.xz
diff --git a/0001-Fix-build.patch b/0001-Fix-build.patch
new file mode 100644
index 000000000000..4c4e865b3c32
--- /dev/null
+++ b/0001-Fix-build.patch
@@ -0,0 +1,75 @@
+--- a/meson.build 2023-12-06 15:03:55.000000000 -0300
++++ b/meson.build 2024-02-09 11:06:52.179779837 -0300
+@@ -2068,6 +2068,13 @@
+
+ glibconfig_conf.set10('G_HAVE_GROWING_STACK', growing_stack)
+
++res = run_command('python3', '-c', 'import os; print(os.environ["LIBRARY_PATH"])')
++library_path = []
++
++if res.returncode() == 0
++ library_path = res.stdout().strip().split(':')
++endif
++
+ # Tests for iconv
+ #
+ # We should never use the MinGW C library's iconv because it may not be
+@@ -2078,22 +2085,22 @@
+ # any external library for it
+ libiconv = []
+ else
+- libiconv = dependency('iconv')
++ libiconv = cc.find_library('iconv', required: false, dirs: library_path)
+ endif
+
+ pcre2_req = '>=10.32'
+
+ # Pick up pcre from the system, or if "--force-fallback-for libpcre2-8" was specified
+-pcre2 = dependency('libpcre2-8', version: pcre2_req, required: false, default_options: ['default_library=static'])
++pcre2 = cc.find_library('pcre2-8', required: false, dirs: library_path)
+ if not pcre2.found()
+ if cc.get_id() == 'msvc' or cc.get_id() == 'clang-cl'
+ # MSVC: Search for the PCRE2 library by the configuration, which corresponds
+ # to the output of CMake builds of PCRE2. Note that debugoptimized
+ # is really a Release build with .PDB files.
+ if vs_crt == 'debug'
+- pcre2 = cc.find_library('pcre2d-8', required : false)
++ pcre2 = cc.find_library('pcre2d-8', required: false, dirs: library_path)
+ else
+- pcre2 = cc.find_library('pcre2-8', required : false)
++ pcre2 = cc.find_library('pcre2-8', required: false, dirs: library_path)
+ endif
+ endif
+ endif
+@@ -2126,7 +2133,7 @@
+ gvdb_dep = dependency('gvdb')
+
+ libm = cc.find_library('m', required : false)
+-libffi_dep = dependency('libffi', version : '>= 3.0.0')
++libffi_dep = cc.find_library('ffi', dirs: library_path)
+
+ libz_dep = dependency('zlib')
+
+@@ -2136,7 +2143,7 @@
+ # implementations. This could be extended if issues are found in some platforms.
+ libintl_deps = []
+ libintl_prefix = '#include <libintl.h>'
+-libintl = dependency('intl', required: false)
++libintl = cc.find_library('intl', dirs: library_path)
+ if libintl.found() and libintl.type_name() != 'internal'
+ # libintl supports different threading APIs, which may not
+ # require additional flags, but it defaults to using pthreads if
+@@ -2150,11 +2157,11 @@
+ if cc.has_function('ngettext', dependencies : libintl, prefix: libintl_prefix)
+ libintl_deps += [libintl]
+ else
+- libintl_iconv = cc.find_library('iconv', required : false)
++ libintl_iconv = cc.find_library('iconv', required: false, dirs: library_path)
+ if libintl_iconv.found() and cc.has_function('ngettext', args : osx_ldflags, dependencies : [libintl, libintl_iconv])
+ libintl_deps += [libintl, libintl_iconv]
+ else
+- libintl_pthread = cc.find_library('pthread', required : false)
++ libintl_pthread = cc.find_library('pthread', required: false, dirs: library_path)
+ if libintl_pthread.found() and cc.has_function('ngettext', dependencies : [libintl, libintl_pthread], prefix: libintl_prefix)
+ libintl_deps += [libintl, libintl_pthread]
+ else
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..e42cc4328d71
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,61 @@
+# Maintainer: Gonzalo Exequiel Pedone <hipersayan DOT x AT gmail DOT com>
+# Contributor: drakkan <nicola.murino at gmail dot com>
+# Contributor: Filip Brcic <brcha@gna.org>
+# Contributor: ant32 <antreimer@gmail.com>
+# Contributor: Renato Silva <br.renatosilva@gmail.com>
+# Contributor: Martchus <martchus@gmx.net>
+
+_android_arch=x86
+
+pkgname=android-${_android_arch}-glib2
+pkgver=2.78.3
+pkgrel=1
+pkgdesc="Low level core library (android)"
+arch=('any')
+url="https://wiki.gnome.org/Projects/GLib"
+license=("LGPL2.1")
+depends=("android-${_android_arch}-libffi"
+ "android-${_android_arch}-pcre2"
+ "android-${_android_arch}-gettext"
+ "android-${_android_arch}-zlib")
+options=(!strip !buildflags staticlibs !emptydirs)
+makedepends=('android-meson')
+source=("https://download.gnome.org/sources/glib/${pkgver%.*}/glib-${pkgver}.tar.xz"
+ '0001-Fix-build.patch')
+sha256sums=('609801dd373796e515972bf95fc0b2daa44545481ee2f465c4f204d224b2bc21'
+ '26ec88e5fe6f13a5ea024384a01eb6f9ac2d1e93bdb4e47641339963c187353c')
+
+prepare() {
+ cd "${srcdir}"/glib-${pkgver}
+
+ patch -Np1 -i ../0001-Fix-build.patch
+}
+
+build() {
+ cd "${srcdir}"/glib-${pkgver}
+ source android-env ${_android_arch}
+
+ export C_INCLUDE_PATH="${ANDROID_PREFIX_INCLUDE}"
+ export LIBRARY_PATH="${ANDROID_PREFIX_LIB}"
+
+ for type in static shared; do
+ rm -rf "${srcdir}/glib-${pkgver}/build-${_android_arch}-${type}"
+ mkdir -p "${srcdir}/glib-${pkgver}/build-${_android_arch}-${type}"
+ cd "${srcdir}/glib-${pkgver}/build-${_android_arch}-${type}"
+ android-${_android_arch}-meson \
+ --default-library "${type}" \
+ ..
+ ninja
+ done
+}
+
+package() {
+ source android-env ${_android_arch}
+
+ DESTDIR="${pkgdir}" ninja -C "${srcdir}/glib-${pkgver}/build-${_android_arch}-static" install
+ DESTDIR="${pkgdir}" ninja -C "${srcdir}/glib-${pkgver}/build-${_android_arch}-shared" install
+
+ rm -rf "${pkgdir}"/${ANDROID_PREFIX_BIN}
+ ${ANDROID_STRIP} -g --strip-unneeded "${pkgdir}"/${ANDROID_PREFIX_LIB}/*.so
+ #${ANDROID_STRIP} -g "$pkgdir"/${ANDROID_PREFIX_LIB}/*.a
+}