You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
88 lines
2.0 KiB
88 lines
2.0 KiB
4 years ago
|
# Copyright 1999-2020 Gentoo Authors
|
||
9 years ago
|
# Distributed under the terms of the GNU General Public License v2
|
||
|
|
||
4 years ago
|
EAPI=7
|
||
9 years ago
|
|
||
9 years ago
|
inherit toolchain-funcs multilib-minimal
|
||
9 years ago
|
|
||
|
DESCRIPTION="Low-overhead managed string library for C"
|
||
7 years ago
|
HOMEPAGE="http://www.and.org/ustr/"
|
||
9 years ago
|
SRC_URI="ftp://ftp.and.org/pub/james/ustr/${PV}/${P}.tar.bz2"
|
||
|
|
||
|
LICENSE="|| ( BSD-2 MIT LGPL-2 )"
|
||
|
SLOT="0"
|
||
4 years ago
|
KEYWORDS="~amd64 ~arm ~arm64 ~mips ~x86"
|
||
|
IUSE="ustr-import"
|
||
9 years ago
|
|
||
9 years ago
|
DOCS=(ChangeLog README README-DEVELOPERS AUTHORS NEWS TODO)
|
||
|
|
||
|
MULTILIB_WRAPPED_HEADERS=(
|
||
|
/usr/include/ustr-conf.h
|
||
|
/usr/include/ustr-conf-debug.h
|
||
|
)
|
||
9 years ago
|
|
||
4 years ago
|
PATCHES=(
|
||
|
"${FILESDIR}/${P}-inline-check.patch"
|
||
|
"${FILESDIR}/${PN}-1.0.4-build-libs.patch"
|
||
|
)
|
||
|
|
||
9 years ago
|
src_prepare() {
|
||
4 years ago
|
default
|
||
9 years ago
|
multilib_copy_sources
|
||
|
}
|
||
|
|
||
9 years ago
|
_emake() {
|
||
9 years ago
|
emake \
|
||
4 years ago
|
USE_STATIC="no" \
|
||
9 years ago
|
AR="$(tc-getAR)" \
|
||
|
CC="$(tc-getCC)" \
|
||
9 years ago
|
CFLAGS="${CFLAGS} ${CPPFLAGS}" \
|
||
9 years ago
|
LDFLAGS="${LDFLAGS}" \
|
||
|
prefix="${EPREFIX}/usr" \
|
||
9 years ago
|
libdir="${EPREFIX}/usr/$(get_libdir)" \
|
||
|
mandir="${EPREFIX}/usr/share/man" \
|
||
|
SHRDIR="${EPREFIX}/usr/share/${P}" \
|
||
|
DOCSHRDIR="${EPREFIX}/usr/share/doc/${PF}" \
|
||
9 years ago
|
HIDE= \
|
||
9 years ago
|
"$@"
|
||
|
}
|
||
|
|
||
|
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
|
||
9 years ago
|
}
|
||
|
|
||
9 years ago
|
multilib_src_install() {
|
||
9 years ago
|
_emake DESTDIR="${D}" install
|
||
4 years ago
|
|
||
|
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
|
||
9 years ago
|
}
|
||
|
|
||
|
multilib_src_test() {
|
||
9 years ago
|
_emake check
|
||
9 years ago
|
}
|