From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 97C4F138359 for ; Fri, 13 Nov 2020 21:31:36 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id E6176E0833; Fri, 13 Nov 2020 21:31:35 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id C1184E0833 for ; Fri, 13 Nov 2020 21:31:35 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id B4A83341126 for ; Fri, 13 Nov 2020 21:31:33 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 037F644C for ; Fri, 13 Nov 2020 21:31:32 +0000 (UTC) From: "Aaron Bauman" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Aaron Bauman" Message-ID: <1605303075.a13790eb155f9c5740fb0c11b56ab2d81dd7f591.bman@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/ustr/, dev-libs/ustr/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-libs/ustr/files/ustr-1.0.4-inline-check.patch dev-libs/ustr/ustr-1.0.4-r9.ebuild X-VCS-Directories: dev-libs/ustr/files/ dev-libs/ustr/ X-VCS-Committer: bman X-VCS-Committer-Name: Aaron Bauman X-VCS-Revision: a13790eb155f9c5740fb0c11b56ab2d81dd7f591 X-VCS-Branch: master Date: Fri, 13 Nov 2020 21:31:32 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 84d02cc6-29e4-4589-a85f-7afd27aa3d95 X-Archives-Hash: 82d2ea758d9121e0bee1c5d7cee24e57 commit: a13790eb155f9c5740fb0c11b56ab2d81dd7f591 Author: Fergus Dall google com> AuthorDate: Thu Sep 24 08:08:39 2020 +0000 Commit: Aaron Bauman gentoo org> CommitDate: Fri Nov 13 21:31:15 2020 +0000 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 00000000000..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.000000000 +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 00000000000..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" \ + "${ED}/usr/share/${P}" || die + fi +} + +multilib_src_test() { + _emake check +}