[gentoo-commits] repo/gentoo:master commit in: dev-libs/ustr/, dev-libs/ustr/files/

2020-11-13 Thread Aaron Bauman
commit: a13790eb155f9c5740fb0c11b56ab2d81dd7f591
Author: Fergus Dall  google  com>
AuthorDate: Thu Sep 24 08:08:39 2020 +
Commit: Aaron Bauman  gentoo  org>
CommitDate: Fri Nov 13 21:31:15 2020 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a13790eb

dev-libs/ustr: Fix compilation using clang/LLVM

This package depends on old-style GCC inline functions, but the
patch to maintain this behaviour on newer compilers only works
for GCC specifically. Replace this with a check for
__GNUC_STDC_INLINE__, which is documented to work with both GCC
and clang.

Bug: https://bugs.gentoo.org/732026
Closes: https://bugs.gentoo.org/732026
Signed-off-by: Fergus Dall  google.com>
Signed-off-by: Sven Eden  prydeworx.com>
Signed-off-by: Aaron Bauman  gentoo.org>

 dev-libs/ustr/files/ustr-1.0.4-inline-check.patch | 27 
 dev-libs/ustr/ustr-1.0.4-r9.ebuild| 83 +++
 2 files changed, 110 insertions(+)

diff --git a/dev-libs/ustr/files/ustr-1.0.4-inline-check.patch 
b/dev-libs/ustr/files/ustr-1.0.4-inline-check.patch
new file mode 100644
index 000..b38cf7829c9
--- /dev/null
+++ b/dev-libs/ustr/files/ustr-1.0.4-inline-check.patch
@@ -0,0 +1,27 @@
+--- a/ustr-conf.h.in   2007-10-22 08:00:55.0 +0200
 b/ustr-conf.h.in   2015-09-10 12:24:34.998796842 +0200
+@@ -4,13 +4,23 @@
+ /* this is the custom version for the library itself, for everyone else
+  * ustr-import generates one depending on the options. */
+ 
++/* Ustr relies on GCC's traditional handling of inline functions, not
++ * the version that was actually standardized in C99. GCC-compatible
++ * compilers define __GNUC_STDC_INLINE__ when using the standard
++ * behavior. When this is set we must restore the old inline behavior:
++ */
++#if defined(__GNUC__) \
++ && defined(__GNUC_STDC_INLINE__)
++#  define inline inline __attribute__ ((gnu_inline))
++#endif
++
+ /* The default is now to link against libc. */
+ #ifndef USTR_CONF_INCLUDE_CODEONLY_HEADERS
+ #define USTR_CONF_INCLUDE_CODEONLY_HEADERS 0
+ #endif
+ 
+ /* We can't: if defined(__GLIBC__) && (!defined(_GNU_SOURCE) || !_GNU_SOURCE)
+- *  because by the time we've included a libc header it's too late. */ 
++ *  because by the time we've included a libc header it's too late. */
+ #ifndef _GNU_SOURCE
+ #define _GNU_SOURCE 1
+ #endif

diff --git a/dev-libs/ustr/ustr-1.0.4-r9.ebuild 
b/dev-libs/ustr/ustr-1.0.4-r9.ebuild
new file mode 100644
index 000..632e404652a
--- /dev/null
+++ b/dev-libs/ustr/ustr-1.0.4-r9.ebuild
@@ -0,0 +1,83 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+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 ~arm64 ~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}-inline-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 \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" \
+   

[gentoo-commits] repo/gentoo:master commit in: dev-libs/ustr/, dev-libs/ustr/files/

2016-02-17 Thread Mike Frysinger
commit: 2d365dd353b15bf43b65049f4f9056f379607200
Author: Mike Frysinger  gentoo  org>
AuthorDate: Wed Feb 17 18:31:53 2016 +
Commit: Mike Frysinger  gentoo  org>
CommitDate: Wed Feb 17 18:42:26 2016 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2d365dd3

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.

 dev-libs/ustr/files/ustr-1.0.4-build-libs.patch | 49 +++
 dev-libs/ustr/metadata.xml  |  3 +
 dev-libs/ustr/ustr-1.0.4-r8.ebuild  | 84 +
 3 files changed, 136 insertions(+)

diff --git a/dev-libs/ustr/files/ustr-1.0.4-build-libs.patch 
b/dev-libs/ustr/files/ustr-1.0.4-build-libs.patch
new file mode 100644
index 000..79fe818
--- /dev/null
+++ b/dev-libs/ustr/files/ustr-1.0.4-build-libs.patch
@@ -0,0 +1,49 @@
+make static lib build/install controllable so we can disable it by default
+
+punt the -debug lib variants ... if people want debug libs, they can rebuild
+the package using their desired build settings.
+
+--- a/Makefile
 b/Makefile
+@@ -291,8 +291,10 @@
+ OPT_LIB_SHARED  = libustr-$(VERS_BSO).so.$(VERS_ESO)
+ OPT_LIB_STATIC  = libustr.a
+ 
+-LIB_SHARED = $(DBG_LIB_SHARED) $(OPT_LIB_SHARED)
+-LIB_STATIC = $(DBG_LIB_STATIC) $(OPT_LIB_STATIC)
++LIB_SHARED = $(OPT_LIB_SHARED)
++ifeq ($(USE_STATIC),yes)
++LIB_STATIC = $(OPT_LIB_STATIC)
++endif
+ 
+ DEPS_NONC_ALL  = $(SRC_HDRS) $(SRC_SRCS_H)
+ DEPS_C_ALL = $(SRC_HDRS)
+@@ -388,17 +390,14 @@
+   install -d $(DESTDIR)$(bindir)
+   install -d $(DESTDIR)$(libdir)/pkgconfig
+   $(HIDE)echo Installing files
++ifeq ($(USE_STATIC),yes)
+   install -m 644 -t $(DESTDIR)$(libdir) $(LIB_STATIC)
++endif
+   install -m 755 -t $(DESTDIR)$(libdir) $(LIB_SHARED)
+   -rm -f $(DESTDIR)$(libdir)/$(OPT_LIB_SHARED_NAME)
+   ln -s $(OPT_LIB_SHARED) 
$(DESTDIR)$(libdir)/$(OPT_LIB_SHARED_NAME)
+   -rm -f $(DESTDIR)$(libdir)/$(OPT_LIB_SHAREDEV)
+   ln -s $(OPT_LIB_SHARED_NAME) 
$(DESTDIR)$(libdir)/$(OPT_LIB_SHAREDEV)
+-  -rm -f $(DESTDIR)$(libdir)/$(DBG_LIB_SHARED_NAME)
+-  ln -s $(DBG_LIB_SHARED) 
$(DESTDIR)$(libdir)/$(DBG_LIB_SHARED_NAME)
+-  -rm -f $(DESTDIR)$(libdir)/$(DBG_LIB_SHAREDEV)
+-  ln -s $(DBG_LIB_SHARED_NAME) 
$(DESTDIR)$(libdir)/$(DBG_LIB_SHAREDEV)
+-  $(LDCONFIG) -n $(DESTDIR)$(libdir)
+   install -pm 644 -t $(DESTDIR)$(includedir) $(SRC_HDRS)
+   install -pm 644 -t $(DESTDIR)$(SHRDIR) $(SRC_SRCS)
+   install -pm 644 -t $(DESTDIR)$(SHRDIR) $(XSRC_SRCS)
+@@ -406,7 +406,7 @@ endif
+   install -pm 644 -t $(DESTDIR)$(mandir)/man1 $(MAN_PAGES_1)
+   install -pm 644 -t $(DESTDIR)$(mandir)/man3 $(MAN_PAGES_3)
+   install -m 755 -t $(DESTDIR)$(bindir) ustr-import
+-  install -pm 644 -t $(DESTDIR)$(libdir)/pkgconfig ustr.pc 
ustr-debug.pc
++  install -pm 644 -t $(DESTDIR)$(libdir)/pkgconfig ustr.pc
+ 
+ ustr-import-multilib: ustr-import-multilib.in
+   sed -e 's,@INCLUDEDIR@,$(includedir),g' -e 
's,@MBINDIR@,$(MBINDIR),g' < $< > $@

diff --git a/dev-libs/ustr/metadata.xml b/dev-libs/ustr/metadata.xml
index 3d12db6..524aa43 100644
--- a/dev-libs/ustr/metadata.xml
+++ b/dev-libs/ustr/metadata.xml
@@ -10,4 +10,7 @@
proxy-ma...@gentoo.org
Proxy Maintainers
 
+
+   Install ustr-import developer program and 
source code for bundling.
+
 

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 000..a540dad
--- /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}" \
+   

[gentoo-commits] repo/gentoo:master commit in: dev-libs/ustr/, dev-libs/ustr/files/

2015-09-12 Thread Ian Delaney
commit: 7dea6f8820f36bf389e6315044bea7507553bed0
Author: Ian Delaney  gentoo  org>
AuthorDate: Sun Sep 13 03:14:45 2015 +
Commit: Ian Delaney  gentoo  org>
CommitDate: Sun Sep 13 03:14:45 2015 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7dea6f88

dev-libs/ustr: revbump; patch and ebuild submitted in bug #556452

Package-Manager: portage-2.2.20.1

 dev-libs/ustr/files/ustr-1.0.4-gcc_5-check.patch | 28 +++
 dev-libs/ustr/ustr-1.0.4-r6.ebuild   | 61 
 2 files changed, 89 insertions(+)

diff --git a/dev-libs/ustr/files/ustr-1.0.4-gcc_5-check.patch 
b/dev-libs/ustr/files/ustr-1.0.4-gcc_5-check.patch
new file mode 100644
index 000..aaed150
--- /dev/null
+++ b/dev-libs/ustr/files/ustr-1.0.4-gcc_5-check.patch
@@ -0,0 +1,28 @@
+--- a/ustr-conf.h.in   2007-10-22 08:00:55.0 +0200
 b/ustr-conf.h.in   2015-09-10 12:24:34.998796842 +0200
+@@ -4,13 +4,24 @@
+ /* this is the custom version for the library itself, for everyone else
+  * ustr-import generates one depending on the options. */
+ 
++/* If this is GCC with major version 5 and up, the default C standard
++ * has changed from C89 to C99 so the old inline behaviour must be
++ * restored:
++ */
++#if defined(__GNUC__) \
++ && (__GNUC__ > 4) \
++ && defined(__STDC_VERSION__) \
++ && (__STDC_VERSION__ >= 199901L)
++#  define inline inline __attribute__ ((gnu_inline))
++#endif /* GCC greater than major version 4 and not -std=c89 set */
++
+ /* The default is now to link against libc. */
+ #ifndef USTR_CONF_INCLUDE_CODEONLY_HEADERS
+ #define USTR_CONF_INCLUDE_CODEONLY_HEADERS 0
+ #endif
+ 
+ /* We can't: if defined(__GLIBC__) && (!defined(_GNU_SOURCE) || !_GNU_SOURCE)
+- *  because by the time we've included a libc header it's too late. */ 
++ *  because by the time we've included a libc header it's too late. */
+ #ifndef _GNU_SOURCE
+ #define _GNU_SOURCE 1
+ #endif

diff --git a/dev-libs/ustr/ustr-1.0.4-r6.ebuild 
b/dev-libs/ustr/ustr-1.0.4-r6.ebuild
new file mode 100644
index 000..249168b
--- /dev/null
+++ b/dev-libs/ustr/ustr-1.0.4-r6.ebuild
@@ -0,0 +1,61 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-libs/ustr/ustr-1.0.4-r3.ebuild,v 1.4 
2014/01/14 13:58:01 ago Exp $
+
+EAPI=5
+
+inherit multilib-build toolchain-funcs eutils
+
+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=""
+
+DEPEND=""
+RDEPEND=""
+
+src_prepare() {
+   epatch "${FILESDIR}/${P}-gcc_5-check.patch"
+   multilib_copy_sources
+}
+
+ustr_make() {
+   emake "$@" \
+   AR="$(tc-getAR)" \
+   CC="$(tc-getCC)" \
+   CFLAGS="${CFLAGS}" \
+   LDFLAGS="${LDFLAGS}" \
+   prefix="${EPREFIX}/usr" \
+   SHRDIR="/usr/share/${P}" \
+   HIDE= || die
+}
+
+ustr_install() {
+   cd "${BUILD_DIR}" || die
+
+   emake "$@" \
+   DESTDIR="${D}" \
+   prefix="${EPREFIX}/usr" \
+   libdir="${EPREFIX}/usr/$(get_libdir)" \
+   mandir="/usr/share/man" \
+   SHRDIR="/usr/share/${P}" \
+   DOCSHRDIR="/usr/share/doc/${PF}" \
+   HIDE= || die
+}
+
+src_compile() {
+   multilib_foreach_abi ustr_make all-shared
+}
+
+multilib_src_test() {
+   multilib_foreach_abi ustr_make check
+}
+
+src_install() {
+   multilib_foreach_abi ustr_install install-multilib-linux
+   dodoc ChangeLog README README-DEVELOPERS AUTHORS NEWS TODO
+}