[code] [textadept] building on OSX 10.8

From: John Benediktsson <mrjbq7.att.gmail.com>
Date: Tue, 2 Apr 2013 12:36:35 -0700

Hi Mitchell,

I successfully built Textadept on OSX, using the legacy instructions
(modified a little bit). I hope you don't mind me posting my build steps
in case it is useful for others (also they vary slightly from what is
posted on your website).

### follow http://foicica.com/wiki/building-textadept-from-hg

$ wget http://foicica.com/textadept/download/textadept_6.5.src.zip
$ unzip textadept_6.5.src.zip
$ hg clone http://foicica.com/hg/textadept
$ cd textadept/src
$ cp -r textadept_6.5.src/src/{scintilla,lua,luajit,cdk,termkey} .
$ hg clone http://foicica.com/hg/gtdialog
$ cd ..
$ hg clone http://foicica.com/hg/scintillua lexers
$ cp lexers/lexers/*.lua lexers/
$ cp lexers/LexLPeg.cxx src/

### install jhbuild

$ wget http://git.gnome.org/browse/gtk-osx/plain/gtk-osx-build-setup.sh
$ sh gtk-osx-build-setup.sh
# make sure .jhbuildrc-custom sets 'i386' in setup_sdk
$ jhbuild bootstrap
$ jhbuild build meta-gtk-osx-bootstrap
$ jhbuild build meta-gtk-osx-core
$ jhbuild build meta-gtk-osx-themes
$ jhbuild build meta-gtk-osx-gtkmm # C++ support

### fix textadept/src/textadept.c references to old gtkosx names

```
diff -r b22718c8199d src/textadept.c
--- a/src/textadept.c Sun Mar 31 18:15:36 2013 -0400
+++ b/src/textadept.c Tue Apr 02 12:30:48 2013 -0700
@@ -73,7 +73,7 @@
 static GtkWidget *window, *menubar, *statusbar[2];
 static GtkAccelGroup *accel;
 #if (__APPLE__ && !NCURSES)
-static GtkOSXApplication *osxapp;
+static GtkosxApplication *osxapp;
 #endif
 #endif
 static void new_buffer(sptr_t);
@@ -963,7 +963,7 @@
     gtk_box_reorder_child(GTK_BOX(vbox), new_menubar, 0);
     gtk_widget_show_all(new_menubar);
 #if (__APPLE__ && !NCURSES)
- gtk_osxapplication_set_menu_bar(osxapp, GTK_MENU_SHELL(new_menubar));
+ gtkosx_application_set_menu_bar(osxapp, GTK_MENU_SHELL(new_menubar));
     gtk_widget_hide(new_menubar);
 #endif
 #endif
@@ -1693,7 +1693,7 @@
  * Signal for opening files from OSX.
  * Generates an 'appleevent_odoc' event for each document sent.
  */
-static int w_open_osx(GtkOSXApplication*_, char *path, void*__) {
+static int w_open_osx(GtkosxApplication*_, char *path, void*__) {
   return (lL_event(lua, "appleevent_odoc", LUA_TSTRING, path, -1), TRUE);
 }

@@ -1701,7 +1701,7 @@
  * Signal for block terminating Textadept from OSX.
  * Generates a 'quit' event.
  */
-static int w_exit_osx(GtkOSXApplication*_, void*__) {
+static int w_exit_osx(GtkosxApplication*_, void*__) {
   return !lL_event(lua, "quit", -1);
 }

@@ -1710,7 +1710,7 @@
  * Closes the Lua state and releases resources.
  * @see l_close
  */
-static void w_quit_osx(GtkOSXApplication*_, void*__) {
+static void w_quit_osx(GtkosxApplication*_, void*__) {
   l_close(lua);
   scintilla_release_resources();
   g_object_unref(osxapp);
@@ -2129,7 +2129,7 @@
   accel = gtk_accel_group_new();

 #if (__APPLE__ && !NCURSES)
- gtk_osxapplication_set_use_quartz_accelerators(osxapp, FALSE);
+ gtkosx_application_set_use_quartz_accelerators(osxapp, FALSE);
   osx_signal(osxapp, "NSApplicationOpenFile", w_open_osx);
   osx_signal(osxapp, "NSApplicationBlockTermination", w_exit_osx);
   osx_signal(osxapp, "NSApplicationWillTerminate", w_quit_osx);
@@ -2231,8 +2231,8 @@
   GetModuleFileName(0, textadept_home, FILENAME_MAX);
   if ((last_slash = strrchr(textadept_home, '\\'))) *last_slash = '\0';
 #elif (__APPLE__ && !NCURSES)
- osxapp = g_object_new(GTK_TYPE_OSX_APPLICATION, NULL);
- char *path = quartz_application_get_resource_path();
+ osxapp = g_object_new(GTKOSX_TYPE_APPLICATION, NULL);
+ char *path = gtkosx_application_get_resource_path();
   textadept_home = g_filename_from_utf8((const char *)path, -1, NULL, NULL,
                                         NULL);
   g_free(path);
@@ -2272,7 +2272,7 @@
   new_window();
   lL_dofile(lua, "init.lua");
 #if (__APPLE__ && !NCURSES)
- gtk_osxapplication_ready(osxapp);
+ gtkosx_application_ready(osxapp);
 #endif

 #if GTK
```

### update text adept/src/Makefile

# uncomment darwin section in textadept/src/Makefile
$ ln -sf ~/gtk/inst textadept/src/gtkosx
$ ln -sf Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer
/Developer
# change -mmacosx-version-min to 10.8
# change -isysroot to /Developer/SDKs/MacOSX10.8.sdk
# add -lgmodule-2.0 to LDFLAGS

-- 
You are subscribed to code.att.foicica.com.
To change subscription settings, send an e-mail to code+help.att.foicica.com.
To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
Received on Tue 02 Apr 2013 - 15:36:35 EDT

This archive was generated by hypermail 2.2.0 : Wed 03 Apr 2013 - 06:38:39 EDT