Highlight documentation
Installation
Package contents
root of highlight-x.x | |-- examples/extras # examples for highlight scripting | |-- web_plugins # plugins for various web toolkits | |-- tcl # TCL extension | `-- swig # SWIG interface and sample code |-- gui_files # supporting files for the optional GUI | |-- ext # file open filter configuration | `-- l10n # GUI translations |-- langDefs # language definitions (*.lang) |-- man # man page |-- plugins # plug-in scripts (*.lua) |-- src # source code | |-- cli # command line interface code | |-- core # highlight core code (builds the library) | | |-- astyle # Artistic Style code | | `-- Diliculum # Diliculum code | `-- gui-qt # optional GUI code | `-- include # Header files | | |-- astyle # Artistic Style headers | | `-- Diliculum # Diliculum headers `-- themes # color themes (*.theme) AUTHORS # contributors of code and patches ChangeLog.adoc # list of changes COPYING # license filetypes.conf # file type extension configuration highlight.desktop # desktop integration of optional GUI highlight-langs2adoc.sh # script for Gitlab documentation INSTALL # this file makefile # basic makefile README.adoc # user manual README_DE.adoc # German user manual README_LANGLIST.adoc # list of Supported Languages README_PLUGINS.adoc # plug-in manual README_REGEX.adoc # regular expression manual README_RELEASE.adoc # release todo list README_TESTCASES.adoc # test case manual
Dependencies
In order to compile highlight, you need to install Lua5.x (devel package) and Boost (at least the header files).
The optional GUI requires Qt.
Installation of the source package
- tar xjf highlight-x.x-x.tar.bz2
- cd highlight-x.x-x
- make help
- make
make gui (optional, to compile the Qt GUI) - make install
(depending on your installation destination, you need to be root) - make clean (optional)
Highlight's default data directory is /usr/share/highlight.
You may alter this directory at compile time or at run time:
- See the makefile how to add a compiler directive which defines an installation directory (data_dir variable)
- See the makefile to change the configuration file directory (conf_dir variable)
- See section Config file search for run time options
MacOS X - Lazy pointer issue
Stripping the highlight binary causes program termination at runtime:
dyld: lazy symbol binding failed: lazy pointer not found dyld: lazy pointer not found Trace/BPT trap
To avoid this issue, edit the makefile to not strip the binary after linkage (see src/makefile, LDFLAGS variable).
Parse error at "std" - issue on Linux
When compiling the Qt interface this pops up:
usr/include/c++/6.1.1/bits/stl_relops.:67: Parse error at "std"
Delete src/gui-qt/.qmake.stash
and recompile.
Static linking (to run highlight as service)
If highlight cannot be run as service because of shared linkage, link it with the -static option (see src/makefile, LDFLAGS variable).
Linux Mint
There is a system script called highlight which is located in a preferenced path:
mintsystem provides: /usr/local/bin/highlight highlight provides: /usr/bin/highlight See bug tracker items: https://bugs.launchpad.net/linuxmint/+bug/593583 and https://bugs.launchpad.net/linuxmint/+bug/815005
Installation instructions for Windows
Start setup program and follow the instructions.
Windows with disabled ShortPaths in NTFS (8dot3name)
In and output of paths with UTF16 sequences is currently only supported using Short Paths (more information).
Compilation instructions for Windows
MingW and Qt toolchain
a) Install Qt Creator IDE (www.qt.io) b) Install MingW (gcc toolchain) -Download Online-Installer: -Start msys2.exe and execute "pacman -S mingw-w64-x86_64-gcc mingw-w64-i686-gcc" (the second package installs the 32 Bit compiler) -Add bin (i.e. F:\msys2\mingw32\bin )directory of the downloaded files to the system PATH -open cmd.exe and type "g++ --version" to check c) Compile Qt (updated in June 2020): -Install git, Python and Perl for Windows -If you install Strawberry Perl, remove its g++ compiler path from your system PATH -Open cmd.exe and change into a directory "QT-ROOT" which will contain the Qt sources -Execute the following cmds git clone git://code.qt.io/qt/qt5.git cd qt5 git checkout 5.15.0 perl init-repository -Configure Qt. Create new directories qt-build and qt-5.15.0-x64 in QT-ROOT. Change into qt-build and run ..\qt5\configure -release -opensource -confirm-license -static -static-runtime -optimize-size -no-pch \ -no-fontconfig -no-freetype -qt-libpng -qt-libjpeg -no-tiff -nomake examples -nomake tools \ -nomake tests -skip webengine -skip qtlocation -opengl desktop -prefix "F:\QT-ROOT\qt-5.15.0-x64" -Compile Qt (set numbers of CPU cores after -j): mingw32-make -j8 -Install the tools and libs in qt-5.15.0-x64: mingw32-make -j8 install d) Add compiler (location of Mingw/bin/c++.exe ) and Qt paths (location of qmake.exe in qt-5.15.0-x64/bin) in QtCreator e) Install Boost -Download and extract package of boost.org (no compilation needed) f) Compile Lua -Download the source package -Open QtCreator and create a new Project ("without Qt") -Import all c files of the Lua package except lua.c and luac.c -Edit the project file like this: TEMPLATE = lib CONFIG += console CONFIG -= app_bundle CONFIG -= qt DEFINES -= UNICODE SOURCES += $$files(../lua-5.3.0/src/*.c) SOURCES -= ../lua-5.3.0/src/lua.c ../lua-5.3.0/src/luac.c -Compile the Lua library g) Install upx h) Open the pro files in src/w32-projects and src/gui-qt in QtCreator and adjust the paths of libraries and tools. Assign the kit config to the projects. Compile the lib project first. i) (Not needed with applied -static-libgcc and -static-libstdc++ flags:) Ship highlight with libgcc_s_dw2-1.dll (32 bit) libgcc_s_seh-1.dll (64 bit) libstdc++-6.dll libwinpthread-1.dll (these are located in the mingw32 installation).
MSVC toolchain
See this project for an automated build process using MSCV and MSYS.
Known distribution issues
Linux Mint
There is a system script called highlight which is located in a preferenced path:
mintsystem provides: /usr/local/bin/highlight highlight provides: /usr/bin/highlight
Calling this script with the true highlight command line options will have no effect.
See bug tracker items: https://bugs.launchpad.net/linuxmint/+bug/593583 and
https://bugs.launchpad.net/linuxmint/+bug/815005
OpenSUSE Leap 42.2
The lua-devel package installation causes error messages.
Workaround: ignore dependency conflict.
MacOS X - Brew Paket ignoriert neue filetypes.conf
Sollten Syntaxendungen wie js, coffee, rs nicht mehr erkannt werden, ist evtl. die filetypes.conf veraltet.
Sie wird wie folgt aktualisiert:
cd $(brew --prefix)/etc/highlight mv filetypes.conf filetypes.conf.bak mv filetypes.conf.default filetypes.conf