Update glib-2.38.1 patch and recipe to a working state.

* Add G_OS_HAIKU to many sections guarded by G_OS_UNIX.
* Implement a few platform specifics, mostly stubbed.
* Update recipe to move glibconfig into devel package and actually
  build it.
* Remove no longer needed PATCH() function.
* Pass jobArgs through to make.
This commit is contained in:
Michael Lotz
2013-12-07 15:15:52 +00:00
parent 72ac1f84c6
commit 5880131f1c
2 changed files with 357 additions and 19 deletions

View File

@@ -43,11 +43,10 @@ PROVIDES="
REQUIRES="
haiku$secondaryArchSuffix >= $haikuVersion
lib:gettext
gettext
lib:libiconv
lib:libz
lib:libffi$secondaryArchSuffix
lib:gettext
lib:libintl
"
@@ -72,20 +71,13 @@ BUILD_PREREQUIRES="
PATCHES="glib-2.38.1.patch"
PATCH()
{
sed -i 's/#error No _g_get_unix_mounts() implementation for system/\/* #error No _g_get_unix_mounts() implementation for system *\//' gio/gunixmounts.c
sed -i 's/#error No g_get_mount_table() implementation for system/\/* #error No g_get_mount_table() implementation for system *\//' gio/gunixmounts.c
}
BUILD()
{
libtoolize --force --copy --install
aclocal
autoconf
runConfigure ./configure
make
make $jobArgs
}
INSTALL()
@@ -97,13 +89,15 @@ INSTALL()
libgmodule-2.0 \
libgobject-2.0 \
libgthread-2.0
# move the glibconfig header into devel as well
mv $libDir/glib-2.0 $developLibDir
fixPkgconfig
# devel package
packageEntries devel \
# $binDir \
$developDir \
$manDir/man3
$developDir
}
# ----- devel package -------------------------------------------------------

View File

@@ -1,5 +1,5 @@
diff --git a/configure.ac b/configure.ac
index f0840d5..856fac7 100644
index f0840d5..f7df259 100644
--- a/configure.ac
+++ b/configure.ac
@@ -122,6 +122,10 @@ case $host in
@@ -24,15 +24,17 @@ index f0840d5..856fac7 100644
;;
*-solaris*)
# These compiler/linker flags work with both Sun Studio and gcc
@@ -2232,7 +2236,7 @@ if test "x$G_THREAD_LIBS" = xerror; then
@@ -2232,8 +2236,8 @@ if test "x$G_THREAD_LIBS" = xerror; then
fi
case $host in
- *-*-beos*)
- G_THREAD_LIBS="-lbe -lroot -lglib-2.0 "
+ *-*-beos*|*-*-haiku*)
G_THREAD_LIBS="-lbe -lroot -lglib-2.0 "
+ G_THREAD_LIBS="-lbe -lroot"
G_THREAD_LIBS_EXTRA="-L\$(top_builddir_full)/.libs"
;;
*)
@@ -3574,6 +3578,9 @@ case $host in
*-*-beos*)
glib_os="#define G_OS_BEOS"
@@ -43,10 +45,227 @@ index f0840d5..856fac7 100644
*-*-cygwin*)
glib_os="#define G_OS_UNIX
#define G_PLATFORM_WIN32
diff --git a/gio/data-to-c.pl b/gio/data-to-c.pl
index 20ba2fb..539b7e0 100755
--- a/gio/data-to-c.pl
+++ b/gio/data-to-c.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
# Copyright © 2011 Red Hat, Inc
#
diff --git a/gio/gapplicationcommandline.c b/gio/gapplicationcommandline.c
index 9a0840f..896a889 100644
--- a/gio/gapplicationcommandline.c
+++ b/gio/gapplicationcommandline.c
@@ -29,7 +29,7 @@
#include <string.h>
#include <stdio.h>
-#ifdef G_OS_UNIX
+#if defined(G_OS_UNIX) || defined(G_OS_HAIKU)
#include "gunixinputstream.h"
#endif
@@ -201,7 +201,7 @@ g_application_command_line_real_printerr_literal (GApplicationCommandLine *cmdli
static GInputStream *
g_application_command_line_real_get_stdin (GApplicationCommandLine *cmdline)
{
-#ifdef G_OS_UNIX
+#if defined(G_OS_UNIX) || defined(G_OS_HAIKU)
return g_unix_input_stream_new (0, FALSE);
#else
return g_win32_input_stream_new (GetStdHandle (STD_INPUT_HANDLE), FALSE);
diff --git a/gio/gdbusauthmechanismsha1.c b/gio/gdbusauthmechanismsha1.c
index e4f75eb..2c70803 100644
--- a/gio/gdbusauthmechanismsha1.c
+++ b/gio/gdbusauthmechanismsha1.c
@@ -252,7 +252,7 @@ ensure_keyring_directory (GError **error)
{
if (g_getenv ("G_DBUS_COOKIE_SHA1_KEYRING_DIR_IGNORE_PERMISSION") == NULL)
{
-#ifdef G_OS_UNIX
+#if defined(G_OS_UNIX) || defined(G_OS_HAIKU)
struct stat statbuf;
if (stat (path, &statbuf) != 0)
{
@@ -947,7 +947,7 @@ mechanism_server_initiate (GDBusAuthMechanism *mechanism,
if (initial_response != NULL && strlen (initial_response) > 0)
{
-#ifdef G_OS_UNIX
+#if defined(G_OS_UNIX) || defined(G_OS_HAIKU)
gint64 uid;
gchar *endp;
@@ -1114,7 +1114,7 @@ mechanism_client_initiate (GDBusAuthMechanism *mechanism,
*out_initial_response_len = -1;
-#ifdef G_OS_UNIX
+#if defined(G_OS_UNIX) || defined(G_OS_HAIKU)
initial_response = g_strdup_printf ("%" G_GINT64_FORMAT, (gint64) getuid ());
#elif defined (G_OS_WIN32)
initial_response = _g_dbus_win32_get_user_sid ();
diff --git a/gio/glocalfile.c b/gio/glocalfile.c
index 345214d..11eae36 100644
--- a/gio/glocalfile.c
+++ b/gio/glocalfile.c
@@ -27,7 +27,7 @@
#include <string.h>
#include <errno.h>
#include <fcntl.h>
-#if G_OS_UNIX
+#if HAVE_DIRENT_H
#include <dirent.h>
#endif
#ifdef HAVE_UNISTD_H
@@ -67,7 +67,7 @@
#include "gioerror.h"
#include <glib/gstdio.h>
#include "glibintl.h"
-#ifdef G_OS_UNIX
+#if defined(G_OS_UNIX) || defined(G_OS_HAIKU)
#include "glib-unix.h"
#endif
#include "glib-private.h"
@@ -1818,7 +1818,7 @@ _g_local_file_has_trash_dir (const char *dirname, dev_t dir_dev)
return res;
}
-#ifdef G_OS_UNIX
+#if defined(G_OS_UNIX) || defined(G_OS_HAIKU)
gboolean
_g_local_file_is_lost_found_dir (const char *path, dev_t path_dev)
{
diff --git a/gio/glocalfileinfo.h b/gio/glocalfileinfo.h
index 6d35be5..e286098 100644
--- a/gio/glocalfileinfo.h
+++ b/gio/glocalfileinfo.h
@@ -58,7 +58,7 @@ typedef struct
gboolean _g_local_file_has_trash_dir (const char *dirname,
dev_t dir_dev);
-#ifdef G_OS_UNIX
+#if defined(G_OS_UNIX) || defined(G_OS_HAIKU)
gboolean _g_local_file_is_lost_found_dir (const char *path,
dev_t path_dev);
#endif
diff --git a/gio/gsocket.c b/gio/gsocket.c
index 18e6137..689d3c0 100644
--- a/gio/gsocket.c
+++ b/gio/gsocket.c
@@ -29,7 +29,7 @@
#include "gsocket.h"
-#ifdef G_OS_UNIX
+#if defined(G_OS_UNIX) || defined(G_OS_HAIKU)
#include "glib-unix.h"
#endif
diff --git a/gio/gthreadedresolver.c b/gio/gthreadedresolver.c
index 1ffaf15..702cf00 100644
--- a/gio/gthreadedresolver.c
+++ b/gio/gthreadedresolver.c
@@ -245,7 +245,7 @@ lookup_by_address_finish (GResolver *resolver,
}
-#if defined(G_OS_UNIX)
+#if defined(G_OS_UNIX) || defined(G_OS_HAIKU)
#ifdef __BIONIC__
/* Copy from bionic/libc/private/arpa_nameser_compat.h
@@ -813,7 +813,7 @@ do_lookup_records (GTask *task,
GList *records;
GError *error = NULL;
-#if defined(G_OS_UNIX)
+#if defined(G_OS_UNIX) || defined(G_OS_HAIKU)
gint len = 512;
gint herr;
GByteArray *answer;
diff --git a/gio/gunixmounts.c b/gio/gunixmounts.c
index 03f1720..cb438a4 100644
--- a/gio/gunixmounts.c
+++ b/gio/gunixmounts.c
@@ -72,7 +72,6 @@
#include "glibintl.h"
#include "gthemedicon.h"
-
#ifdef HAVE_MNTENT_H
static const char *_resolve_dev_root (void);
#endif
@@ -716,6 +715,18 @@ _g_get_unix_mounts (void)
return return_list;
}
+#elif defined(G_OS_HAIKU)
+static char *
+get_mtab_monitor_file (void)
+{
+ return NULL;
+}
+
+static GList *
+_g_get_unix_mounts (void)
+{
+ return NULL;
+}
#else
#error No _g_get_unix_mounts() implementation for system
#endif
@@ -1106,7 +1117,7 @@ _g_get_unix_mount_points (void)
return g_list_reverse (return_list);
}
-#elif defined(__INTERIX)
+#elif defined(__INTERIX) || defined(G_OS_HAIKU)
static GList *
_g_get_unix_mount_points (void)
{
diff --git a/glib/gbacktrace.c b/glib/gbacktrace.c
index 4d19d6f..1c46778 100644
--- a/glib/gbacktrace.c
+++ b/glib/gbacktrace.c
@@ -228,7 +228,7 @@ g_on_error_query (const gchar *prg_name)
void
g_on_error_stack_trace (const gchar *prg_name)
{
-#if defined(G_OS_UNIX) || defined(G_OS_BEOS)
+#if defined(G_OS_UNIX) || defined(G_OS_BEOS) || defined(G_OS_HAIKU)
pid_t pid;
gchar buf[16];
gchar *args[4] = { "gdb", NULL, NULL, NULL };
diff --git a/glib/glib-unix.h b/glib/glib-unix.h
index 66ccf74..a03a0cf 100644
--- a/glib/glib-unix.h
+++ b/glib/glib-unix.h
@@ -34,7 +34,7 @@
#include <glib.h>
-#ifndef G_OS_UNIX
+#if !defined(G_OS_UNIX) && !defined(G_OS_HAIKU)
#error "This header may only be used on UNIX"
#endif
diff --git a/glib/gmain.c b/glib/gmain.c
index 738e69c..564c6cf 100644
index 738e69c..4f5dfab 100644
--- a/glib/gmain.c
+++ b/glib/gmain.c
@@ -47,7 +47,7 @@
#define G_MAIN_POLL_DEBUG
#endif
-#ifdef G_OS_UNIX
+#if defined(G_OS_UNIX) || defined(G_OS_HAIKU)
#include "glib-unix.h"
#include <pthread.h>
#ifdef HAVE_EVENTFD
@@ -73,10 +73,11 @@
#include <windows.h>
#endif /* G_OS_WIN32 */
@@ -61,6 +280,82 @@ index 738e69c..564c6cf 100644
#include "gmain.h"
@@ -391,7 +392,7 @@ static gboolean g_child_watch_dispatch (GSource *source,
GSourceFunc callback,
gpointer user_data);
static void g_child_watch_finalize (GSource *source);
-#ifdef G_OS_UNIX
+#if defined(G_OS_UNIX) || defined(G_OS_HAIKU)
static void g_unix_signal_handler (int signum);
static gboolean g_unix_signal_watch_prepare (GSource *source,
gint *timeout);
@@ -2259,7 +2260,7 @@ g_source_remove_by_funcs_user_data (GSourceFuncs *funcs,
return FALSE;
}
-#ifdef G_OS_UNIX
+#if defined(G_OS_UNIX) || defined(G_OS_HAIKU)
/**
* g_source_add_unix_fd:
* @source: a #GSource
@@ -2425,7 +2426,7 @@ g_source_query_unix_fd (GSource *source,
return poll_fd->revents;
}
-#endif /* G_OS_UNIX */
+#endif /* G_OS_UNIX || G_OS_HAIKU */
/**
* g_get_current_time:
@@ -5471,7 +5472,7 @@ glib_worker_main (gpointer data)
{
g_main_context_iteration (glib_worker_context, TRUE);
-#ifdef G_OS_UNIX
+#if defined(G_OS_UNIX) || defined(G_OS_HAIKU)
if (any_unix_signal_pending)
dispatch_unix_signals ();
#endif
@@ -5488,7 +5489,7 @@ g_get_worker_context (void)
if (g_once_init_enter (&initialised))
{
/* mask all signals in the worker thread */
-#ifdef G_OS_UNIX
+#if defined(G_OS_UNIX) || defined(G_OS_HAIKU)
sigset_t prev_mask;
sigset_t all;
@@ -5497,7 +5498,7 @@ g_get_worker_context (void)
#endif
glib_worker_context = g_main_context_new ();
g_thread_new ("gmain", glib_worker_main, NULL);
-#ifdef G_OS_UNIX
+#if defined(G_OS_UNIX) || defined(G_OS_HAIKU)
pthread_sigmask (SIG_SETMASK, &prev_mask, NULL);
#endif
g_once_init_leave (&initialised, TRUE);
diff --git a/glib/gmain.h b/glib/gmain.h
index c455353..ad7b330 100644
--- a/glib/gmain.h
+++ b/glib/gmain.h
@@ -471,7 +471,7 @@ void g_source_set_ready_time (GSource *source,
GLIB_AVAILABLE_IN_2_36
gint64 g_source_get_ready_time (GSource *source);
-#ifdef G_OS_UNIX
+#if defined(G_OS_UNIX) || defined(G_OS_HAIKU)
GLIB_AVAILABLE_IN_2_36
gpointer g_source_add_unix_fd (GSource *source,
gint fd,
@@ -606,7 +606,7 @@ void g_main_context_invoke (GMainContext *context,
GLIB_VAR GSourceFuncs g_timeout_funcs;
GLIB_VAR GSourceFuncs g_child_watch_funcs;
GLIB_VAR GSourceFuncs g_idle_funcs;
-#ifdef G_OS_UNIX
+#if defined(G_OS_UNIX) || defined(G_OS_HAIKU)
GLIB_VAR GSourceFuncs g_unix_signal_funcs;
GLIB_VAR GSourceFuncs g_unix_fd_source_funcs;
#endif
diff --git a/glib/gstdio.c b/glib/gstdio.c
index cca4ff5..6f4ae9c 100644
--- a/glib/gstdio.c
@@ -75,10 +370,22 @@ index cca4ff5..6f4ae9c 100644
#endif
diff --git a/glib/gutils.c b/glib/gutils.c
index 2620cb6..0b4ec6b 100644
index 2620cb6..34f1edd 100644
--- a/glib/gutils.c
+++ b/glib/gutils.c
@@ -421,7 +421,7 @@ g_find_program_in_path (const gchar *program)
@@ -77,6 +77,11 @@
#include "gwin32.h"
#endif
+#if defined(G_OS_HAIKU)
+#include <FindDirectory.h>
+#include <fs_info.h>
+#endif
+
/**
* SECTION:misc_utils
@@ -421,7 +426,7 @@ g_find_program_in_path (const gchar *program)
}
path = g_getenv ("PATH");
@@ -87,3 +394,40 @@ index 2620cb6..0b4ec6b 100644
if (path == NULL)
{
/* There is no 'PATH' in the environment. The default
@@ -1467,6 +1472,36 @@ load_user_special_dirs (void)
#endif /* HAVE_CARBON */
+#if defined(G_OS_HAIKU)
+static void
+load_user_special_dirs (void)
+{
+ char path[B_PATH_NAME_LENGTH + B_FILE_NAME_LENGTH];
+
+ dev_t volume = dev_for_path("/boot");
+ if (find_directory(B_DESKTOP_DIRECTORY, volume, false, path, sizeof(path))
+ == B_OK) {
+ g_user_special_dirs[G_USER_DIRECTORY_DESKTOP] = g_strdup(path);
+ g_user_special_dirs[G_USER_DIRECTORY_DOWNLOAD] = g_strdup(path);
+ } else {
+ g_user_special_dirs[G_USER_DIRECTORY_DOCUMENTS] = NULL;
+ g_user_special_dirs[G_USER_DIRECTORY_DESKTOP] = NULL;
+ }
+
+ if (find_directory(B_USER_DIRECTORY, volume, false, path, sizeof(path))
+ == B_OK) {
+ g_user_special_dirs[G_USER_DIRECTORY_DOCUMENTS] = g_strdup(path);
+ } else
+ g_user_special_dirs[G_USER_DIRECTORY_DOWNLOAD] = NULL;
+
+ g_user_special_dirs[G_USER_DIRECTORY_MUSIC] = NULL;
+ g_user_special_dirs[G_USER_DIRECTORY_PICTURES] = NULL;
+ g_user_special_dirs[G_USER_DIRECTORY_PUBLIC_SHARE] = NULL;
+ g_user_special_dirs[G_USER_DIRECTORY_TEMPLATES] = NULL;
+ g_user_special_dirs[G_USER_DIRECTORY_VIDEOS] = NULL;
+}
+#endif /* G_OS_HAIKU */
+
#if defined(G_OS_WIN32)
static void
load_user_special_dirs (void)