Building libfreenect with patched libusb under Mac OS X

Prerequisites

  • macports
  • The following installed macports:
    • git-core
    • cmake
    • libtool
    • libusb-devel

Get the sources

  • libfreenect:
    • git clone https://github.com/OpenKinect/libfreenect.git
  • libusb:
    • git clone git://git.libusb.org/libusb.git

Apply the patch and build libusb

  1. cd path/to/libusb
  2. ./autogen.sh
  3. patch -p1 < path/to/libfreenect/platform/osx/libusb-osx-kinect.diff
  4. ./configure LDFLAGS=’-framework IOKit -framework CoreFoundation’
  5. make
  6. sudo make install

Start building libfreenect

  1. cd path/to/libfreenect
  2. mkdir build
  3. cd build
  4. ccmake ..
      With the following changes:

    • LIBUSB_1_INCLUDE_DIR: /usr/local/include
    • LIBUSB_1_LIBRARY: /usr/local/lib/libusb-1.0.dylib
  5. press ‘c’ and afterwards ‘g’ to generate and exit
  6. cmake ..
  7. make
  8. sudo make install
Building libfreenect with patched libusb under Mac OS X

Lisp: Emacs Autocomplete

Integrate emacs autocomplete
Emacs Autocomplete provides dictionaries for many languages and inserts new words on the fly (with the correct settings).
Install it to .emacs.d and insert the following lines into your .emacs-file to enable it:

;; add .emacs.d to load path
(add-to-list 'load-path "~/.emacs.d")

;; enable autocomplete
(require 'auto-complete-config)
(add-to-list 'ac-dictionary-directories "~/.emacs.d/ac-dict")
(ac-config-default)
(global-auto-complete-mode t)
(auto-complete-mode t)

Lisp-specific autocomplete
Put ac-slime into your .emacs.d-folder and paste the following snippet into your .emacs-file:

;; add lisp autocomplete-support
(require 'ac-slime)
(add-hook 'slime-mode-hook 'set-up-slime-ac)

Global autocomplete
Globally enable autocomplete by pasting the following snippet into your .emacs-file:

(define-globalized-minor-mode real-global-auto-complete-mode
  auto-complete-mode (lambda ()
                       (if (not (minibufferp (current-buffer)))
                         (auto-complete-mode 1))))
(real-global-auto-complete-mode t)

Insert new words on the fly
Insert new words on the fly by pasting the following snippet into your .emacs-file:

;; create and add new words to the dictionary on the fly
(when (require 'auto-complete-config nil 'noerror)
(add-to-list 'ac-dictionary-directories "~/.emacs.d/ac-dict")
  (setq ac-comphist-file  "~/.emacs.d/ac-comphist.dat")
  (ac-config-default))
Lisp: Emacs Autocomplete

Emacs for Mac OS X adjustments

To use Emacs on Mac OS X you have to adjust some properties.

Map the alt and meta key
Go to “Emacs” – “Preferences” – “Environment” – “Ns : GNUstep/Mac OS X specific features” and change the following:

  • Ns Command Modifier” -> “meta
  • Ns Alternate Modifier” -> “No modifier

Now you can use your alt and meta keys as usual.

Change the background and mouse color

  • open your “~/.emacs
  • paste the following code snippet:
(setq default-frame-alist
    (append default-frame-alist
        '((foreground-color . "LawnGreen")
          (background-color . "Black")
          (cursor-color . "LawnGreen"))))
Emacs for Mac OS X adjustments