text processing utilities

Highlight Dokumentation

Installation

Paket-Inhalt

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

Abhängigkeiten

Zum Kompilieren werden Lua5.x (devel-Paket) und die Boost-Header benötigt.
Die optionale GUI benötigt Qt.

Kompilierung und Installation

  1. tar xjf highlight-x.x-x.tar.bz2
  2. cd highlight-x.x-x
  3. make help
  4. make
    make gui (optional, zum Kompilieren der Qt GUI)
  5. make install
    (Je nach Installationsziel sind root-Rechte nötig)
  6. make clean (optional)

Das Standard-Installationsverzeichnis von highlight ist /usr/share/highlight.
Sie können das Verzeichnis zur Kompilier- oder zur Laufzeit ändern:

MacOS X - Lazy pointer Problem

Wenn das highlight Binary gestrippt wird, erscheint dieser Fehler beim Start:

dyld: lazy symbol binding failed: lazy pointer not found
dyld: lazy pointer not found
Trace/BPT trap

Um den Abbruch zu vermeiden, muss highlight ohne die -s (--strip) Option neu kompiliert werden (siehe src/makefile, LDFLAGS Variable).

Parse error at "std" - Problem unter Linux

Beim Kompilieren der Qt-Oberfläche erscheint dieser Fehler:

usr/include/c++/6.1.1/bits/stl_relops.:67: Parse error at "std"

Zur Behebung src/gui-qt/.qmake.stash löschen und erneut kompilieren.

Statisches Linken (um highlight als Service zu starten)

Wenn highlight nicht als Service gestartet werden kann, sollte es mit der -static Option gelinkt werden (siehe src/makefile, LDFLAGS Variable).

Linux Mint

Es gibt ein Systemskript names highlight welches in einem priorisierten Suchpfad liegt:

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 unter Windows

Setup-Programm starten und Anweisungen folgen.

Windows mit deaktivierten ShortPaths in NTFS (8dot3name)

Die Ein- und Ausgabe von Pfaden mit UTF16-Sequenzen wird nur mit ShortPaths unterstützt (mehr Infos).

Compilation instructions for Windows

MingW und 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
Tupel7