← Back to textmate/textmate

How to Deploy & Use textmate/textmate

TextMate Deployment and Usage Guide

Prerequisites

To build and run TextMate, you need:

  • macOS 10.12 or later (TextMate is macOS-only)
  • Development tools: Command Line Tools for Xcode
  • Dependencies (install via Homebrew or MacPorts):
    • boost - portable C++ source libraries
    • capnp - Cap'n Proto serialization library
    • multimarkdown - marked-up plain text compiler
    • ninja - build system (alternative to make)
    • ragel - state machine compiler
    • sparsehash - cache-friendly hash map implementation

Installation

  1. Install dependencies using your preferred package manager:
# Using Homebrew
brew install boost capnp google-sparsehash multimarkdown ninja ragel

# Using MacPorts
sudo port install boost capnproto multimarkdown ninja ragel sparsehash
  1. Clone the repository with submodules:
git clone --recursive https://github.com/textmate/textmate.git
cd textmate

Configuration

No specific environment variables or API keys are required for building TextMate. However, for building from within TextMate itself, you need to configure the PATH variable:

  1. Set up PATH in TextMate preferences:

    • Go to PreferencesVariables
    • Add $PATH:/usr/local/bin to ensure ninja and related tools are accessible
  2. Install the Ninja bundle for building from within TextMate:

    • Install via PreferencesBundles
    • This enables ⌘B to build the project

Build & Run

Building from Terminal

# Configure and build
./configure && ninja TextMate/run

# Alternative: build and sign without launching
ninja TextMate

# Build and relaunch (with dialog confirmation)
ninja TextMate/run

Building from Within TextMate

  1. Ensure the Ninja bundle is installed
  2. Press ⌘B to build
  3. The default target is TextMate/run which will relaunch TextMate
  4. Session restore ensures unsaved changes are preserved

Build Targets

  • ninja TextMate - Build and sign TextMate
  • ninja TextMate/run - Build, sign, and relaunch TextMate
  • ninja -t clean - Clean build artifacts
  • Delete ~/build/TextMate to completely clean the build directory

Special Build Behavior

  • If editing a test file, the build target automatically changes to build the library containing that test
  • If editing files for an application target (other than TextMate.app), the target builds and runs that specific application

Deployment

TextMate is a desktop application for macOS and does not require traditional server deployment. For distribution:

  1. Local Development: Use the built-in build process described above
  2. Distribution: TextMate is distributed through its official website at macromates.com/download
  3. Code Signing: The build process includes code signing for distribution

Troubleshooting

Common Issues and Solutions

Dependency Not Found

  • Ensure all dependencies are installed via Homebrew or MacPorts
  • Verify installation with brew list or port installed
  • Check that tools are in your PATH

Build Fails with Missing Submodules

  • Make sure you cloned with --recursive flag
  • If you forgot, run: git submodule update --init --recursive

Cannot Build from Within TextMate

  • Verify the Ninja bundle is installed
  • Check PATH configuration in PreferencesVariables
  • Ensure ninja is accessible from Terminal

Relaunch Dialog Appears Unexpectedly

  • This is normal behavior when building from within TextMate
  • Session restore will preserve your work

Test Files Not Building Correctly

  • The build system automatically detects test files and adjusts targets
  • Ensure you're in the correct directory when building

Performance Issues During Build

  • Clean the build directory: ninja -t clean
  • Delete ~/build/TextMate and rebuild
  • Ensure sufficient disk space and memory

Getting Help