[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
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 (
GROUP_DIR=$HOME/texmacs
Shell]
T_HOMEBREW_DIR=$GROUP_DIR/homebrew
Shell]
T_TEXMACS_DIR=$GROUP_DIR/texmacs
Shell]
Shell]
These global variables should be executed manually every time you use this note.
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]
git@github.com:texmacs/homebrew.git
$T_HOMEBREW_DIR
[[ ! -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
Shell]
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
Shell]
brew tap cartr/qt4
brew tap-pin cartr/qt4
Shell]
brew install qt@4 # will link qt
Shell]
Shell]
/usr/local/Cellar/qt@4/4.8.7_6/bin/qmake
–version
Shell]
Sometimes, we need to keep both Qt 4 and Qt 5 installed by homebrew. To switch between Qt 4 and Qt 5:
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]
Shell]
If you have trouble on
Shell]
brew install qt
gs –version || brew install ghostscript
Shell]
Shell]
Please create PRs to update this note for any missing dependencies.
[[ ! -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
Shell]
Toggle the menu entry
sleep 2
Shell]
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.
cd $T_TEXMACS_DIR/build && make -j8
Shell]
ccache –version || brew install ccache
Shell]
cd $T_TEXMACS_DIR/build && make -j8
Shell]
As long as ccache is available, CMake will use it to boost the compilation.
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]
Shell]