summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Trofimovich <slyfox@gentoo.org>2011-12-07 19:07:39 +0000
committerSergei Trofimovich <slyfox@gentoo.org>2011-12-07 19:07:39 +0000
commit54e04d5ead4477af6355b68d83e4e907a31ccd69 (patch)
tree8845ea8d91bb4152287ac130c1fa2d094130939a /dev-util/bdelta
parentAdd stow-1.3.3-r1 with fixed bug 246264 and new 2.1.1 version. Old version is... (diff)
downloadhistorical-54e04d5ead4477af6355b68d83e4e907a31ccd69.tar.gz
historical-54e04d5ead4477af6355b68d83e4e907a31ccd69.tar.bz2
historical-54e04d5ead4477af6355b68d83e4e907a31ccd69.zip
Version bump. Fixes bug #338327 by Artem S. Tashkinov. Added myself to maintainers.
Package-Manager: portage-2.2.0_alpha79_p23/cvs/Linux x86_64
Diffstat (limited to 'dev-util/bdelta')
-rw-r--r--dev-util/bdelta/ChangeLog18
-rw-r--r--dev-util/bdelta/Manifest21
-rw-r--r--dev-util/bdelta/bdelta-0.2.3.ebuild36
-rw-r--r--dev-util/bdelta/files/bdelta-0.2.3-Makefile-add-make-clean-target.patch47
-rw-r--r--dev-util/bdelta/files/bdelta-0.2.3-Makefile-create-LIBDIR-as-well.patch27
-rw-r--r--dev-util/bdelta/files/bdelta-0.2.3-Makefile-fix-paralell-building-bdelta-depends-on-it-.patch27
-rw-r--r--dev-util/bdelta/files/bdelta-0.2.3-bdelta.h-make-header-C-compatible.patch64
-rw-r--r--dev-util/bdelta/files/bdelta-0.2.3-fix-stack-smash.patch68
-rw-r--r--dev-util/bdelta/files/bdelta-0.2.3-libbdelta-rename-NDEBUG-to-DO_STATS_DEBUG.patch65
-rw-r--r--dev-util/bdelta/files/bdelta-0.2.3-makefile-restect-user-s-LDFLAGS-CXXFLAGS-and-other-v.patch51
-rw-r--r--dev-util/bdelta/metadata.xml5
11 files changed, 421 insertions, 8 deletions
diff --git a/dev-util/bdelta/ChangeLog b/dev-util/bdelta/ChangeLog
index 7fe984eebc8d..81ccbb2c228e 100644
--- a/dev-util/bdelta/ChangeLog
+++ b/dev-util/bdelta/ChangeLog
@@ -1,6 +1,20 @@
# ChangeLog for dev-util/bdelta
-# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-util/bdelta/ChangeLog,v 1.8 2010/05/22 11:46:38 tove Exp $
+# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/dev-util/bdelta/ChangeLog,v 1.9 2011/12/07 19:07:39 slyfox Exp $
+
+*bdelta-0.2.3 (07 Dec 2011)
+
+ 07 Dec 2011; Sergei Trofimovich <slyfox@gentoo.org> +bdelta-0.2.3.ebuild,
+ +files/bdelta-0.2.3-Makefile-add-make-clean-target.patch,
+ +files/bdelta-0.2.3-Makefile-create-LIBDIR-as-well.patch, +files/bdelta-0.2.3-
+ Makefile-fix-paralell-building-bdelta-depends-on-it-.patch,
+ +files/bdelta-0.2.3-bdelta.h-make-header-C-compatible.patch,
+ +files/bdelta-0.2.3-fix-stack-smash.patch,
+ +files/bdelta-0.2.3-libbdelta-rename-NDEBUG-to-DO_STATS_DEBUG.patch, +files/bd
+ elta-0.2.3-makefile-restect-user-s-LDFLAGS-CXXFLAGS-and-other-v.patch,
+ metadata.xml:
+ Version bump. Fixes bug #338327 by Artem S. Tashkinov. Added myself to
+ maintainers.
22 May 2010; Torsten Veller <tove@gentoo.org> metadata.xml:
Remove genstef from metadata.xml (#66339)
diff --git a/dev-util/bdelta/Manifest b/dev-util/bdelta/Manifest
index 7b3875b3e482..fe89bfc19788 100644
--- a/dev-util/bdelta/Manifest
+++ b/dev-util/bdelta/Manifest
@@ -2,14 +2,23 @@
Hash: SHA1
AUX bdelta-0.1.0-ldflags.patch 907 RMD160 b41d9ff926d08bc3e868c65d5bf5f9fa048ffdb4 SHA1 e210509705c42ba37d93e9efad0ca7a41a298c4b SHA256 cf2bd17a23b944fde6cc00617e5e42360b9663a5c6af6c9faf7763b03ecf66b3
+AUX bdelta-0.2.3-Makefile-add-make-clean-target.patch 1309 RMD160 d115269ead8ea8b01c76477880a43fd0fb5294bc SHA1 acf7281db551ac48be4b000e2f7192f3a3bd932a SHA256 15d04ff33e94eac53df1698c680fd465ac17756725ec962e5fe76913a616d371
+AUX bdelta-0.2.3-Makefile-create-LIBDIR-as-well.patch 850 RMD160 34a0a9b1880da537710440a02152ec34bf967c55 SHA1 dfda2a96d4605331397e481b3622bdf3ef2d3377 SHA256 d741f1929a01244e1c010cb2994d1dd36b5c3206918a3d83f130433faeb9acf5
+AUX bdelta-0.2.3-Makefile-fix-paralell-building-bdelta-depends-on-it-.patch 946 RMD160 4209040ed81d32c6b76ad1775c590b124a293b45 SHA1 79ec014c513b4f88dfb8a483459b9f9f24b2e758 SHA256 2ab1298257f0c00673a230fd3afabfb19d42494a81ebfe119744bf3767f761d9
+AUX bdelta-0.2.3-bdelta.h-make-header-C-compatible.patch 1808 RMD160 0c8a33ce0e703199ff19917715e054d4968b9b73 SHA1 d762da11988a38e7bc96b5b7f5a9d8bb2c42e065 SHA256 ea9e619727bc7209a4fc15da63f047d5320f0dbadf4931b55f475cb3ce99206a
+AUX bdelta-0.2.3-fix-stack-smash.patch 2027 RMD160 d5f496eec7854f63474cb1799ad41163afc78068 SHA1 97ec4a1b94d49af3f5f286ad89028a938c352d47 SHA256 30093e88a2c6aaf763a584532545960c707f4d855795b1296aefe371f188bb33
+AUX bdelta-0.2.3-libbdelta-rename-NDEBUG-to-DO_STATS_DEBUG.patch 1931 RMD160 baf03134d033805ae4573145c083008fa1dc46ad SHA1 f04d0b52487c60617973ab34bcd815339d69e1a4 SHA256 d34dc697f76086ff81622d5b6c4b48e261c3992bffef864fbe306f603989f0b0
+AUX bdelta-0.2.3-makefile-restect-user-s-LDFLAGS-CXXFLAGS-and-other-v.patch 1599 RMD160 2509f12cc365a16d2ab86182928f7c24775aa39a SHA1 7fde7bc229fe0353a85082a49784f52a5aa3fb3a SHA256 9fc35e43e6ffc18e0b2a919c6502f6dde81c4ad79894061f87b45a71b308e081
DIST bdelta-0.1.0.tar.gz 7418 RMD160 5bc144bc8b40a667de4fe44611585f6241e38b79 SHA1 93ffce7de26deeaaa10a4c113101d874501f6767 SHA256 7222011d8e3d2955f1ed094a0cc3edde6c681dd82bad5edb829ed68df32cd78d
+DIST bdelta-0.2.3.tar.gz 11591 RMD160 e9e2a95601a5a9de0ca2bdb05929f767a2bc0cad SHA1 8b1bebf8c66e5a68eb0b3640df69a2fce3895a4f SHA256 331441bba7288399889e0e2d49fd469b7681b94b76682ef89dba867de4535073
EBUILD bdelta-0.1.0.ebuild 918 RMD160 a7c178567c648093b66bd85818c2747cc57cfac1 SHA1 353b12e30ea1786180113b20915512f952b72358 SHA256 49dffbc7022e010aa17c9a17eb78c49eabf461c38a140517bf516a734048cabe
-MISC ChangeLog 1301 RMD160 1008f6dcc5dc4e516076d6b656541c4f7609b625 SHA1 bbce039dc04f5adff10a6a58991cd7952415cbf8 SHA256 547a8f742449a7d3dd2ae8a0a03b5b8aefff36ae419b81d551d8332fa8c251a5
-MISC metadata.xml 168 RMD160 6d103a7a37bfa991c687d7de84f459d2b29e044a SHA1 11393efc87f8f44f70b2b653533cb3e7d66b4741 SHA256 cc8de755073b39f4b2ef5c79a0ad5023787f9226b73842530a62ea8eae615d70
+EBUILD bdelta-0.2.3.ebuild 1340 RMD160 8049a9767b1075a6bf5057d10c2b2bccace78d2a SHA1 59f53900d0adb7216c1ac56fc86a61430b585aff SHA256 b2be708c6e31f598ee8075e2b299f193b0897b71a4a4932797078cfb5750f6c0
+MISC ChangeLog 1978 RMD160 59f08355b4505e2048dd4cd0aa400aa2283299c4 SHA1 8641d437ca40ad35319b19f82b742e3b57078e82 SHA256 a9c363c2ddf9948db767ee51eb18db658e28f1a702c34a4a9ea9a173893046cb
+MISC metadata.xml 322 RMD160 8292bc57400fbe15ef6a9df74f278445d50cc351 SHA1 df693a5cf09c9308060b010684aedd3f07080c56 SHA256 417eaecffa630e3e379e46d7b6cd9b5a48c27ab7b0eb2f581076efd79df49262
-----BEGIN PGP SIGNATURE-----
-Version: GnuPG v2.0.15 (GNU/Linux)
+Version: GnuPG v2.0.17 (GNU/Linux)
-iEYEARECAAYFAkv3xCMACgkQV3J2n04EauzVWQCfVpV5YIn9BU6tIzYDJUlFNeP4
-1XcAnRPqq09hZWIZcoPm/fQ237MgBkv4
-=qDsN
+iEYEARECAAYFAk7funQACgkQcaHudmEf86oPnwCfWyvVGxT7d9uOLkuiQbOFWjpb
+vS4AnR72YA1xR48NzTjh2NdIfpXBBjR4
+=Dmxx
-----END PGP SIGNATURE-----
diff --git a/dev-util/bdelta/bdelta-0.2.3.ebuild b/dev-util/bdelta/bdelta-0.2.3.ebuild
new file mode 100644
index 000000000000..e7b363d95eff
--- /dev/null
+++ b/dev-util/bdelta/bdelta-0.2.3.ebuild
@@ -0,0 +1,36 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-util/bdelta/bdelta-0.2.3.ebuild,v 1.1 2011/12/07 19:07:39 slyfox Exp $
+
+EAPI="4"
+
+inherit multilib toolchain-funcs eutils
+
+DESCRIPTION="Binary Delta - Efficient difference algorithm and format"
+HOMEPAGE="http://deltup.sourceforge.net"
+SRC_URI="http://deltup.org/request.php?10 -> ${P}.tar.gz"
+
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="~alpha ~amd64 ~ppc ~sparc ~x86"
+IUSE=""
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-0.2.3-makefile-restect-user-s-LDFLAGS-CXXFLAGS-and-other-v.patch
+ epatch "${FILESDIR}"/${PN}-0.2.3-bdelta.h-make-header-C-compatible.patch
+ epatch "${FILESDIR}"/${PN}-0.2.3-fix-stack-smash.patch #bug 338327
+ epatch "${FILESDIR}"/${PN}-0.2.3-libbdelta-rename-NDEBUG-to-DO_STATS_DEBUG.patch
+ epatch "${FILESDIR}"/${PN}-0.2.3-Makefile-add-make-clean-target.patch
+ epatch "${FILESDIR}"/${PN}-0.2.3-Makefile-fix-paralell-building-bdelta-depends-on-it-.patch
+ epatch "${FILESDIR}"/${PN}-0.2.3-Makefile-create-LIBDIR-as-well.patch
+}
+
+src_compile() {
+ # TODO: add soname versioning
+ emake -C src CXX="$(tc-getCXX)" CXXFLAGS="${CXXFLAGS}" || die "emake failed"
+}
+
+src_install() {
+ make -C src DESTDIR="${D}" LIBDIR="/usr/$(get_libdir)" install || die "make install failed"
+ dodoc README
+}
diff --git a/dev-util/bdelta/files/bdelta-0.2.3-Makefile-add-make-clean-target.patch b/dev-util/bdelta/files/bdelta-0.2.3-Makefile-add-make-clean-target.patch
new file mode 100644
index 000000000000..21bde4a4fa4e
--- /dev/null
+++ b/dev-util/bdelta/files/bdelta-0.2.3-Makefile-add-make-clean-target.patch
@@ -0,0 +1,47 @@
+From 9bcf95e09d240280de0ba13767c85a9eb508ff4a Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <slyfox@gentoo.org>
+Date: Wed, 7 Dec 2011 21:01:20 +0300
+Subject: [PATCH 4/5] Makefile: add 'make clean' target
+
+Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
+---
+ trunk/src/Makefile | 14 +++++++++++++-
+ 1 files changed, 13 insertions(+), 1 deletions(-)
+
+diff --git a/trunk/src/Makefile b/trunk/src/Makefile
+index db2026a..7dd5085 100644
+--- a/trunk/src/Makefile
++++ b/trunk/src/Makefile
+@@ -4,16 +4,28 @@ BINDIR ?= $(PREFIX)/bin
+ LIBDIR ?= ${PREFIX}/lib
+ CXXFLAGS += -O2
+
+-all: bpatch libbdelta.so bdelta
++ALL_TARGETS = bpatch libbdelta.so bdelta
++
++all: $(ALL_TARGETS)
++
+ libbdelta.so: libbdelta.cpp compatibility.h container.h checksum.h file.h
+ $(CXX) -shared -fPIC $(CXXFLAGS) $(LDFLAGS) $< -o $@
++
+ bdelta: bdelta.cpp bdelta.h compatibility.h container.h file.h
+ $(CXX) $< -o $@ $(CXXFLAGS) $(LDFLAGS) -L. -lbdelta
++
+ bpatch: bpatch.cpp compatibility.h bdelta.h file.h
++
+ % : %.cpp
+ $(CXX) $< -o $@ $(CXXFLAGS) $(LDFLAGS)
++
+ install: libbdelta.so bdelta bpatch
+ mkdir -p $(DESTDIR)$(BINDIR)
+ install -m 755 libbdelta.so $(DESTDIR)$(LIBDIR)
+ install -m 755 bdelta $(DESTDIR)$(BINDIR)
+ install -m 755 bpatch $(DESTDIR)$(BINDIR)
++
++clean:
++ -rm $(ALL_TARGETS)
++
++.PHONY: clean
+--
+1.7.8
+
diff --git a/dev-util/bdelta/files/bdelta-0.2.3-Makefile-create-LIBDIR-as-well.patch b/dev-util/bdelta/files/bdelta-0.2.3-Makefile-create-LIBDIR-as-well.patch
new file mode 100644
index 000000000000..3874a0e1d9ce
--- /dev/null
+++ b/dev-util/bdelta/files/bdelta-0.2.3-Makefile-create-LIBDIR-as-well.patch
@@ -0,0 +1,27 @@
+From aeecce25c8d6223d8f35a5000aa21ec807302c81 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <slyfox@gentoo.org>
+Date: Wed, 7 Dec 2011 21:52:00 +0300
+Subject: [PATCH] Makefile: create LIBDIR as well
+
+Useful when DISTDIR points to empty directory hierarchy
+
+Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
+---
+ trunk/src/Makefile | 1 +
+ 1 files changed, 1 insertions(+), 0 deletions(-)
+
+diff --git a/trunk/src/Makefile b/trunk/src/Makefile
+index 1f4ff3e..f3a56f0 100644
+--- a/trunk/src/Makefile
++++ b/trunk/src/Makefile
+@@ -21,6 +21,7 @@ bpatch: bpatch.cpp compatibility.h bdelta.h file.h
+
+ install: libbdelta.so bdelta bpatch
+ mkdir -p $(DESTDIR)$(BINDIR)
++ mkdir -p $(DESTDIR)$(LIBDIR)
+ install -m 755 libbdelta.so $(DESTDIR)$(LIBDIR)
+ install -m 755 bdelta $(DESTDIR)$(BINDIR)
+ install -m 755 bpatch $(DESTDIR)$(BINDIR)
+--
+1.7.8
+
diff --git a/dev-util/bdelta/files/bdelta-0.2.3-Makefile-fix-paralell-building-bdelta-depends-on-it-.patch b/dev-util/bdelta/files/bdelta-0.2.3-Makefile-fix-paralell-building-bdelta-depends-on-it-.patch
new file mode 100644
index 000000000000..3978d3a651ea
--- /dev/null
+++ b/dev-util/bdelta/files/bdelta-0.2.3-Makefile-fix-paralell-building-bdelta-depends-on-it-.patch
@@ -0,0 +1,27 @@
+From b82cfae4954557f03a01f7b8c92cf1d59dea9033 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <slyfox@gentoo.org>
+Date: Wed, 7 Dec 2011 21:43:07 +0300
+Subject: [PATCH] Makefile: fix paralell building (bdelta depends on it's
+ shared library)
+
+Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
+---
+ trunk/src/Makefile | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/trunk/src/Makefile b/trunk/src/Makefile
+index 7dd5085..1f4ff3e 100644
+--- a/trunk/src/Makefile
++++ b/trunk/src/Makefile
+@@ -11,7 +11,7 @@ all: $(ALL_TARGETS)
+ libbdelta.so: libbdelta.cpp compatibility.h container.h checksum.h file.h
+ $(CXX) -shared -fPIC $(CXXFLAGS) $(LDFLAGS) $< -o $@
+
+-bdelta: bdelta.cpp bdelta.h compatibility.h container.h file.h
++bdelta: bdelta.cpp bdelta.h compatibility.h container.h file.h libbdelta.so
+ $(CXX) $< -o $@ $(CXXFLAGS) $(LDFLAGS) -L. -lbdelta
+
+ bpatch: bpatch.cpp compatibility.h bdelta.h file.h
+--
+1.7.8
+
diff --git a/dev-util/bdelta/files/bdelta-0.2.3-bdelta.h-make-header-C-compatible.patch b/dev-util/bdelta/files/bdelta-0.2.3-bdelta.h-make-header-C-compatible.patch
new file mode 100644
index 000000000000..f62b9471cae8
--- /dev/null
+++ b/dev-util/bdelta/files/bdelta-0.2.3-bdelta.h-make-header-C-compatible.patch
@@ -0,0 +1,64 @@
+From eb4e8e74a27000c6965c5921f69823046e7fe2b6 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <slyfox@gentoo.org>
+Date: Wed, 7 Dec 2011 20:53:20 +0300
+Subject: [PATCH 1/4] bdelta.h: make header C compatible
+
+Exportaged names follow C calling. It's easier to
+to pull library in in other languages.
+
+Before patch:
+ $ nm libbdelta.so_ | grep bdelta_
+ 0000000000002a00 T _Z11bdelta_passPvj
+ 00000000000022c0 T _Z15bdelta_done_algPv
+ 00000000000022b0 T _Z15bdelta_getErrorPv
+ 0000000000002220 T _Z15bdelta_getMatchPvjPjS0_S0_
+ 0000000000002190 T _Z15bdelta_init_algjjPFPvS_S_jjES_S_j
+
+After patch:
+ $ nm libbdelta.so | grep bdelta_
+ 00000000000022e0 T bdelta_done_alg
+ 00000000000022d0 T bdelta_getError
+ 0000000000002240 T bdelta_getMatch
+ 00000000000021b0 T bdelta_init_alg
+ 0000000000002a20 T bdelta_pass
+
+Converted global constants to enum.
+
+Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
+---
+ trunk/src/bdelta.h | 13 +++++++++++--
+ 1 files changed, 11 insertions(+), 2 deletions(-)
+
+diff --git a/trunk/src/bdelta.h b/trunk/src/bdelta.h
+index 4a7ea40..03b102b 100644
+--- a/trunk/src/bdelta.h
++++ b/trunk/src/bdelta.h
+@@ -13,6 +13,10 @@
+ * Author: John Whitney <jjw@deltup.org>
+ */
+
++#ifdef __cplusplus
++extern "C" {
++#endif // __cplusplus
++
+ // Callback function must return a pointer to the data requested.
+ // A "fill and forget" buffer is provided, but can be ignored, so
+ // long as the data persists throughout the life of bdelta_pass().
+@@ -31,7 +35,12 @@ void bdelta_getMatch(void *instance, unsigned matchNum,
+
+ int bdelta_getError(void *instance);
+
+-const int
++enum BDELTA_RESULT {
+ BDELTA_OK = 0,
+ BDELTA_MEM_ERROR = -1,
+- BDELTA_READ_ERROR = -2;
++ BDELTA_READ_ERROR = -2
++};
++
++#ifdef __cplusplus
++}
++#endif // __cplusplus
+--
+1.7.8
+
diff --git a/dev-util/bdelta/files/bdelta-0.2.3-fix-stack-smash.patch b/dev-util/bdelta/files/bdelta-0.2.3-fix-stack-smash.patch
new file mode 100644
index 000000000000..884ef82ef28c
--- /dev/null
+++ b/dev-util/bdelta/files/bdelta-0.2.3-fix-stack-smash.patch
@@ -0,0 +1,68 @@
+commit 817cc738815542a1435d98c557954fad91fc9451
+Author: jjw <jjw@0b3c7260-62b7-4bd3-8502-661595b7e89c>
+Date: Wed Dec 7 15:53:20 2011 +0000
+
+ Use heap allocation to prevent the stack from overflowing on large diffs.
+
+ git-svn-id: svn://deltup.org/bdelta@41 0b3c7260-62b7-4bd3-8502-661595b7e89c
+
+Upstream: yes
+Reported-by: Artem S. Tashkinov
+Gentoo-bug: https://bugs.gentoo.org/show_bug.cgi?id=338327
+
+diff --git a/trunk/src/bdelta.cpp b/trunk/src/bdelta.cpp
+index 4eaaec7..8460451 100644
+--- a/trunk/src/bdelta.cpp
++++ b/trunk/src/bdelta.cpp
+@@ -45,9 +45,9 @@ int main(int argc, char **argv) {
+ for (int i = 512; i >= 16; i /= 2)
+ nummatches = bdelta_pass(b, i);
+
+- STACK_ALLOC(copyloc1, unsigned, nummatches + 1);
+- STACK_ALLOC(copyloc2, unsigned, nummatches + 1);
+- STACK_ALLOC(copynum, unsigned, nummatches + 1);
++ unsigned * copyloc1 = new unsigned[nummatches + 1];
++ unsigned * copyloc2 = new unsigned[nummatches + 1];
++ unsigned * copynum = new unsigned[nummatches + 1];
+
+ FILE *fout = fopen(argv[3], "wb");
+ if (!fout) {
+@@ -114,4 +114,10 @@ int main(int argc, char **argv) {
+
+ fclose(f1);
+ fclose(f2);
++
++ delete [] copynum;
++ delete [] copyloc2;
++ delete [] copyloc1;
++
++ return 0;
+ }
+diff --git a/trunk/src/bpatch.cpp b/trunk/src/bpatch.cpp
+index 0da02a8..8d6706b 100644
+--- a/trunk/src/bpatch.cpp
++++ b/trunk/src/bpatch.cpp
+@@ -67,9 +67,9 @@ int main(int argc, char **argv) {
+
+ unsigned nummatches = read_dword(patchfile);
+
+- STACK_ALLOC(copyloc1, unsigned, nummatches + 1);
+- STACK_ALLOC(copyloc2, unsigned, nummatches + 1);
+- STACK_ALLOC(copynum, unsigned, nummatches + 1);
++ unsigned * copyloc1 = new unsigned[nummatches + 1];
++ unsigned * copyloc2 = new unsigned[nummatches + 1];
++ unsigned * copynum = new unsigned[nummatches + 1];
+
+ for (unsigned i = 0; i < nummatches; ++i) {
+ copyloc1[i] = read_dword(patchfile);
+@@ -100,5 +100,10 @@ int main(int argc, char **argv) {
+ return -1;
+ }
+ }
++
++ delete [] copynum;
++ delete [] copyloc2;
++ delete [] copyloc1;
++
+ return 0;
+ }
diff --git a/dev-util/bdelta/files/bdelta-0.2.3-libbdelta-rename-NDEBUG-to-DO_STATS_DEBUG.patch b/dev-util/bdelta/files/bdelta-0.2.3-libbdelta-rename-NDEBUG-to-DO_STATS_DEBUG.patch
new file mode 100644
index 000000000000..ca03ac1dc113
--- /dev/null
+++ b/dev-util/bdelta/files/bdelta-0.2.3-libbdelta-rename-NDEBUG-to-DO_STATS_DEBUG.patch
@@ -0,0 +1,65 @@
+From 3f2ac2dc56ed344dec1d2d38934682de2e326e49 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <slyfox@gentoo.org>
+Date: Wed, 7 Dec 2011 21:01:20 +0300
+Subject: [PATCH 3/4] libbdelta: rename NDEBUG to DO_STATS_DEBUG
+
+As it activates quite specific spam to stdout.
+
+Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
+---
+ trunk/src/libbdelta.cpp | 11 +++++++----
+ 1 files changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/trunk/src/libbdelta.cpp b/trunk/src/libbdelta.cpp
+index 5808789..2a7e6e0 100644
+--- a/trunk/src/libbdelta.cpp
++++ b/trunk/src/libbdelta.cpp
+@@ -22,6 +22,9 @@ typedef uint16_t Token;
+ typedef uint32_t Token;
+ #endif
+
++// Enables delta chunk statistics
++// #define DO_STATS_DEBUG
++
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include "container.h"
+@@ -171,7 +174,7 @@ void sortTMatches(DLink<Match> *place, PotentialMatch *matches, unsigned numMatc
+ std::sort(matches, matches + numMatches, DistanceFromP1(lastf1Place));
+ }
+
+-#ifndef NDEBUG
++#ifdef DO_STATS_DEBUG
+ long long stata = 0, statb = 0;
+ #endif
+ void findMatches(BDelta_Instance *b, Checksums_Instance *h, unsigned start, unsigned end,
+@@ -200,7 +203,7 @@ void findMatches(BDelta_Instance *b, Checksums_Instance *h, unsigned start, unsi
+ // Keep the best 16
+ sortTMatches(place, pMatch, pMatchCount);
+ pMatchCount = 16;
+-#ifndef NDEBUG
++#ifdef DO_STATS_DEBUG
+ ++statb;
+ #endif
+ }
+@@ -259,7 +262,7 @@ void findMatches(BDelta_Instance *b, Checksums_Instance *h, unsigned start, unsi
+ buf_loc = blocksize;
+ j += blocksize;
+ }
+-#ifndef NDEBUG
++#ifdef DO_STATS_DEBUG
+ ++stata;
+ #endif
+ break;
+@@ -415,7 +418,7 @@ unsigned bdelta_pass(void *instance, unsigned blocksize) {
+ delete unused;
+ delete h.htable;
+ delete h.checksums;
+-#ifndef NDEBUG
++#ifdef DO_STATS_DEBUG
+ printf("a = %.lli; b = %.lli\n", stata, statb);
+ #endif
+ // printf("Found %i matches\n", b->matches.size());
+--
+1.7.8
+
diff --git a/dev-util/bdelta/files/bdelta-0.2.3-makefile-restect-user-s-LDFLAGS-CXXFLAGS-and-other-v.patch b/dev-util/bdelta/files/bdelta-0.2.3-makefile-restect-user-s-LDFLAGS-CXXFLAGS-and-other-v.patch
new file mode 100644
index 000000000000..d4150fd775f7
--- /dev/null
+++ b/dev-util/bdelta/files/bdelta-0.2.3-makefile-restect-user-s-LDFLAGS-CXXFLAGS-and-other-v.patch
@@ -0,0 +1,51 @@
+From c0e35d05c691171569b102e5cb0db0a8e3fc9320 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <slyfox@gentoo.org>
+Date: Wed, 7 Dec 2011 20:56:37 +0300
+Subject: [PATCH 2/4] makefile: restect user's LDFLAGS, CXXFLAGS and other
+ variables
+
+Distros like to push extra LDFLAGS and CXXFLAGS to allow user
+more freedom on optimization, debugging techniquires and
+just clever random hacks.
+
+Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
+---
+ trunk/src/Makefile | 16 +++++++---------
+ 1 files changed, 7 insertions(+), 9 deletions(-)
+
+diff --git a/trunk/src/Makefile b/trunk/src/Makefile
+index ca8148f..db2026a 100644
+--- a/trunk/src/Makefile
++++ b/trunk/src/Makefile
+@@ -1,21 +1,19 @@
+ DESTDIR=
+-PREFIX=/usr
+-BINDIR=$(PREFIX)/bin
+-LIBDIR=${PREFIX}/lib
+-CXXFLAGS=-O2
++PREFIX ?= /usr
++BINDIR ?= $(PREFIX)/bin
++LIBDIR ?= ${PREFIX}/lib
++CXXFLAGS += -O2
+
+ all: bpatch libbdelta.so bdelta
+ libbdelta.so: libbdelta.cpp compatibility.h container.h checksum.h file.h
+- ${CC} -shared -fPIC ${CXXFLAGS} $< -o $@
++ $(CXX) -shared -fPIC $(CXXFLAGS) $(LDFLAGS) $< -o $@
+ bdelta: bdelta.cpp bdelta.h compatibility.h container.h file.h
+- ${CC} $< -o $@ ${CXXFLAGS} -L. -lbdelta -lstdc++
++ $(CXX) $< -o $@ $(CXXFLAGS) $(LDFLAGS) -L. -lbdelta
+ bpatch: bpatch.cpp compatibility.h bdelta.h file.h
+ % : %.cpp
+- ${CC} $< -o $@ ${CXXFLAGS} -lstdc++
++ $(CXX) $< -o $@ $(CXXFLAGS) $(LDFLAGS)
+ install: libbdelta.so bdelta bpatch
+ mkdir -p $(DESTDIR)$(BINDIR)
+ install -m 755 libbdelta.so $(DESTDIR)$(LIBDIR)
+ install -m 755 bdelta $(DESTDIR)$(BINDIR)
+ install -m 755 bpatch $(DESTDIR)$(BINDIR)
+-
+-
+--
+1.7.8
+
diff --git a/dev-util/bdelta/metadata.xml b/dev-util/bdelta/metadata.xml
index 944d18d9a2a6..5a66e43ef83b 100644
--- a/dev-util/bdelta/metadata.xml
+++ b/dev-util/bdelta/metadata.xml
@@ -1,5 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
+ <maintainer>
+ <email>slyfox@gentoo.org</email>
+ <name>Sergei Trofimovich</name>
+ <description>Primary Maintainer</description>
+ </maintainer>
<herd>tools-portage</herd>
</pkgmetadata>