aboutsummaryrefslogtreecommitdiffhomepage
path: root/osx
diff options
context:
space:
mode:
Diffstat (limited to 'osx')
-rw-r--r--osx/Info.plist33
-rw-r--r--osx/launch_fish.scptbin0 -> 3982 bytes
-rw-r--r--osx/osx_config.h218
-rw-r--r--osx/osx_fish_launcher.m98
4 files changed, 349 insertions, 0 deletions
diff --git a/osx/Info.plist b/osx/Info.plist
new file mode 100644
index 00000000..dcce2c28
--- /dev/null
+++ b/osx/Info.plist
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDisplayName</key>
+ <string>fish shell</string>
+ <key>CFBundleExecutable</key>
+ <string>fish_launcher</string>
+ <key>CFBundleIconFile</key>
+ <string>fish.icns</string>
+ <key>CFBundleIdentifier</key>
+ <string>com.ridiculousfish.fish-shell</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>fish shell</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>2.0</string>
+ <key>CFBundleVersion</key>
+ <string>289.5</string>
+ <key>LSApplicationCategoryType</key>
+ <string>public.app-category.productivity</string>
+ <key>LSMinimumSystemVersion</key>
+ <string>10.6</string>
+ <key>NSHumanReadableCopyright</key>
+ <string>Copyright © 2012, ridiculous_fish
+All rights reserved.</string>
+ <key>LSUIElement</key>
+ <true/>
+</dict>
+</plist>
diff --git a/osx/launch_fish.scpt b/osx/launch_fish.scpt
new file mode 100644
index 00000000..0afefdb6
--- /dev/null
+++ b/osx/launch_fish.scpt
Binary files differ
diff --git a/osx/osx_config.h b/osx/osx_config.h
new file mode 100644
index 00000000..14207b37
--- /dev/null
+++ b/osx/osx_config.h
@@ -0,0 +1,218 @@
+/* config.h. Generated from config.h.in by configure. */
+/* config.h.in. Generated from configure.ac by autoheader. */
+
+/* Define to 1 if you have the `backtrace' function. */
+#define HAVE_BACKTRACE 1
+
+/* Define to 1 if you have the `backtrace_symbols' function. */
+#define HAVE_BACKTRACE_SYMBOLS 1
+
+/* del_curterm is broken, redefine it to a no-op to avoid a double-free bug */
+/* #undef HAVE_BROKEN_DEL_CURTERM */
+
+/* Define to 1 one if the implemented fwprintf is broken */
+/* #undef HAVE_BROKEN_FWPRINTF */
+
+/* Define to 1 if you have the <curses.h> header file. */
+#define HAVE_CURSES_H 1
+
+/* Define to 1 if you have the `dcgettext' function. */
+/* #undef HAVE_DCGETTEXT */
+
+/* Define to 1 if you have the <execinfo.h> header file. */
+#define HAVE_EXECINFO_H 1
+
+/* Define to 1 if you have the `fgetwc' function. */
+#define HAVE_FGETWC 1
+
+/* Define to 1 if you have the `fputwc' function. */
+#define HAVE_FPUTWC 1
+
+/* Define to 1 if you have the `futimes' function. */
+#define HAVE_FUTIMES 1
+
+/* Define to 1 if you have the `fwprintf' function. */
+#define HAVE_FWPRINTF 1
+
+/* Define to 1 if you have the <getopt.h> header file. */
+#define HAVE_GETOPT_H 1
+
+/* Define to 1 if you have the `gettext' function. */
+/* #undef HAVE_GETTEXT */
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#define HAVE_INTTYPES_H 1
+
+/* Define to 1 if you have the `killpg' function. */
+#define HAVE_KILLPG 1
+
+/* Define to 1 if you have the <libintl.h> header file. */
+/* #undef HAVE_LIBINTL_H */
+
+/* Define to 1 if you have the `lrand48_r' function. */
+/* #undef HAVE_LRAND48_R */
+
+/* Define to 1 if you have the <memory.h> header file. */
+#define HAVE_MEMORY_H 1
+
+/* Define to 1 if you have the nan function */
+#define HAVE_NAN 1
+
+/* Define to 1 if you have the <ncurses.h> header file. */
+#define HAVE_NCURSES_H 1
+
+/* Define to 1 if you have the <ncurses/term.h> header file. */
+/* #undef HAVE_NCURSES_TERM_H */
+
+/* Define to 1 if realpath accepts null for its second argument. */
+#define HAVE_REALPATH_NULL 1
+
+/* Define to 1 if you have the <regex.h> header file. */
+#define HAVE_REGEX_H 1
+
+/* Define to 1 if you have the <siginfo.h> header file. */
+/* #undef HAVE_SIGINFO_H */
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#define HAVE_STDINT_H 1
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+#define HAVE_STRINGS_H 1
+
+/* Define to 1 if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define to 1 if you have the <stropts.h> header file. */
+/* #undef HAVE_STROPTS_H */
+
+/* Define to 1 if you have the `sysconf' function. */
+#define HAVE_SYSCONF 1
+
+/* Define to 1 if you have the <sys/ioctl.h> header file. */
+#define HAVE_SYS_IOCTL_H 1
+
+/* Define to 1 if you have the <sys/resource.h> header file. */
+#define HAVE_SYS_RESOURCE_H 1
+
+/* Define to 1 if you have the <sys/select.h> header file. */
+#define HAVE_SYS_SELECT_H 1
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/termios.h> header file. */
+#define HAVE_SYS_TERMIOS_H 1
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if you have the <termio.h> header file. */
+/* #undef HAVE_TERMIO_H */
+
+/* Define to 1 if you have the <term.h> header file. */
+#define HAVE_TERM_H 1
+
+/* Define to 1 if the wgettext function should be used for translating
+ strings. */
+#define HAVE_TRANSLATE_H 1
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#define HAVE_UNISTD_H 1
+
+/* Define to 1 if you have the `wcscasecmp' function. */
+#define HAVE_WCSCASECMP 1
+
+/* Define to 1 if you have the `wcsdup' function. */
+#define HAVE_WCSDUP 1
+
+/* Define to 1 if you have the `wcslcat' function. */
+#define HAVE_WCSLCAT 1
+
+/* Define to 1 if you have the `wcslcpy' function. */
+#define HAVE_WCSLCPY 1
+
+/* Define to 1 if you have the `wcslen' function. */
+#define HAVE_WCSLEN 1
+
+/* Define to 1 if you have the `wcsncasecmp' function. */
+#define HAVE_WCSNCASECMP 1
+
+/* Define to 1 if you have the `wcsndup' function. */
+/* #undef HAVE_WCSNDUP */
+
+/* Define to 1 if you have the `wcstok' function. */
+#define HAVE_WCSTOK 1
+
+/* Define to 1 if you have the `wcstol' function. */
+#define HAVE_WCSTOL 1
+
+/* Define to 1 if you have the `wcswidth' function. */
+#define HAVE_WCSWIDTH 1
+
+/* Define to 1 if you have the `wcwidth' function. */
+#define HAVE_WCWIDTH 1
+
+/* Define to 1 if the winsize struct and TIOCGWINSZ macro exist */
+#define HAVE_WINSIZE 1
+
+/* Define to 1 if getopt_long exists and works. */
+#define HAVE_WORKING_GETOPT_LONG 1
+
+/* Define to 1 if the _nl_msg_cat_cntr symbol is exported. */
+/* #undef HAVE__NL_MSG_CAT_CNTR */
+
+/* Define to 1 if you have the file `/proc/self/stat'. */
+/* #undef HAVE__PROC_SELF_STAT */
+
+/* Define to 1 if the __environ symbol is exported. */
+/* #undef HAVE___ENVIRON */
+
+/* Define to the address where bug reports for this package should be sent. */
+#define PACKAGE_BUGREPORT "fish-users@lists.sf.net"
+
+/* Define to the full name of this package. */
+#define PACKAGE_NAME "fish"
+
+/* Define to the full name and version of this package. */
+#define PACKAGE_STRING "fish 2.0.0"
+
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME "fish"
+
+/* Define to the home page for this package. */
+#define PACKAGE_URL ""
+
+/* Define to the version of this package. */
+#define PACKAGE_VERSION "2.0.0"
+
+/* Define to 1 if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Define to 1 if tparm accepts a fixed amount of paramters. */
+/* #undef TPARM_SOLARIS_KLUDGE */
+
+/* Evil kludge to get Power based machines to work */
+/* #undef TPUTS_KLUDGE */
+
+/* Perform string translations with gettext */
+#define USE_GETTEXT 1
+
+/* Macro to enable additional prototypes under BSD */
+/* #undef _NETBSD_SOURCE */
+
+/* Macro to enable additional prototypes under BSD */
+/* #undef __BSD_VISIBLE */
+
+/* Macro to enable additional prototypes under Solaris */
+/* #undef __EXTENSIONS__ */
+
+#if __GNUC__ >= 3
+#define __warn_unused __attribute__ ((warn_unused_result))
+#define __sentinel __attribute__ ((sentinel))
+#else
+#define __warn_unused
+#define __sentinel
+#endif
diff --git a/osx/osx_fish_launcher.m b/osx/osx_fish_launcher.m
new file mode 100644
index 00000000..8b24d2ec
--- /dev/null
+++ b/osx/osx_fish_launcher.m
@@ -0,0 +1,98 @@
+#import <Foundation/Foundation.h>
+#import <CoreServices/CoreServices.h>
+#import <Carbon/Carbon.h>
+#import <stdlib.h>
+#import <stdio.h>
+#import <unistd.h>
+#import <errno.h>
+#import <sys/types.h>
+#import <sys/stat.h>
+
+
+// The path to the command file, which we'll delete on death (if it exists)
+static char s_command_path[PATH_MAX];
+
+static void die(const char *format, ...) {
+ va_list ap;
+ va_start(ap, format);
+ vfprintf(stderr, format, ap);
+ va_end(ap);
+ fputc('\n', stderr);
+
+ if (s_command_path[0] != '\0') {
+ unlink(s_command_path);
+ }
+
+ exit(EXIT_FAILURE);
+}
+
+static void launch_fish_with_applescript(NSString *fish_binary_path)
+{
+ // load the script from a resource by fetching its URL from within our bundle
+ NSString *path = [[NSBundle mainBundle] pathForResource:@"launch_fish" ofType:@"scpt"];
+ if (! path) die("Couldn't get path to launch_fish.scpt");
+
+ NSURL *url = [NSURL fileURLWithPath:path isDirectory:NO];
+ if (! url) die("Couldn't get URL to launch_fish.scpt");
+
+ NSDictionary *errors = nil;
+ NSAppleScript *appleScript = [[NSAppleScript alloc] initWithContentsOfURL:url error:&errors];
+ if (! appleScript) die("Couldn't load AppleScript");
+
+ // create the first parameter
+ NSAppleEventDescriptor *firstParameter =
+ [NSAppleEventDescriptor descriptorWithString:fish_binary_path];
+
+ // create and populate the list of parameters (in our case just one)
+ NSAppleEventDescriptor *parameters = [NSAppleEventDescriptor listDescriptor];
+ [parameters insertDescriptor:firstParameter atIndex:1];
+
+ // create the AppleEvent target
+ ProcessSerialNumber psn = {0, kCurrentProcess};
+ NSAppleEventDescriptor *target =
+ [NSAppleEventDescriptor
+ descriptorWithDescriptorType:typeProcessSerialNumber
+ bytes:&psn
+ length:sizeof(ProcessSerialNumber)];
+
+ // create an NSAppleEventDescriptor with the script's method name to call,
+ // this is used for the script statement: "on show_message(user_message)"
+ // Note that the routine name must be in lower case.
+ NSAppleEventDescriptor *handler = [NSAppleEventDescriptor descriptorWithString:
+ [@"launch_fish" lowercaseString]];
+
+ // create the event for an AppleScript subroutine,
+ // set the method name and the list of parameters
+ NSAppleEventDescriptor *event =
+ [NSAppleEventDescriptor appleEventWithEventClass:kASAppleScriptSuite
+ eventID:kASSubroutineEvent
+ targetDescriptor:target
+ returnID:kAutoGenerateReturnID
+ transactionID:kAnyTransactionID];
+ [event setParamDescriptor:handler forKeyword:keyASSubroutineName];
+ [event setParamDescriptor:parameters forKeyword:keyDirectObject];
+
+ // call the event in AppleScript
+ if (![appleScript executeAppleEvent:event error:&errors])
+ {
+ // report any errors from 'errors'
+ NSLog(@"Oops: %@", errors);
+ }
+
+ [appleScript release];
+}
+
+/* This approach asks Terminal to open a script that we control */
+int main(void) {
+ [[NSAutoreleasePool alloc] init];
+
+ /* Get the fish executable. Make sure it's absolute. */
+ NSURL *fish_executable = [[NSBundle mainBundle] URLForResource:@"fish" withExtension:@"" subdirectory:@"base/bin"];
+ if (! fish_executable)
+ die("Could not find fish executable in bundle");
+
+ launch_fish_with_applescript([fish_executable path]);
+
+ /* If we succeeded, it will clean itself up */
+ return 0;
+}