summaryrefslogtreecommitdiff
path: root/dev-cpp/ctemplate
diff options
context:
space:
mode:
Diffstat (limited to 'dev-cpp/ctemplate')
-rw-r--r--dev-cpp/ctemplate/Manifest1
-rw-r--r--dev-cpp/ctemplate/ctemplate-2.4.ebuild85
-rw-r--r--dev-cpp/ctemplate/files/70ctemplate-gentoo.el5
-rw-r--r--dev-cpp/ctemplate/files/ctemplate-2.4-fix_cxx20.patch14
-rw-r--r--dev-cpp/ctemplate/metadata.xml5
5 files changed, 110 insertions, 0 deletions
diff --git a/dev-cpp/ctemplate/Manifest b/dev-cpp/ctemplate/Manifest
new file mode 100644
index 000000000000..2f6b74dd23a9
--- /dev/null
+++ b/dev-cpp/ctemplate/Manifest
@@ -0,0 +1 @@
+DIST ctemplate-2.4.tar.gz 391923 BLAKE2B 96b585ed6ca323fc461857e1f2f381e0ca5c229d8c6039c24efcf34fb9ddf45cc36bef141af337e591e1cdd95ca510ea5ba1e539554322c578c25187b1906195 SHA512 4955489e7327bce18802d50fd9dfc8ac12af685e556d1c9d0eb2b7a2f4a9b6086e30be8388d694ec8912623738973d0c76e9ca97196c63c139ee5b468d4858b7
diff --git a/dev-cpp/ctemplate/ctemplate-2.4.ebuild b/dev-cpp/ctemplate/ctemplate-2.4.ebuild
new file mode 100644
index 000000000000..2003dc973edd
--- /dev/null
+++ b/dev-cpp/ctemplate/ctemplate-2.4.ebuild
@@ -0,0 +1,85 @@
+# Copyright 1999-2026 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{13..14} )
+
+inherit autotools elisp-common flag-o-matic python-any-r1
+
+DESCRIPTION="A simple but powerful template language for C++"
+HOMEPAGE="https://github.com/olafvdspek/ctemplate"
+SRC_URI="https://github.com/OlafvdSpek/ctemplate/archive/${P}.tar.gz"
+S="${WORKDIR}/ctemplate-${P}"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="amd64 arm ppc x86"
+IUSE="doc emacs vim-syntax static-libs test"
+
+BDEPEND="${PYTHON_DEPS}"
+RDEPEND="
+ emacs? ( >=app-editors/emacs-23.1:* )
+ vim-syntax? ( >=app-editors/vim-core-7 )"
+
+SITEFILE="70ctemplate-gentoo.el"
+
+# Some tests are broken in 2.3
+RESTRICT="test"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-fix_cxx20.patch
+)
+
+src_prepare() {
+ default
+ eautoreconf
+}
+
+src_configure() {
+ # -Werror=odr
+ # https://bugs.gentoo.org/924637
+ # https://github.com/OlafvdSpek/ctemplate/issues/157
+ filter-lto
+
+ econf $(use_enable static-libs static)
+}
+
+src_compile() {
+ default
+
+ if use emacs; then
+ elisp-compile contrib/tpl-mode.el
+ fi
+}
+
+src_install() {
+ default
+ if ! use doc; then
+ rm -r "${ED}"/usr/share/doc/${PF}/html || die
+ fi
+
+ if use vim-syntax; then
+ cd "${S}/contrib" || die
+ sh highlighting.vim || die "unpacking vim scripts failed"
+ insinto /usr/share/vim/vimfiles
+ doins -r .vim/.
+ fi
+
+ if use emacs; then
+ cd "${S}/contrib" || die
+ elisp-install ${PN} tpl-mode.el tpl-mode.elc
+ elisp-site-file-install "${FILESDIR}/${SITEFILE}"
+ fi
+
+ # package provides .pc files
+ find "${D}" -name '*.la' -delete || die
+}
+
+pkg_postinst() {
+ use emacs && elisp-site-regen
+}
+
+pkg_postrm() {
+ use emacs && elisp-site-regen
+}
diff --git a/dev-cpp/ctemplate/files/70ctemplate-gentoo.el b/dev-cpp/ctemplate/files/70ctemplate-gentoo.el
new file mode 100644
index 000000000000..110dd85c739b
--- /dev/null
+++ b/dev-cpp/ctemplate/files/70ctemplate-gentoo.el
@@ -0,0 +1,5 @@
+(add-to-list 'load-path "@SITELISP@")
+
+(setq auto-mode-alist (cons '("\\.tpl$" . tpl-mode) auto-mode-alist))
+(autoload 'tpl-mode "tpl-mode" "Major mode for editing CTemplate files." t)
+(add-hook 'tpl-mode-hook '(lambda () (font-lock-mode 1)))
diff --git a/dev-cpp/ctemplate/files/ctemplate-2.4-fix_cxx20.patch b/dev-cpp/ctemplate/files/ctemplate-2.4-fix_cxx20.patch
new file mode 100644
index 000000000000..a0adc59a8727
--- /dev/null
+++ b/dev-cpp/ctemplate/files/ctemplate-2.4-fix_cxx20.patch
@@ -0,0 +1,14 @@
+PR merged https://github.com/OlafvdSpek/ctemplate/pull/143.patch
+gcc-16/C++20, bug 967254, fix: remove hint, removed typedef
+--- a/src/base/arena-inl.h
++++ b/src/base/arena-inl.h
+@@ -93,8 +93,7 @@ template <class T, class C> class ArenaAllocator {
+ ArenaAllocator(C* arena) : arena_(arena) { } // NOLINT
+ ~ArenaAllocator() { }
+
+- pointer allocate(size_type n,
+- std::allocator<void>::const_pointer /*hint*/ = 0) {
++ pointer allocate(size_type n) {
+ assert(arena_ && "No arena to allocate from!");
+ return reinterpret_cast<T*>(arena_->AllocAligned(n * sizeof(T),
+ kAlignment));
diff --git a/dev-cpp/ctemplate/metadata.xml b/dev-cpp/ctemplate/metadata.xml
new file mode 100644
index 000000000000..5f33304011d5
--- /dev/null
+++ b/dev-cpp/ctemplate/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://docs.baldeagleos.com/dtd/metadata.dtd">
+<pkgmetadata>
+ <origin>baldeagleos-repo</origin>
+</pkgmetadata>