diff options
author | Sergei Trofimovich <slyfox@gentoo.org> | 2011-12-07 19:07:39 +0000 |
---|---|---|
committer | Sergei Trofimovich <slyfox@gentoo.org> | 2011-12-07 19:07:39 +0000 |
commit | 1b709ec8690b8ef00d03d91297ec5a9000460270 (patch) | |
tree | d709e9a591863bce8c8a9e415aa406771f5261e6 /dev-util/bdelta | |
parent | Add stow-1.3.3-r1 with fixed bug 246264 and new 2.1.1 version. Old version is... (diff) | |
download | gentoo-2-1b709ec8690b8ef00d03d91297ec5a9000460270.tar.gz gentoo-2-1b709ec8690b8ef00d03d91297ec5a9000460270.tar.bz2 gentoo-2-1b709ec8690b8ef00d03d91297ec5a9000460270.zip |
Version bump. Fixes bug #338327 by Artem S. Tashkinov. Added myself to maintainers.
(Portage version: 2.2.0_alpha79_p23/cvs/Linux x86_64)
Diffstat (limited to 'dev-util/bdelta')
10 files changed, 406 insertions, 2 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/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> |