summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuli Suominen <ssuominen@gentoo.org>2012-05-21 17:02:43 +0000
committerSamuli Suominen <ssuominen@gentoo.org>2012-05-21 17:02:43 +0000
commit38ed8d4ffa72ea4fe251d3c23a0d14ed2f0aa568 (patch)
tree291b135f848545ba678ae595675e52ad3aa5f041 /gnome-extra/yelp
parentwhitespace (diff)
downloadgentoo-2-38ed8d4ffa72ea4fe251d3c23a0d14ed2f0aa568.tar.gz
gentoo-2-38ed8d4ffa72ea4fe251d3c23a0d14ed2f0aa568.tar.bz2
gentoo-2-38ed8d4ffa72ea4fe251d3c23a0d14ed2f0aa568.zip
Fix USE="lzma" and app-arch/xz-utils support. Port from net-libs/xulrunner to net-libs/webkit-gtk:2 wrt #416843 by Pacho Ramos.
(Portage version: 2.2.0_alpha107/cvs/Linux x86_64)
Diffstat (limited to 'gnome-extra/yelp')
-rw-r--r--gnome-extra/yelp/ChangeLog9
-rw-r--r--gnome-extra/yelp/files/yelp-2.30.2-xz-support.patch229
-rw-r--r--gnome-extra/yelp/yelp-2.30.2-r200.ebuild68
3 files changed, 305 insertions, 1 deletions
diff --git a/gnome-extra/yelp/ChangeLog b/gnome-extra/yelp/ChangeLog
index 4cb844468f26..09aa4fd2797b 100644
--- a/gnome-extra/yelp/ChangeLog
+++ b/gnome-extra/yelp/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for gnome-extra/yelp
# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/gnome-extra/yelp/ChangeLog,v 1.284 2012/05/20 21:39:27 tetromino Exp $
+# $Header: /var/cvsroot/gentoo-x86/gnome-extra/yelp/ChangeLog,v 1.285 2012/05/21 17:02:43 ssuominen Exp $
+
+*yelp-2.30.2-r200 (21 May 2012)
+
+ 21 May 2012; Samuli Suominen <ssuominen@gentoo.org> +yelp-2.30.2-r200.ebuild,
+ +files/yelp-2.30.2-xz-support.patch:
+ Fix USE="lzma" and app-arch/xz-utils support. Port from net-libs/xulrunner to
+ net-libs/webkit-gtk:2 wrt #416843 by Pacho Ramos.
20 May 2012; Alexandre Rostovtsev <tetromino@gentoo.org> yelp-3.2.1.ebuild,
yelp-3.4.1.ebuild, yelp-3.4.2.ebuild:
diff --git a/gnome-extra/yelp/files/yelp-2.30.2-xz-support.patch b/gnome-extra/yelp/files/yelp-2.30.2-xz-support.patch
new file mode 100644
index 000000000000..d2103f264182
--- /dev/null
+++ b/gnome-extra/yelp/files/yelp-2.30.2-xz-support.patch
@@ -0,0 +1,229 @@
+http://svnweb.mageia.org/packages/cauldron/yelp/releases/2.30.2/4.mga1/SOURCES/
+
+--- configure.in
++++ configure.in
+@@ -180,10 +180,10 @@
+ dnl ====================================
+ dnl = lzmadec for help converters
+ dnl ====================================
+-LZMADEC_LIBS=
+-AC_CHECK_LIB(lzmadec, lzmadec_open, [LZMADEC_LIBS=-llzmadec
+- AC_DEFINE(HAVE_LIBLZMADEC, 1, [Compile with liblzmadec support])])
+-AC_SUBST(LZMADEC_LIBS)
++LZMA_LIBS=
++AC_CHECK_LIB(lzma, [lzma_code, lzma_auto_decoder, lzma_end], [LZMA_LIBS=-llzma
++ AC_DEFINE(HAVE_LIBLZMA, 1, [Compile with liblzma support])])
++AC_SUBST(LZMA_LIBS)
+
+ dnl ====================================
+ dnl = Bzip2, for the help converters
+--- src/Makefile.am
++++ src/Makefile.am
+@@ -58,7 +58,7 @@
+ $(POPT_LIBS) \
+ $(Z_LIBS) \
+ $(BZ_LIBS) \
+- $(LZMADEC_LIBS) \
++ $(LZMA_LIBS) \
+ $(YELP_WEBKIT_LIBS) \
+ $(X_LIBS)
+
+@@ -108,7 +108,7 @@
+ yelp-transform.c yelp-transform.h \
+ test-document.c
+ test_document_CFLAGS = $(YELP_CFLAGS) $(AM_CFLAGS) $(YELP_DEFINES)
+-test_document_LDADD = $(YELP_LIBS) $(Z_LIBS) $(BZ_LIBS) $(LZMADEC_LIBS)
++test_document_LDADD = $(YELP_LIBS) $(Z_LIBS) $(BZ_LIBS) $(LZMA_LIBS)
+ test_document_LDFLAGS = $(AM_LDFLAGS)
+
+ test_man_parser_SOURCES = \
+@@ -119,7 +119,7 @@
+ test-man-parser.c
+ test_man_parser_CPPFLAGS = $(YELP_DEFINES) $(AM_CPPFLAGS)
+ test_man_parser_CFLAGS = $(YELP_CFLAGS) $(AM_CFLAGS)
+-test_man_parser_LDADD = $(YELP_LIBS) $(Z_LIBS) $(BZ_LIBS) $(LZMADEC_LIBS)
++test_man_parser_LDADD = $(YELP_LIBS) $(Z_LIBS) $(BZ_LIBS) $(LZMA_LIBS)
+ test_man_parser_LDFLAGS = $(AM_LDFLAGS)
+
+ test_page_SOURCES = \
+--- src/yelp-io-channel.c
++++ src/yelp-io-channel.c
+@@ -26,6 +26,7 @@
+
+
+ #include <stdio.h>
++#include <stdlib.h>
+ #include <glib.h>
+ #include <glib/gi18n.h>
+
+@@ -36,11 +37,80 @@
+ #ifdef HAVE_LIBBZ2
+ #include <bzlib.h>
+ #endif
+-#ifdef HAVE_LIBLZMADEC
+-#include <lzmadec.h>
++#ifdef HAVE_LIBLZMA
++#include <lzma.h>
+ #endif
+ #include <string.h>
+
++#ifdef HAVE_LIBLZMA
++typedef struct lzma_file {
++ uint8_t buf[1<<15];
++ lzma_stream strm;
++ FILE *fp;
++ lzma_bool eof;
++} lzma_FILE;
++
++static lzma_FILE *lzma_open (const char *path)
++{
++ lzma_ret ret;
++ lzma_FILE *lzma_file;
++ lzma_stream tmp = (lzma_stream)LZMA_STREAM_INIT;
++
++ lzma_file = calloc (1, sizeof (*lzma_file));
++ lzma_file->fp = fopen(path, "r");
++ lzma_file->eof = 0;
++ lzma_file->strm = tmp;
++
++ ret = lzma_auto_decoder (&lzma_file->strm, -1, 0);
++
++ if (ret != LZMA_OK) {
++ fclose (lzma_file->fp);
++ free (lzma_file);
++ return NULL;
++ }
++ return lzma_file;
++}
++
++static ssize_t lzma_read(lzma_FILE *lzma_file, void *buf, size_t len)
++{
++ lzma_ret ret;
++ lzma_bool eof = 0;
++
++ if (!lzma_file)
++ return -1;
++ if (lzma_file->eof)
++ return 0;
++
++ lzma_file->strm.next_out = buf;
++ lzma_file->strm.avail_out = len;
++ for (;;) {
++ if (!lzma_file->strm.avail_in) {
++ lzma_file->strm.next_in = (uint8_t *)lzma_file->buf;
++ lzma_file->strm.avail_in = fread (lzma_file->buf, 1, sizeof (lzma_file->buf), lzma_file->fp);
++ if (!lzma_file->strm.avail_in)
++ eof = 1;
++ }
++ ret = lzma_code(&lzma_file->strm, LZMA_RUN);
++ if (ret == LZMA_STREAM_END) {
++ lzma_file->eof = 1;
++ return len - lzma_file->strm.avail_out;
++ }
++ if (ret != LZMA_OK)
++ return -1;
++ if (!lzma_file->strm.avail_out)
++ return len;
++ if (eof)
++ return -1;
++ }
++}
++
++static void lzma_close(lzma_FILE *lzma_file)
++{
++ lzma_end (&lzma_file->strm);
++ fclose (lzma_file->fp);
++}
++#endif
++
+ typedef struct _YelpIOChannel YelpIOChannel;
+ struct _YelpIOChannel {
+ GIOChannel channel;
+@@ -48,8 +118,8 @@
+ BZFILE *bzin;
+ #endif
+ gzFile gzin;
+-#ifdef HAVE_LIBLZMADEC
+- lzmadec_FILE *lzin;
++#ifdef HAVE_LIBLZMA
++ lzma_FILE *lzin;
+ #endif
+ };
+
+@@ -99,9 +169,9 @@
+ channel->bzin = bzopen (file, "r");
+ else
+ #endif
+-#ifdef HAVE_LIBLZMADEC
+- if (g_str_has_suffix (file, ".lzma"))
+- channel->lzin = lzmadec_open(file);
++#ifdef HAVE_LIBLZMA
++ if (g_str_has_suffix (file, ".lzma") || g_str_has_suffix (file, ".xz"))
++ channel->lzin = lzma_open (file);
+ else
+ #endif
+
+@@ -111,7 +181,7 @@
+ #ifdef HAVE_LIBBZ2
+ !channel->bzin &&
+ #endif
+-#ifdef HAVE_LIBLZMADEC
++#ifdef HAVE_LIBLZMA
+ !channel->lzin &&
+ #endif
+ !channel->gzin) {
+@@ -159,9 +229,10 @@
+ bytes = bzread (yelp_channel->bzin, buffer, count);
+ else
+ #endif
+-#if HAVE_LIBLZMADEC
+- if (yelp_channel->lzin)
+- bytes = lzmadec_read (yelp_channel->lzin, buffer, count);
++#if HAVE_LIBLZMA
++ if (yelp_channel->lzin) {
++ bytes = lzma_read (yelp_channel->lzin, buffer, count);
++ }
+ else
+ #endif
+ bytes = gzread (yelp_channel->gzin, buffer, count);
+@@ -186,9 +257,9 @@
+ if (yelp_channel->bzin)
+ bzclose (yelp_channel->bzin);
+ #endif
+-#ifdef HAVE_LIBLZMADEC
++#ifdef HAVE_LIBLZMA
+ if (yelp_channel->lzin)
+- lzmadec_close (yelp_channel->lzin);
++ lzma_close (yelp_channel->lzin);
+ #endif
+ if (yelp_channel->gzin)
+ gzclose (yelp_channel->gzin);
+--- src/yelp-uri.c
++++ src/yelp-uri.c
+@@ -404,6 +404,13 @@
+ NULL);
+ if (g_file_test (fullpath, G_FILE_TEST_IS_REGULAR))
+ goto gotit;
++
++ fullpath = g_strconcat (langdir, "/", sectiondir,
++ "/", name, ".", sectiondir + 3, ".xz",
++ NULL);
++ if (g_file_test (fullpath, G_FILE_TEST_IS_REGULAR))
++ goto gotit;
++
+ g_free (fullpath);
+
+ fullpath = NULL;
+@@ -532,6 +539,12 @@
+ else if (is_man_path (basename, "lzma"))
+ ret->priv->doctype = YELP_URI_DOCUMENT_TYPE_MAN;
+ }
++ else if (g_str_equal (mime_type, "application/x-xz")) {
++ if (g_str_has_suffix (basename, ".info.xz"))
++ ret->priv->doctype = YELP_URI_DOCUMENT_TYPE_INFO;
++ else if (is_man_path (basename, "xz"))
++ ret->priv->doctype = YELP_URI_DOCUMENT_TYPE_MAN;
++ }
+ else if (g_str_equal (mime_type, "application/octet-stream")) {
+ if (g_str_has_suffix (basename, ".info"))
+ ret->priv->doctype = YELP_URI_DOCUMENT_TYPE_INFO;
diff --git a/gnome-extra/yelp/yelp-2.30.2-r200.ebuild b/gnome-extra/yelp/yelp-2.30.2-r200.ebuild
new file mode 100644
index 000000000000..e28b042caee4
--- /dev/null
+++ b/gnome-extra/yelp/yelp-2.30.2-r200.ebuild
@@ -0,0 +1,68 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/gnome-extra/yelp/yelp-2.30.2-r200.ebuild,v 1.1 2012/05/21 17:02:43 ssuominen Exp $
+
+EAPI=4
+GCONF_DEBUG=yes
+inherit autotools eutils gnome2
+
+MY_P=${P}+webkit
+
+DESCRIPTION="Help browser for GNOME"
+HOMEPAGE="http://projects.gnome.org/yelp/"
+SRC_URI="http://dev.gentoo.org/~ssuominen/${MY_P}.tar.xz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~x86-freebsd ~amd64-linux ~x86-linux ~x86-solaris"
+IUSE="lzma"
+
+RDEPEND="app-arch/bzip2
+ >=app-text/gnome-doc-utils-0.20.6
+ >=app-text/rarian-0.8.1
+ >=dev-libs/dbus-glib-0.98
+ >=dev-libs/glib-2.16
+ dev-libs/libxml2
+ dev-libs/libxslt
+ >=gnome-base/gconf-2
+ sys-libs/zlib
+ >=x11-libs/gtk+-2.18:2
+ x11-libs/libSM
+ x11-libs/libICE
+ x11-libs/libX11
+ x11-libs/startup-notification
+ net-libs/webkit-gtk:2
+ lzma? ( app-arch/xz-utils )"
+DEPEND="${RDEPEND}
+ dev-util/intltool
+ gnome-base/gnome-common
+ sys-devel/gettext
+ virtual/pkgconfig"
+
+S=${WORKDIR}/${MY_P}
+
+pkg_setup() {
+ DOCS="AUTHORS ChangeLog NEWS README TODO"
+ G2CONF="--enable-maintainer-mode --with-search=basic"
+}
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/${P}-uri-handler.patch \
+ "${FILESDIR}"/${P}-print-crash.patch \
+ "${FILESDIR}"/${P}-freeze-move.patch \
+ "${FILESDIR}"/${P}-xz-support.patch
+
+ sed -i -e '/CFLAGS/s:-pedantic -ansi::' configure.in || die #196621
+
+ intltoolize --force --copy --automake || die
+ eautoreconf
+
+ gnome2_src_prepare
+}
+
+src_configure() {
+ export ac_cv_lib_lzma_lzma_code__lzma_auto_decoder__lzma_end=$(usex lzma)
+
+ gnome2_src_configure
+}