SUMMARY="A generic syntax highlighter" DESCRIPTION="It is a generic syntax highlighter for general use in all kinds \ of software such as forum systems, wikis or other applications that need to \ prettify source code. Highlights are: * a wide range of common languages and markup formats is supported * special attention is paid to details that increase highlighting quality * support for new languages and formats are added easily; most languages use a \ simple regex-based lexing mechanism * a number of output formats is available, among them HTML, RTF, LaTeX and \ ANSI sequences * it is usable as a command-line tool and as a library * ... and it highlights even Brainf*ck!" HOMEPAGE="https://pygments.org/" COPYRIGHT="2006-2023 by the Pygments team" LICENSE="BSD (2-clause)" REVISION="5" SOURCE_URI="https://pypi.org/packages/source/P/Pygments/Pygments-$portVersion.tar.gz" CHECKSUM_SHA256="b3ed06a9e8ac9a9aae5a6f5dbe78a8a58655d17b43b93c078f094ddc476ae297" SOURCE_DIR="Pygments-$portVersion" ARCHITECTURES="any" PROVIDES=" $portName = $portVersion " REQUIRES=" haiku " BUILD_REQUIRES=" haiku_devel " # Add more versions here as necessary: PYTHON_VERSIONS=(3.10) # And don't forget to change this if the default Python version on Haiku changes: defaultVersion=3.10 for pythonVersion in ${PYTHON_VERSIONS[@]}; do pythonPackage=python${pythonVersion//.} eval "PROVIDES_$pythonPackage=\" ${portName}_$pythonPackage = $portVersion cmd:pygmentize_$pythonVersion = $portVersion \"" if [ $pythonVersion = $defaultVersion ]; then eval "PROVIDES_$pythonPackage+=\" cmd:pygmentize = $portVersion \"" fi eval "REQUIRES_$pythonPackage=\" $REQUIRES cmd:python$pythonVersion \"" BUILD_REQUIRES+=" setuptools_$pythonPackage " BUILD_PREREQUIRES+=" cmd:python$pythonVersion " done INSTALL() { for pythonVersion in ${PYTHON_VERSIONS[@]}; do pythonPackage=python${pythonVersion//.} python=python$pythonVersion installLocation=$prefix/lib/$python/vendor-packages/ export PYTHONPATH=$installLocation:$PYTHONPATH mkdir -p $installLocation rm -rf build $python setup.py build install \ --root=/ --prefix=$prefix mkdir -p $manDir/man1 cp doc/pygmentize.1 $manDir/man1 # Version suffix all the scripts for f in $binDir/*; do mv $f $f-$pythonVersion done # And provide suffix-less symlinks for the default version if [ $pythonVersion = $defaultVersion ]; then for f in $binDir/*; do ln -sr $f ${f%-$pythonVersion} done fi packageEntries $pythonPackage \ $prefix/lib/python* \ $binDir \ $manDir done }