diff options
author | 2016-02-17 13:31:53 -0500 | |
---|---|---|
committer | 2016-02-17 13:42:26 -0500 | |
commit | 2d365dd353b15bf43b65049f4f9056f379607200 (patch) | |
tree | dc73cbf97d8fd84e7b411b07da0e6f75fe8e0f03 /dev-libs/ustr/ustr-1.0.4-r8.ebuild | |
parent | dev-libs/ustr: add a configure stage for cross-compiling (diff) | |
download | gentoo-2d365dd353b15bf43b65049f4f9056f379607200.tar.gz gentoo-2d365dd353b15bf43b65049f4f9056f379607200.tar.bz2 gentoo-2d365dd353b15bf43b65049f4f9056f379607200.zip |
dev-libs/ustr: make installed file set more minimal
Add USE=static-libs to control install of the static archive.
Add USE=ustr-import to control install of the dev tool and source tree.
Punt the xxx-debug libs as this isn't how we handle debugging in Gentoo.
Diffstat (limited to 'dev-libs/ustr/ustr-1.0.4-r8.ebuild')
-rw-r--r-- | dev-libs/ustr/ustr-1.0.4-r8.ebuild | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/dev-libs/ustr/ustr-1.0.4-r8.ebuild b/dev-libs/ustr/ustr-1.0.4-r8.ebuild new file mode 100644 index 000000000000..a540dadaadf2 --- /dev/null +++ b/dev-libs/ustr/ustr-1.0.4-r8.ebuild @@ -0,0 +1,84 @@ +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI="5" + +inherit toolchain-funcs multilib-minimal + +DESCRIPTION="Low-overhead managed string library for C" +HOMEPAGE="http://www.and.org/ustr" +SRC_URI="ftp://ftp.and.org/pub/james/ustr/${PV}/${P}.tar.bz2" + +LICENSE="|| ( BSD-2 MIT LGPL-2 )" +SLOT="0" +KEYWORDS="~amd64 ~arm ~mips ~x86" +IUSE="static-libs ustr-import" + +DOCS=(ChangeLog README README-DEVELOPERS AUTHORS NEWS TODO) + +MULTILIB_WRAPPED_HEADERS=( + /usr/include/ustr-conf.h + /usr/include/ustr-conf-debug.h +) + +src_prepare() { + epatch "${FILESDIR}/${P}-gcc_5-check.patch" + epatch "${FILESDIR}/${PN}-1.0.4-build-libs.patch" + multilib_copy_sources +} + +_emake() { + emake \ + USE_STATIC=$(usex static-libs) \ + AR="$(tc-getAR)" \ + CC="$(tc-getCC)" \ + CFLAGS="${CFLAGS} ${CPPFLAGS}" \ + LDFLAGS="${LDFLAGS}" \ + prefix="${EPREFIX}/usr" \ + libdir="${EPREFIX}/usr/$(get_libdir)" \ + mandir="${EPREFIX}/usr/share/man" \ + SHRDIR="${EPREFIX}/usr/share/${P}" \ + DOCSHRDIR="${EPREFIX}/usr/share/doc/${PF}" \ + HIDE= \ + "$@" +} + +multilib_src_configure() { + # The included configure tests require execution. + + # We require vsnprintf everywhere as it's in POSIX. + printf '#!/bin/sh\necho 0\n' > autoconf_vsnprintf + chmod a+rx autoconf_vsnprintf + + # Always use stdint.h as it's in POSIX. + sed -i '/have_stdint_h=0/s:=0:=1:' Makefile || die + + # Figure out the size of size_t. + printf '#include <sys/types.h>\nint main() { char buf[sizeof(size_t) - 8]; }\n' > sizet_test.c + $(tc-getCC) ${CPPFLAGS} ${CFLAGS} -c sizet_test.c 2>/dev/null + printf '#!/bin/sh\necho %s\n' $(( $? == 0 )) > autoconf_64b + chmod a+rx autoconf_64b + + # Generate the config file now to avoid bad makefile deps. + _emake ustr-import +} + +multilib_src_compile() { + _emake all-shared +} + +multilib_src_install() { + _emake DESTDIR="${D}" install + + if ! use ustr-import ; then + rm -r \ + "${ED}/usr/bin/ustr-import" \ + "${ED}/usr/share/man/man1/ustr-import.1" \ + "${ED}/usr/share/${P}" || die + fi +} + +multilib_src_test() { + _emake check +} |