From c21f90bf6a4e573b15f73e57454ee6199d0f3f31 Mon Sep 17 00:00:00 2001 From: Fabian Groffen Date: Mon, 7 Sep 2015 11:54:07 +0200 Subject: [PATCH] app-arch/unrar-gpl: add support for non-linux platforms (Prefix) Package-Manager: portage-2.2.20-prefix --- .../files/unrar-gpl-0.0.1-solaris.patch | 63 +++++++++++++++++++ .../unrar-gpl-0.0.1_p20080417-r2.ebuild | 33 ++++++++++ 2 files changed, 96 insertions(+) create mode 100644 app-arch/unrar-gpl/files/unrar-gpl-0.0.1-solaris.patch create mode 100644 app-arch/unrar-gpl/unrar-gpl-0.0.1_p20080417-r2.ebuild diff --git a/app-arch/unrar-gpl/files/unrar-gpl-0.0.1-solaris.patch b/app-arch/unrar-gpl/files/unrar-gpl-0.0.1-solaris.patch new file mode 100644 index 000000000000..f1cf8ef2338a --- /dev/null +++ b/app-arch/unrar-gpl/files/unrar-gpl-0.0.1-solaris.patch @@ -0,0 +1,63 @@ +* grobian@gentoo.org: allow compilation on non glibc hosts by use of an + external library for argp, and check for certain + headers before including them + +--- configure.ac ++++ configure.ac +@@ -14,7 +14,7 @@ + + # Checks for header files. + AC_HEADER_STDC +-AC_CHECK_HEADERS([limits.h stdlib.h string.h unistd.h]) ++AC_CHECK_HEADERS([limits.h stdlib.h string.h unistd.h error.h]) + + # Checks for typedefs, structures, and compiler characteristics. + AC_C_CONST +@@ -24,6 +24,7 @@ + AC_FUNC_MALLOC + AC_FUNC_REALLOC + AC_CHECK_FUNCS([atexit realpath setenv strchr]) ++AC_SEARCH_LIBS([argp_usage], [argp]) + + AC_CONFIG_FILES([Makefile + src/Makefile]) +--- src/unrar.c ++++ src/unrar.c +@@ -24,7 +24,9 @@ + #include + #include + #include ++#ifdef HAVE_ERROR_H + #include ++#endif + #include + #include + #include +--- src/opts.c ++++ src/opts.c +@@ -22,7 +22,9 @@ + #include + #include + #include ++#ifdef HAVE_ERROR_H + #include ++#endif + #include + #include + #include +--- src/opts.h ++++ src/opts.h +@@ -56,4 +56,13 @@ + int parse_opts (int argc, char **argv, struct arguments_t *arguments); + int compat_parse_opts (int argc, char **argv, struct arguments_t *arguments); + ++#ifndef HAVE_ERROR_H ++#define error(S, E, ...) \ ++ fflush(stdout); \ ++ fprintf(stderr, "unrar: " __VA_ARGS__); \ ++ if (E != 0) fprintf(stderr, ": %s", strerror(E)); \ ++ fprintf(stderr, "\n"); \ ++ if (S != 0) exit(S); ++#endif ++ + #endif diff --git a/app-arch/unrar-gpl/unrar-gpl-0.0.1_p20080417-r2.ebuild b/app-arch/unrar-gpl/unrar-gpl-0.0.1_p20080417-r2.ebuild new file mode 100644 index 000000000000..be1690d8386a --- /dev/null +++ b/app-arch/unrar-gpl/unrar-gpl-0.0.1_p20080417-r2.ebuild @@ -0,0 +1,33 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=4 +inherit autotools flag-o-matic + +DESCRIPTION="Free rar unpacker for old (pre v3) rar files" +HOMEPAGE="http://home.gna.org/unrar/" +SRC_URI="mirror://gentoo/${P}.tar.bz2" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux ~x86-solaris" +IUSE="" +DEPEND="!elibc_glibc? ( dev-libs/argp dev-libs/gnulib )" + +DOCS="AUTHORS README" + +S=${WORKDIR}/${PN/-gpl} + +src_prepare() { + epatch "${FILESDIR}"/${PN}-0.0.1-solaris.patch + sed -i configure.ac -e 's|AM_CONFIG_HEADER|AC_CONFIG_HEADERS|g' || die + eautoreconf + + if [[ ${CHOST} == *-aix* || ${CHOST} == *-solaris* ]]; then + append-cppflags -I"${EPREFIX}"/usr/$(get_libdir)/gnulib/include + append-ldflags -L"${EPREFIX}"/usr/$(get_libdir)/gnulib/lib + append-libs -lgnu + fi +} +src_configure() { econf --program-suffix="-gpl"; } -- 2.26.2