diff options
Diffstat (limited to 'app-text/highlight')
-rw-r--r-- | app-text/highlight/Manifest | 1 | ||||
-rw-r--r-- | app-text/highlight/highlight-4.1.ebuild | 103 |
2 files changed, 104 insertions, 0 deletions
diff --git a/app-text/highlight/Manifest b/app-text/highlight/Manifest index 769420aec1bd..1e45eded6ce1 100644 --- a/app-text/highlight/Manifest +++ b/app-text/highlight/Manifest @@ -1,2 +1,3 @@ DIST highlight-3.57.tar.bz2 1412857 BLAKE2B c0ee8189294feac3b5e8c6d356634d8074a8960f2010918de52f23515ad4a13626971e9106ecc6d2adbdb45e0ebb66ff60eb3cbe86d2449666e3424f1c0dc3a6 SHA512 a086f6b8c4a4fc0b6651d456b178350a6c59a32cd613451d81b53fe3294eb0f80d673cb64fb615ef91d6c4d4bbc8a57413aec2490d2a5ad67e695ec6e92b3d99 DIST highlight-3.60.tar.bz2 1412486 BLAKE2B 3651a44c7e492ce02de04d21ed2e25afb40e871e21eacef88416f98226046e99a2a0a27c3354119715f320df1653ad7065c1c9a4a23b3081971df4d72c6fa19c SHA512 e4d0822592675115c7c2121d6ed066f997d315fecea384caeb506de1933f6bd60fd0dea57dcdafba85465f9f6b922ed168db57ce725bd7f19689d30624412f1b +DIST highlight-4.1.tar.bz2 1469115 BLAKE2B 9ee4c61ea5ebdfd04c2bb341838cc66a755d5deb6dfb5d863d22dbb86be9b5d08999f22bb184053126bdaf8858777eb2ac504fed8998dc51bd6e1cd64f911ad8 SHA512 6e3ba72b2109f1b33fcebd1a426a8d4b3e12ee224b8a2069e7aab1391473594ccf9b35303bca5ca1339d2ce42bc6db2d16c1da7b1cdd451f5fabe672ca388731 diff --git a/app-text/highlight/highlight-4.1.ebuild b/app-text/highlight/highlight-4.1.ebuild new file mode 100644 index 000000000000..323a92ad3acc --- /dev/null +++ b/app-text/highlight/highlight-4.1.ebuild @@ -0,0 +1,103 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +LUA_COMPAT=( lua5-{1..3} ) + +inherit lua-single qmake-utils toolchain-funcs + +DESCRIPTION="Converts source code to formatted text (HTML, LaTeX, etc.) with syntax highlight" +HOMEPAGE="http://www.andre-simon.de/" +SRC_URI="http://www.andre-simon.de/zip/${P}.tar.bz2" + +LICENSE="GPL-3" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos" +IUSE="examples qt5" + +REQUIRED_USE="${LUA_REQUIRED_USE}" + +RDEPEND=" + ${LUA_DEPS} + qt5? ( + dev-qt/qtcore:5 + dev-qt/qtgui:5 + dev-qt/qtwidgets:5 + ) +" +DEPEND="${RDEPEND} + dev-libs/boost +" +BDEPEND=" + virtual/pkgconfig + qt5? ( dev-qt/linguist-tools:5 ) +" + +PATCHES=( + "${FILESDIR}"/${PN}-3.57-qt_libs_lua.patch +) + +myhlopts=( + "CXX=$(tc-getCXX)" + "AR=$(tc-getAR)" + "LDFLAGS=${LDFLAGS}" + "CFLAGS=${CXXFLAGS} -DNDEBUG -std=c++11" + "DESTDIR=${D}" + "PREFIX=${EPREFIX}/usr" + "HL_CONFIG_DIR=${EPREFIX}/etc/highlight/" + "HL_DATA_DIR=${EPREFIX}/usr/share/highlight/" + "doc_dir=${EPREFIX}/usr/share/doc/${PF}/" + "conf_dir=${EPREFIX}/etc/highlight/" +) + +src_prepare() { + default + + # disable man page compression + sed -e "/GZIP/d" -i makefile || die + + sed -e "/LSB_DOC_DIR/s:doc/${PN}:doc/${PF}:" \ + -i src/core/datadir.cpp || die + + sed -r -i \ + -e "/^LUA_.*pkg-config/s,\<lua\>,${ELUA},g" \ + "${S}"/extras/tcl/makefile \ + "${S}"/extras/swig/makefile \ + || die "Failed to set Lua implementation" + + # We set it via eqmake5, otherwise it forces clang... + sed -e "s/QMAKE_CC/#QMAKE_CC/g" \ + -e "s/QMAKE_CXX /#QMAKE_CXX /g" \ + -i src/gui-qt/highlight.pro || die +} + +src_configure() { + if use qt5 ; then + pushd src/gui-qt > /dev/null || die + eqmake5 \ + 'DEFINES+=DATA_DIR=\\\"'"${EPREFIX}"'/usr/share/${PN}/\\\" CONFIG_DIR=\\\"'"${EPREFIX}"'/etc/${PN}/\\\" DOC_DIR=\\\"'"${EPREFIX}"'/usr/share/doc/${PF}/\\\"' + popd > /dev/null || die + fi +} + +src_compile() { + emake -f makefile LUA_PKG_NAME="${ELUA}" "${myhlopts[@]}" + if use qt5 ; then + pushd src/gui-qt > /dev/null || die + emake + popd > /dev/null || die + fi +} + +src_install() { + emake -f makefile "${myhlopts[@]}" install + if use qt5; then + emake -f makefile "${myhlopts[@]}" install-gui + docompress -x /usr/share/doc/${PF}/{ChangeLog,COPYING,README,README_PLUGINS} + fi + + if ! use examples ; then + rm -r "${ED}"/usr/share/doc/${PF}/extras || die + fi +} |