summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2024-01-18 15:38:18 +0100
committerMichał Górny <mgorny@gentoo.org>2024-01-19 15:44:10 +0100
commita4812e4fa1b8c635e6ae28ddbf73fd6331b6051e (patch)
tree6fb8a969dbae6e4031772b4d1e87da048399073d /dev-debug/duma
parentMove {dev-util → dev-debug}/d-spy (diff)
downloadgentoo-a4812e4fa1b8c635e6ae28ddbf73fd6331b6051e.tar.gz
gentoo-a4812e4fa1b8c635e6ae28ddbf73fd6331b6051e.tar.bz2
gentoo-a4812e4fa1b8c635e6ae28ddbf73fd6331b6051e.zip
Move {dev-util → dev-debug}/duma
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'dev-debug/duma')
-rw-r--r--dev-debug/duma/Manifest2
-rw-r--r--dev-debug/duma/duma-2.5.15-r2.ebuild88
-rw-r--r--dev-debug/duma/files/duma-2.5.15-gcc6.patch22
-rw-r--r--dev-debug/duma/metadata.xml16
4 files changed, 128 insertions, 0 deletions
diff --git a/dev-debug/duma/Manifest b/dev-debug/duma/Manifest
new file mode 100644
index 000000000000..365fed56aa9b
--- /dev/null
+++ b/dev-debug/duma/Manifest
@@ -0,0 +1,2 @@
+DIST duma-2.5.15-GNUmakefile.patch.bz2 4618 BLAKE2B 506127ce1f8f3d01d0443ab1240c585aa734bf3756ae632ccec8ff88f33fc0ffc5113705d5c3c31c14bf52a2cf3c82132669c2c14d24f0c6df17b8e802c8ef40 SHA512 6d83294897a60c6d0ebac388c8f791adc6a199b2c9838497bcfff39502262014c8437a331e08e3526568d3ef755a7dfdc2557771bdae89c58cd5f714eae70df2
+DIST duma_2_5_15.tar.gz 240479 BLAKE2B c79f47ba418e22a65a2ad2d4cbff796c2a620ec5f36743d543fe1260e61ec700c648033ac3c91e71be3f3e1129a1c12e9f83a91277244962cfbd494d9588d681 SHA512 0e2abdb08cfbaf9fd0a6be348c831a83ac4ee86d2297dcd1c4d625ddb4b2c1c73eef05e2b895e291d5b8076b1baea559c89d475f30e409210df4ab69b71b6345
diff --git a/dev-debug/duma/duma-2.5.15-r2.ebuild b/dev-debug/duma/duma-2.5.15-r2.ebuild
new file mode 100644
index 000000000000..64f1d18d48b8
--- /dev/null
+++ b/dev-debug/duma/duma-2.5.15-r2.ebuild
@@ -0,0 +1,88 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit flag-o-matic toolchain-funcs versionator
+
+MY_P=${PN}_$(replace_all_version_separators '_')
+
+DESCRIPTION="DUMA (Detect Unintended Memory Access) is a memory debugging library"
+HOMEPAGE="http://duma.sourceforge.net"
+SRC_URI="mirror://sourceforge/duma/${MY_P}.tar.gz
+ mirror://gentoo/${P}-GNUmakefile.patch.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ppc x86"
+IUSE="examples"
+
+S=${WORKDIR}/${MY_P}
+
+PATCHES=(
+ "${WORKDIR}"/${P}-GNUmakefile.patch
+ "${FILESDIR}"/${P}-gcc6.patch
+)
+
+src_configure() {
+ # other flags will break duma
+ export CFLAGS="-O0 -Wall -Wextra -U_FORTIFY_SOURCE"
+ tc-export AR CC CXX LD RANLIB
+
+ # bug #789708
+ append-cxxflags -std=c++14
+
+ case "${CHOST}" in
+ *-linux-gnu)
+ OS=linux;;
+ *-solaris*)
+ OS=solaris;;
+ *-darwin*)
+ OS=osx;;
+ esac
+ export OS="${OS}"
+ elog "Detected OS is: ${OS}"
+
+ if use amd64 && ! [ -n "${DUMA_ALIGNMENT}" ]; then
+ export DUMA_ALIGNMENT=16
+ elog "Exported DUMA_ALIGNMENT=${DUMA_ALIGNMENT} for x86_64,"
+ fi
+
+}
+
+src_compile() {
+ # The below must be run first if distcc is enabled, otherwise
+ # the real build breaks on parallel makes.
+ emake reconfig
+ emake
+}
+
+src_test() {
+ emake test
+
+ elog "Please, see the output above to verify all tests have passed."
+ elog "Both static and dynamic confidence tests should say PASSED."
+}
+
+src_install() {
+ emake prefix="${D}/usr" libdir="${D}/usr/$(get_libdir)" \
+ docdir="${D}/usr/share/doc/${PF}" install
+
+ sed -i "s|LD_PRELOAD=./libduma|LD_PRELOAD=libduma|" "${D}"/usr/bin/duma \
+ || die "sed failed"
+
+ dodoc CHANGELOG TODO GNUmakefile
+
+ if use examples; then
+ docinto examples
+ dodoc example[1-6].cpp example_makes/ex6/Makefile
+ fi
+}
+
+pkg_postinst() {
+ elog "See the GNUmakefile which will be also installed at"
+ elog "/usr/share/doc/${PF} for more options. You can now export"
+ elog "varibles to the build system easily, e.g.:"
+ elog "# export CPPFLAGS=\"-DFLAG\" (or by using append-cppflags)"
+ elog "# export DUMA_ALIGNMENT=${DUMA_ALIGNMENT} (Default is 16 for x86_64)"
+ elog "See more information about DUMA_ALIGNMENT from Readme.txt"
+}
diff --git a/dev-debug/duma/files/duma-2.5.15-gcc6.patch b/dev-debug/duma/files/duma-2.5.15-gcc6.patch
new file mode 100644
index 000000000000..7cffef2b4e2c
--- /dev/null
+++ b/dev-debug/duma/files/duma-2.5.15-gcc6.patch
@@ -0,0 +1,22 @@
+--- duma_2_5_15/dumapp.cpp.old 2016-09-21 19:28:01.286332961 -0400
++++ duma_2_5_15/dumapp.cpp 2016-09-21 19:28:06.722907238 -0400
+@@ -190,7 +190,9 @@
+ * (11) = (a) ; ASW
+ */
+ void * DUMA_CDECL operator new( DUMA_SIZE_T size )
++#if __cplusplus < 201103L
+ throw(std::bad_alloc)
++#endif
+ {
+ return duma_new_operator(size, EFA_NEW_ELEM, true DUMA_PARAMS_UK);
+ }
+@@ -254,7 +256,9 @@
+ * (21) = (a) ; AAW
+ */
+ void * DUMA_CDECL operator new[]( DUMA_SIZE_T size )
++#if __cplusplus < 201103L
+ throw(std::bad_alloc)
++#endif
+ {
+ return duma_new_operator(size, EFA_NEW_ARRAY, true DUMA_PARAMS_UK);
+ }
diff --git a/dev-debug/duma/metadata.xml b/dev-debug/duma/metadata.xml
new file mode 100644
index 000000000000..92eeebf5b18b
--- /dev/null
+++ b/dev-debug/duma/metadata.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>bircoph@gentoo.org</email>
+ <name>Andrew Savchenko</name>
+ </maintainer>
+ <longdescription>
+DUMA is an open-source library (under GNU General Public License) to
+detect buffer overruns and under-runs in C and C++ programs. This
+library is a fork of Buce Perens Electric Fence library and adds
+some new features to it.</longdescription>
+ <upstream>
+ <remote-id type="sourceforge">duma</remote-id>
+ </upstream>
+</pkgmetadata>