Commit 21632b70 authored by Bruno Coudoin's avatar Bruno Coudoin

Improved the bundling of GCompris for MacOSX. Seems to have everything in place now.

parent 808f092e
......@@ -164,8 +164,8 @@ fi
# From http://autopackage.org/docs/binreloc/
enable_binreloc=auto
if test x"$nsbundle" = "xyes" ; then
enable_binreloc=no
AC_MSG_NOTICE([binreloc disabled by nsbundle])
enable_binreloc=yes
AC_MSG_NOTICE([binreloc enabled by nsbundle])
fi
AM_BINRELOC
......@@ -331,12 +331,12 @@ elif test "x$nsbundle" = "xyes" ; then
AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "../Resources/${DATADIRNAME}", [GCompris data directory])
dnl Plugin Directory
AC_DEFINE_UNQUOTED(PACKAGE_CLIB_DIR, "../Resources/${DATADIRNAME}", [Gcompris plugins directory])
plugindir=${myprefix}/${DATADIRNAME}/gcompris
AC_DEFINE_UNQUOTED(PACKAGE_CLIB_DIR, "../Resources/lib", [Gcompris plugins directory])
plugindir=${myprefix}/lib/gcompris
AC_SUBST(plugindir)
dnl Python plugin Directory
PYTHON_PLUGIN_DIR="../Resources/${DATADIRNAME}/gcompris/python"
PYTHON_PLUGIN_DIR=${myprefix}/${DATADIRNAME}/gcompris/python
AC_SUBST(PYTHON_PLUGIN_DIR)
dnl System GCompris config directory
......
......@@ -9,7 +9,7 @@
<key>CFBundleGetInfoString</key>
<string>9.2, Copyright 2000-2010 Bruno Coudoin and Others</string>
<key>CFBundleIconFile</key>
<string>Giggle.icns</string>
<string>GCompris.icns</string>
<key>CFBundleIdentifier</key>
<string>net.gcompris</string>
<key>CFBundleInfoDictionaryVersion</key>
......
......@@ -71,6 +71,11 @@
${prefix}/lib/libvorbisfile.dylib
</binary>
<!-- GCompris plugins -->
<binary>
${prefix}/lib/gcompris/*.so
</binary>
<!-- Copy in GTK+ theme engines. Dunno why this is a dupe of
modules, but that's why it's commented out. >
<binary>
......
......@@ -15,7 +15,7 @@ tmp="`pwd`/$0"
tmp=`dirname "$tmp"`
tmp=`dirname "$tmp"`
bundle=`dirname "$tmp"`
bundle_contents="$bundle"
bundle_contents="$bundle"/Contents
bundle_res="$bundle_contents"/Resources
bundle_lib="$bundle_res"/lib
bundle_bin="$bundle_res"/bin
......@@ -107,7 +107,7 @@ if test "$APPLELANGUAGES"; then
export LC_MESSAGES=`echo ${LC} | awk '{print $1}' | awk -F/ '{print $5}'`
break
fi
done
done
fi
unset APPLELANGUAGES POS LC L
......
......@@ -23,14 +23,6 @@ no_undefined =
shared =
endif
#if WITH_NSBUNDLE
#gcompris_nsbundle_m = gcompris-nsbundle.m
#gcompris_nsbundle_h = gcompris-nsbundle.h
#else
gcompris_nsbundle_m =
gcompris_nsbundle_h =
#endif
bin_PROGRAMS = gcompris
INCLUDES = \
......@@ -47,14 +39,11 @@ INCLUDES = \
$(DBUS_CFLAGS) \
$(AUDIO_CFLAGS) \
$(cairo_cflags) \
$(NSBUNDLE_CPPFLAGS) \
${IGE_MAC_CFLAGS}
gcompris_SOURCES = \
$(cairo_c) \
$(cairo_h) \
$(gcompris_nsbundle_h) \
$(gcompris_nsbundle_m) \
about.c \
about.h \
anim.c \
......@@ -127,7 +116,7 @@ gcompris_LDADD = \
$(GCOMPRIS_LIBS) $(sqlite_ldadd) $(XML_LIBS) $(GNET_LIBS) \
$(DBUS_LIBS) \
$(AUDIO_LIBS) \
$(INTLLIBS) $(NSBUNDLE_LDFLAGS) \
$(INTLLIBS) \
${IGE_MAC_LIBS}
marshal_sources = \
......@@ -149,8 +138,6 @@ EXTRA_DIST = \
DONT_DIST_SOURCE = $(marshal_sources)
gcompris_nsbundle_CPPFLAGS = -fconstant-string-class=NSConstantString
if SUGAR
INCLUDES += $(SUGAR_CFLAGS)
gcompris_SOURCES += sugar.c
......
......@@ -25,6 +25,11 @@
#include <string.h>
#include "binreloc.h"
#ifdef MAC_INTEGRATION
#include <igemacintegration/ige-mac-bundle.h>
static IgeMacBundle *bundle = NULL;
#endif
G_BEGIN_DECLS
......@@ -46,7 +51,7 @@ _br_find_exe (GbrInitError *error)
relocation code for windows. Unfortunately this is not
the case and we have to add this manually. This is only
one possibility; other ways of looking up the full path
of gnucash-bin.exe probably exist.*/
of gcompris-bin.exe probably exist.*/
gchar *prefix;
gchar *result;
......@@ -55,7 +60,7 @@ _br_find_exe (GbrInitError *error)
the current process */
prefix = g_win32_get_package_installation_directory_of_module (NULL);
result = g_build_filename (prefix,
"bin", "gnucash-bin.exe",
"bin", "gcompris.exe",
(char*)NULL);
g_free (prefix);
return result;
......@@ -76,7 +81,7 @@ _br_find_exe (GbrInitError *error)
ige_mac_bundle_setup_environment(bundle);
prefix = g_strdup(ige_mac_bundle_get_path(bundle));
result = g_build_filename(prefix, "Contents/MacOS",
"gnucash-bin", NULL);
"GCompris-bin", NULL);
g_free(prefix);
return result;
#else
......@@ -595,7 +600,11 @@ gbr_find_data_dir (const gchar *default_data_dir)
return NULL;
}
#ifdef MAC_INTEGRATION
dir = g_strdup(ige_mac_bundle_get_datadir(bundle));
#else
dir = g_build_filename (prefix, "share", NULL);
#endif
g_free (prefix);
return dir;
}
......@@ -628,7 +637,11 @@ gbr_find_locale_dir (const gchar *default_locale_dir)
return NULL;
}
#ifdef MAC_INTEGRATION
dir = g_strdup(ige_mac_bundle_get_localedir(bundle));
#else
dir = g_build_filename (data_dir, "locale", NULL);
#endif
g_free (data_dir);
return dir;
}
......@@ -661,10 +674,15 @@ gbr_find_lib_dir (const gchar *default_lib_dir)
return NULL;
}
#ifdef MAC_INTEGRATION
dir = g_build_filename(ige_mac_bundle_get_datadir(bundle),
"..", "lib", NULL);
#else
if (default_lib_dir && strstr(default_lib_dir, "lib64"))
dir = g_build_filename (prefix, "lib64", NULL);
else
dir = g_build_filename (prefix, "lib", NULL);
#endif
g_free (prefix);
return dir;
}
......
......@@ -29,7 +29,11 @@ typedef enum {
/** The file format of /proc/self/maps is invalid; kernel bug? */
GBR_INIT_ERROR_INVALID_MAPS,
/** BinReloc is disabled (the ENABLE_BINRELOC macro is not defined). */
GBR_INIT_ERROR_DISABLED
GBR_INIT_ERROR_DISABLED,
/** Not a bundle error on MacOSX */
GBR_INIT_ERROR_MAC_NOT_BUNDLE,
/** Not an application bundle error on MacOSX */
GBR_INIT_ERROR_MAC_NOT_APP_BUNDLE
} GbrInitError;
......
......@@ -1220,15 +1220,19 @@ void gc_terminate(int signum)
static void load_properties ()
{
GError *error = NULL;
properties = gc_prop_new ();
/* Initialize the binary relocation API
* http://autopackage.org/docs/binreloc/
*/
if(gbr_init (NULL))
if(gbr_init (&error))
g_message("Binary relocation enabled");
else
g_message("Binary relocation disabled");
{
g_message("Binary relocation disabled code = %d", error->code);
g_error_free (error);
}
/* usefull for OSX bundle app */
/* FIXME exec_prefix should be put in properties */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment