aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2010-01-30 16:00:41 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2010-01-30 16:00:41 +0000
commit079d11998b9a2998a4f603e238f37d3559ce673c (patch)
treee2cc284e13a5c505dc8521598d545e57f30e13bc
parentd4152a1f83590fbed81dbc45d7d54a8ed7ad9fc0 (diff)
downloadaports-079d11998b9a2998a4f603e238f37d3559ce673c.tar.bz2
aports-079d11998b9a2998a4f603e238f37d3559ce673c.tar.xz
main/libxml2: patch abuse of zlib API
-rw-r--r--main/libxml2/APKBUILD25
-rw-r--r--main/libxml2/largefile64.patch12
-rw-r--r--main/libxml2/zlib.patch32
3 files changed, 64 insertions, 5 deletions
diff --git a/main/libxml2/APKBUILD b/main/libxml2/APKBUILD
index e69914ed28..58514b1eac 100644
--- a/main/libxml2/APKBUILD
+++ b/main/libxml2/APKBUILD
@@ -2,17 +2,29 @@
# Maintainer: Carlo Landmeter <clandmeter at gmail>
pkgname=libxml2
pkgver=2.7.6
-pkgrel=1
+pkgrel=2
pkgdesc="XML parsing library, version 2"
url="http://www.xmlsoft.org/"
license="MIT"
depends=
makedepends="zlib-dev python-dev"
subpackages="$pkgname-doc $pkgname-dev py-$pkgname:py"
-source="ftp://ftp.xmlsoft.org/${pkgname}/${pkgname}-${pkgver}.tar.gz"
+source="ftp://ftp.xmlsoft.org/${pkgname}/${pkgname}-${pkgver}.tar.gz
+ largefile64.patch
+ zlib.patch"
+
+options="!strip"
+
+_builddir="$srcdir/$pkgname-$pkgver"
+prepare() {
+ cd "$_builddir"
+ for _i in "$srcdir"/*.patch; do
+ patch -p1 -i "$_i"
+ done
+}
build() {
- cd "$srcdir/$pkgname-$pkgver"
+ cd "$_builddir"
./configure --prefix=/usr \
--sysconfdir=/etc \
--mandir=/usr/share/man \
@@ -21,16 +33,19 @@ build() {
}
package() {
- cd "$srcdir/$pkgname-$pkgver"
+ cd "$_builddir"
make -j1 DESTDIR="$pkgdir" install
install -Dm644 COPYING "$pkgdir"/usr/share/licenses/$pkgname/COPYING
}
py() {
+ cd "$_builddir"
pkgdesc="$pkgname python bindings"
install -d "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/lib/python* "$subpkgdir"/usr/lib/
}
-md5sums="7740a8ec23878a2f50120e1faa2730f2 libxml2-2.7.6.tar.gz"
+md5sums="7740a8ec23878a2f50120e1faa2730f2 libxml2-2.7.6.tar.gz
+5ad4915665608ebfa5b89f7908467a72 largefile64.patch
+0365d5397164b8739219e56e5ca069d1 zlib.patch"
diff --git a/main/libxml2/largefile64.patch b/main/libxml2/largefile64.patch
new file mode 100644
index 0000000000..29be82760f
--- /dev/null
+++ b/main/libxml2/largefile64.patch
@@ -0,0 +1,12 @@
+--- libxml2-2.6.32.dfsg.orig/libxml.h
++++ libxml2-2.6.32.dfsg/libxml.h
+@@ -13,6 +13,9 @@
+ #ifndef _LARGEFILE_SOURCE
+ #define _LARGEFILE_SOURCE
+ #endif
++#ifndef _LARGEFILE64_SOURCE
++#define _LARGEFILE64_SOURCE
++#endif
+ #ifndef _FILE_OFFSET_BITS
+ #define _FILE_OFFSET_BITS 64
+ #endif
diff --git a/main/libxml2/zlib.patch b/main/libxml2/zlib.patch
new file mode 100644
index 0000000000..4bf486d127
--- /dev/null
+++ b/main/libxml2/zlib.patch
@@ -0,0 +1,32 @@
+From a7e79f28689c574e0bbef17f4cb3da00249181ff Mon Sep 17 00:00:00 2001
+From: Mark Adler <madler@alumni.caltech.edu>
+Date: Tue, 19 Jan 2010 15:28:48 +0000
+Subject: libxml violates the zlib interface and crashes
+
+* xmlIO.c: remove an abuse of zlib API and use a clean interface
+ available in zlib >= 1.2.3
+---
+diff --git a/xmlIO.c b/xmlIO.c
+index c03ac43..8fc00e3 100644
+--- a/xmlIO.c
++++ b/xmlIO.c
+@@ -2518,6 +2518,9 @@ __xmlParserInputBufferCreateFilename(const char *URI, xmlCharEncoding enc) {
+ #ifdef HAVE_ZLIB_H
+ if ((xmlInputCallbackTable[i].opencallback == xmlGzfileOpen) &&
+ (strcmp(URI, "-") != 0)) {
++#if defined(ZLIB_VERNUM) && ZLIB_VERNUM >= 0x1230
++ ret->compressed = !gzdirect(context);
++#else
+ if (((z_stream *)context)->avail_in > 4) {
+ char *cptr, buff4[4];
+ cptr = (char *) ((z_stream *)context)->next_in;
+@@ -2529,6 +2532,7 @@ __xmlParserInputBufferCreateFilename(const char *URI, xmlCharEncoding enc) {
+ gzrewind(context);
+ }
+ }
++#endif
+ }
+ #endif
+ }
+--
+cgit v0.8.3.1