diff --git a/ports/glib/build.sh b/ports/glib/build.sh new file mode 100755 index 00000000..5117e36b --- /dev/null +++ b/ports/glib/build.sh @@ -0,0 +1,26 @@ +#!/bin/bash ../install.sh + +NAME='glib' +VERSION='2.85.2' +DOWNLOAD_URL="https://download.gnome.org/sources/glib/${VERSION%.*}/glib-$VERSION.tar.xz#833b97c0f0a1bfdba1d0fbfc36cd368b855c5afd9f02b8ffb24129114ad051b2" +DEPENDENCIES=('pcre2' 'libffi' 'zlib' 'libiconv') +CONFIGURE_OPTIONS=( + '-Dprefix=/usr' + '-Dxattr=false' +) + +configure() { + meson setup \ + --reconfigure \ + --cross-file "$MESON_CROSS_FILE" \ + "${CONFIGURE_OPTIONS[@]}" \ + build || exit 1 +} + +build() { + meson compile -C build || exit 1 +} + +install() { + meson install --destdir="$BANAN_SYSROOT" -C build || exit 1 +} diff --git a/ports/glib/patches/0001-remove-dns-support.patch b/ports/glib/patches/0001-remove-dns-support.patch new file mode 100644 index 00000000..81648ee9 --- /dev/null +++ b/ports/glib/patches/0001-remove-dns-support.patch @@ -0,0 +1,106 @@ +diff -ruN glib-2.85.2/gio/gnetworking.h.in glib-2.85.2-banan_os/gio/gnetworking.h.in +--- glib-2.85.2/gio/gnetworking.h.in 2025-07-21 20:47:53.000000000 +0300 ++++ glib-2.85.2-banan_os/gio/gnetworking.h.in 2025-08-19 18:21:06.038296386 +0300 +@@ -40,13 +40,17 @@ + #include + #include + #include ++#ifndef __banan_os__ + #include ++#endif + #include + #include + #include + + #include ++#ifndef __banan_os__ + #include ++#endif + @NAMESER_COMPAT_INCLUDE@ + + #ifndef __GI_SCANNER__ +diff -ruN glib-2.85.2/gio/gthreadedresolver.c glib-2.85.2-banan_os/gio/gthreadedresolver.c +--- glib-2.85.2/gio/gthreadedresolver.c 2025-07-21 20:47:53.000000000 +0300 ++++ glib-2.85.2-banan_os/gio/gthreadedresolver.c 2025-08-19 18:21:06.052332130 +0300 +@@ -41,6 +41,10 @@ + #include "gsocketaddress.h" + #include "gsrvtarget.h" + ++#if defined __banan_os__ ++#include ++#endif ++ + #if HAVE_GETIFADDRS + #include + #endif +@@ -692,7 +696,7 @@ + + #if defined(G_OS_UNIX) + +-#if defined __BIONIC__ && !defined BIND_4_COMPAT ++#if (defined __BIONIC__ && !defined BIND_4_COMPAT) || defined __banan_os__ + /* Copy from bionic/libc/private/arpa_nameser_compat.h + * and bionic/libc/private/arpa_nameser.h */ + typedef struct { +@@ -763,6 +767,14 @@ + #define dn_skipname __dn_skipname + int dn_skipname(const u_char *, const u_char *); + ++#if defined __banan_os__ ++#warning "TODO: dn_expand" ++int dn_expand(const u_char *, const u_char *, const u_char *, char *, int) ++{ ++ return -1; ++} ++#endif ++ + /* From bionic/libc/private/arpa_nameser_compat.h */ + #define T_MX ns_t_mx + #define T_TXT ns_t_txt +@@ -1369,7 +1381,7 @@ + } + + #if defined(G_OS_UNIX) +-#ifdef __BIONIC__ ++#if defined __BIONIC__ + #ifndef C_IN + #define C_IN 1 + #endif +@@ -1420,6 +1432,9 @@ + g_byte_array_set_size (answer, len * 2); + #if defined(HAVE_RES_NQUERY) + len = res_nquery (&res, rrname, C_IN, rrtype, answer->data, answer->len); ++#elif defined __banan_os__ ++#warning "TODO: res_query" ++ len = -1; + #else + len = res_query (rrname, C_IN, rrtype, answer->data, answer->len); + #endif +diff -ruN glib-2.85.2/gio/meson.build glib-2.85.2-banan_os/gio/meson.build +--- glib-2.85.2/gio/meson.build 2025-07-21 20:47:53.000000000 +0300 ++++ glib-2.85.2-banan_os/gio/meson.build 2025-08-19 18:21:06.062294634 +0300 +@@ -18,7 +18,7 @@ + + gnetworking_h_nameser_compat_include = '' + +-if host_system not in ['windows', 'android'] ++if host_system not in ['windows', 'android', 'banan_os'] + # Don't check for C_IN on Android since it does not define it in public + # headers, we define it ourselves wherever necessary + if not cc.compiles('''#include +@@ -40,6 +40,7 @@ + network_libs = [ ] + network_args = [ ] + if host_system != 'windows' ++ if host_system != 'banan_os' + # res_query() + res_query_test = '''#include + int main (int argc, char ** argv) { +@@ -63,6 +64,7 @@ + error('Could not find res_query()') + endif + endif ++ endif + + # socket() + socket_test = '''#include diff --git a/ports/glib/patches/0002-remove-mount-point-detection.patch b/ports/glib/patches/0002-remove-mount-point-detection.patch new file mode 100644 index 00000000..cda8b9fc --- /dev/null +++ b/ports/glib/patches/0002-remove-mount-point-detection.patch @@ -0,0 +1,39 @@ +diff -ruN glib-2.85.2/gio/gunixmounts.c glib-2.85.2-banan_os/gio/gunixmounts.c +--- glib-2.85.2/gio/gunixmounts.c 2025-07-21 20:47:53.000000000 +0300 ++++ glib-2.85.2-banan_os/gio/gunixmounts.c 2025-08-19 18:21:06.055332112 +0300 +@@ -1114,7 +1114,7 @@ + } + + /* QNX {{{2 */ +-#elif defined (HAVE_QNX) ++#elif defined (HAVE_QNX) || defined (__banan_os__) + + static char * + get_mtab_monitor_file (void) +@@ -1754,6 +1754,26 @@ + if (time_read_out != NULL) + *time_read_out = 0; + if (n_points_out != NULL) ++ *n_points_out = 0; ++ return NULL; ++} ++ ++#elif defined (__banan_os__) ++ ++static GList * ++_g_get_unix_mount_points (void) ++{ ++ return NULL; ++} ++ ++static GUnixMountPoint ** ++_g_unix_mount_points_get_from_file (const char *table_path, ++ uint64_t *time_read_out, ++ size_t *n_points_out) ++{ ++ if (time_read_out != NULL) ++ *time_read_out = 0; ++ if (n_points_out != NULL) + *n_points_out = 0; + return NULL; + }