[main]Notes on TeXmacs
Here is a detailed guide to build GNU TeXmacs using CMake and Homebrew.
Homebrew is a package manger for macOS. Typically, we install Homebrew first, and then use the brew command line to install build tools and dependencies to build TeXmacs.
Xcode Command Line Tools provide the C/C++ compiler. It is required.
TeXmacs can not be built without a C/C++ compiler. And TeXmacs is
designed to be customizable using Scheme. If you want to be a power user
of TeXmacs but not want to compile TeXmacs, please browse the built-in
documents under
The rest part of this guide is maintained in a Shell session (
Shell] | GROUP_DIR=$HOME/texmacs |
Shell] | T_HOMEBREW_DIR=$GROUP_DIR/homebrew |
Shell] | T_TEXMACS_DIR=$GROUP_DIR/texmacs |
Shell] |
These global variables should be executed manually every time you use this note.
Shell] |
brew --version |
Shell] |
Shell] |
$(xcode-select --print-path)/usr/bin/cc --version |
Shell] |
Shell] |
cmake --version || brew install cmake |
Shell] |
Shell] |
[[ -d "$T_HOMEBREW_DIR" ]] && echo "texmacs/homebrew is cloned" || echo "Please clone texmacs/homebrew first" |
Shell] |
[[ ! -d $T_HOMEBREW_DIR ]] && git clone |
Shell] | [[ ! -d $T_HOMEBREW_DIR ]] && git clone https://github.com/texmacs/guile.git $T_HOMEBREW_DIR |
Shell] |
[[ -d $T_HOMEBREW_DIR ]] && echo "texmacs/homebrew is cloned" |
Shell] |
Shell] | cd $T_HOMEBREW_DIR && brew install guile@1.8.rb |
For GNU TeXmacs 1.99.15, please use Qt 4 if you want to build and package TeXmacs by yourself. Qt 4 has been removed in the official homebrew repo. We need extra steps to install Qt 4 via brew:
Shell] |
brew tap cartr/qt4 |
Shell] | brew tap-pin cartr/qt4 |
Shell] |
brew install qt@4 # will link qt |
Shell] |
|
Shell] |
Sometimes, we need to keep both Qt 4 and Qt 5 installed by homebrew. To switch between Qt 4 and Qt 5:
Shell] |
qmake --version |
Shell] |
brew unlink qt@4 && brew link qt --force |
Shell] |
qmake --version |
Shell] |
brew unlink qt && brew link qt@4 |
Shell] |
qmake --version |
Shell] |
If you have trouble on brew link qt –force and brew unlink qt. Make sure that you have installed Qt before using homebrew:
Shell] |
brew install qt |
Shell] |
gs --version || brew install ghostscript |
Shell] |
Please create PRs to update this note for any missing dependencies.
Shell] | [[ ! -d $T_TEXMACS_DIR ]] && git clone git@github.com:texmacs/texmacs.git $T_TEXMACS_DIR |
Shell] | mkdir -p $T_TEXMACS_DIR/build |
Shell] |
cd $T_TEXMACS_DIR/build && cmake -DQT_QMAKE_EXECUTABLE=/usr/local/Cellar/qt@4/4.8.7_6/bin/qmake -DCMAKE_INSTALL_PREFIX=./TeXmacs.app/Contents/Resources .. |
Shell] | cd $T_TEXMACS_DIR/build && make -j8 install |
Toggle the menu entry
Shell] |
sleep 2 |
Shell] |
Execute the sleep command, and you will find the timings are listed on the right side.
Compile TeXmacs without or with ccache, the elapse time should be reduced with ccache.
Shell] | cd $T_TEXMACS_DIR/build && make -j8 |
Shell] |
ccache --version || brew install ccache |
Shell] | cd $T_TEXMACS_DIR/build && make -j8 |
As long as ccache is available, CMake will use it to boost the compilation.
Shell] | cd $T_TEXMACS_DIR/build && ctest |
Shell] |
Shell] |
$T_TEXMACS_DIR/build/TeXmacs.app/Contents/MacOS/TeXmacs --version |
Shell] |
$T_TEXMACS_DIR/build/TeXmacs.app/Contents/MacOS/TeXmacs --help |
Shell] |
Shell] | open $T_TEXMACS_DIR/build # click the app to test it as a user |
Shell] |