Redoing the Mac bundling

With the right tools in place you can now create a bundle from the
Makefile by calling "make create-macos-bundle"

In the process of this I also moved the locale directory where we stage
our .mo files to share/locale (which is much more logical).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2012-10-16 21:24:02 -07:00
parent 0d89d511bb
commit 04c5e65b8c
5 changed files with 42 additions and 24 deletions

14
macos.c
View file

@ -106,15 +106,13 @@ const char *subsurface_default_filename()
const char *subsurface_gettext_domainpath()
{
CFBundleRef mainBundle = CFBundleGetMainBundle();
CFURLRef localeURL = CFBundleCopyResourceURL(mainBundle, CFSTR("share/locale"), CFSTR(""), NULL);
if (localeURL) {
CFStringRef localePath = CFURLCopyFileSystemPath(localeURL, kCFURLPOSIXPathStyle);
CFStringEncoding encodingMethod = CFStringGetSystemEncoding();
const char *path = CFStringGetCStringPtr(localePath, encodingMethod);
return path;
static char buffer[256];
const char *resource_path = quartz_application_get_resource_path();
if (resource_path) {
snprintf(buffer, sizeof(buffer), "%s/share/locale", resource_path);
return buffer;
}
return "./locale";
return "./share/locale";
}
static void show_main_window(GtkWidget *w, gpointer data)