From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1418349-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits))
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id 87B6B158011
	for <garchives@archives.gentoo.org>; Fri, 15 Jul 2022 01:26:34 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 9B51FE1135;
	Fri, 15 Jul 2022 01:26:31 +0000 (UTC)
Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id 4A117E1133
	for <gentoo-commits@lists.gentoo.org>; Fri, 15 Jul 2022 01:26:31 +0000 (UTC)
Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id DB2D8340AB2
	for <gentoo-commits@lists.gentoo.org>; Fri, 15 Jul 2022 01:26:29 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id 4988452D
	for <gentoo-commits@lists.gentoo.org>; Fri, 15 Jul 2022 01:26:28 +0000 (UTC)
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" <sam@gentoo.org>
Message-ID: <1657847966.b06fbe382208ce06556038081c9990e2375b123f.sam@gentoo>
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/ffcall/, dev-libs/ffcall/files/
X-VCS-Repository: repo/gentoo
X-VCS-Files: dev-libs/ffcall/ffcall-2.4-r1.ebuild dev-libs/ffcall/files/ffcall-2.4-slibtool.patch
X-VCS-Directories: dev-libs/ffcall/files/ dev-libs/ffcall/
X-VCS-Committer: sam
X-VCS-Committer-Name: Sam James
X-VCS-Revision: b06fbe382208ce06556038081c9990e2375b123f
X-VCS-Branch: master
Date: Fri, 15 Jul 2022 01:26:28 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
X-Archives-Salt: db8ebe29-d664-429f-b7af-453f64df2912
X-Archives-Hash: 9ac59ad24fa3ed8740b8c27c65948e0e

commit:     b06fbe382208ce06556038081c9990e2375b123f
Author:     orbea <orbea <AT> riseup <DOT> net>
AuthorDate: Thu Jul 14 00:57:43 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Jul 15 01:19:26 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b06fbe38

dev-libs/ffcall: Fix the build with slibtool

Bug: https://bugs.gentoo.org/776976
Upstream-ML: https://lists.gnu.org/archive/html/libffcall/2022-07/msg00000.html
Signed-off-by: orbea <orbea <AT> riseup.net>
Closes: https://github.com/gentoo/gentoo/pull/26394
Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-libs/ffcall/ffcall-2.4-r1.ebuild            | 67 +++++++++++++++++++
 dev-libs/ffcall/files/ffcall-2.4-slibtool.patch | 86 +++++++++++++++++++++++++
 2 files changed, 153 insertions(+)

diff --git a/dev-libs/ffcall/ffcall-2.4-r1.ebuild b/dev-libs/ffcall/ffcall-2.4-r1.ebuild
new file mode 100644
index 000000000000..370cad023a20
--- /dev/null
+++ b/dev-libs/ffcall/ffcall-2.4-r1.ebuild
@@ -0,0 +1,67 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit flag-o-matic
+
+MY_PV="libffcall-${PV}"
+
+DESCRIPTION="Build foreign function call interfaces in embedded interpreter"
+HOMEPAGE="https://www.gnu.org/software/libffcall/"
+SRC_URI="mirror://gnu/libffcall/${MY_PV}.tar.gz"
+S="${WORKDIR}"/${MY_PV}
+
+# "Ffcall is under GNU GPL. As a special exception, if used in GNUstep
+# or in derivate works of GNUstep, the included parts of ffcall are
+# under GNU LGPL." -ffcall author
+LICENSE="GPL-2+"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~sparc-solaris ~x86-solaris"
+
+PATCHES=(
+	# bug 842915, drop on next version bump
+	"${FILESDIR}"/${PN}-2.4-vacall-riscv-pic.patch
+	"${FILESDIR}"/${PN}-2.4-slibtool.patch # 776976
+)
+
+src_prepare() {
+	# The build system is a strange mix of autogenerated
+	# files and manual tweaks on top. Uses $CFLAGS / $LDFLAGS randomly.
+	# We are adding them consistently here and a bit over the top:
+	# bugs: #334581
+	local mfi
+	for mfi in {,*/,*/*/,}Makefile.in ; do
+		einfo "Patching '${mfi}'"
+		# usually uses only assembler here, but -march=
+		# and -Wa, are a must to pass here.
+		sed -e 's/$(CC) /&$(CFLAGS) /g' \
+			-i "${mfi}" || die
+	done
+
+	default
+}
+
+src_configure() {
+	append-flags -fPIC
+
+	# Doc goes in datadir
+	econf \
+		--datadir="${EPREFIX}"/usr/share/doc/${PF} \
+		--enable-shared \
+		--disable-static
+}
+
+src_compile() {
+	# TODO. Remove -j1
+	emake -j1
+}
+
+src_install() {
+	dodoc NEWS README
+	dodir /usr/share/man
+
+	default
+
+	find "${ED}" -name '*.la' -delete || die
+}

diff --git a/dev-libs/ffcall/files/ffcall-2.4-slibtool.patch b/dev-libs/ffcall/files/ffcall-2.4-slibtool.patch
new file mode 100644
index 000000000000..73c896c4f211
--- /dev/null
+++ b/dev-libs/ffcall/files/ffcall-2.4-slibtool.patch
@@ -0,0 +1,86 @@
+Bug: https://bugs.gentoo.org/776976
+Upstream-ML: https://lists.gnu.org/archive/html/libffcall/2022-07/msg00000.html
+
+From: orbea <orbea@riseup.net>
+Date: Wed, 13 Jul 2022 17:45:05 -0700
+Subject: [PATCH] build: Fix the build with slibtool
+
+Using symlinks to create dummy .lo files does not work with slibtool
+which tries to find the corresponding .o file which doesn't exist.
+
+Its better to use the real .lo file instead.
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -2,6 +2,8 @@
+ 
+ #### Start of system configuration section. ####
+ 
++CPU = @HOST_CPU_C_ABI@
++
+ # Directories used by "make":
+ srcdir = @srcdir@
+ 
+@@ -69,8 +71,8 @@ ffcall-version.h : $(srcdir)/ffcall-version.in.h
+ ffcall-version.lo : $(srcdir)/ffcall-version.c ffcall-version.h config.h
+ 	$(LIBTOOL_COMPILE) $(CC) $(CFLAGS) $(CFLAGS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) -c $(srcdir)/ffcall-version.c
+ 
+-libffcall.la : ffcall-version.lo avcall/avcall.lo avcall/avcall-libapi.lo avcall/avcall-structcpy.lo callback/vacall_r/libvacall.la callback/trampoline_r/libtrampoline.la callback/callback-libapi.lo
+-	$(LIBTOOL_LINK) $(CC) $(CFLAGS) $(CFLAGS) -o libffcall.la -rpath $(libdir) -no-undefined -export-symbols-regex $(LIBFFCALL_EXPORTED_SYMBOLS_REGEX) -version-info $(LIBFFCALL_VERSION_INFO) ffcall-version.lo avcall/avcall.lo avcall/avcall-libapi.lo avcall/avcall-structcpy.lo callback/vacall_r/vacall.lo callback/vacall_r/vacall-libapi.lo callback/vacall_r/vacall-structcpy.lo callback/trampoline_r/*.lo callback/callback-libapi.lo gnulib-lib/libgnu.la $(LDFLAGS) $(LTLIBTHREAD)
++libffcall.la : ffcall-version.lo avcall/avcall-$(CPU).lo avcall/avcall-libapi.lo avcall/avcall-structcpy.lo callback/vacall_r/libvacall.la callback/trampoline_r/libtrampoline.la callback/callback-libapi.lo
++	$(LIBTOOL_LINK) $(CC) $(CFLAGS) $(CFLAGS) -o libffcall.la -rpath $(libdir) -no-undefined -export-symbols-regex $(LIBFFCALL_EXPORTED_SYMBOLS_REGEX) -version-info $(LIBFFCALL_VERSION_INFO) ffcall-version.lo avcall/avcall-$(CPU).lo avcall/avcall-libapi.lo avcall/avcall-structcpy.lo callback/vacall_r/vacall-$(CPU).lo callback/vacall_r/vacall-libapi.lo callback/vacall_r/vacall-structcpy.lo callback/trampoline_r/*.lo callback/callback-libapi.lo gnulib-lib/libgnu.la $(LDFLAGS) $(LTLIBTHREAD)
+ 
+ install : force
+ 	mkdir -p $(DESTDIR)$(prefix)
+--- a/avcall/Makefile.in
++++ b/avcall/Makefile.in
+@@ -58,7 +58,7 @@ SHELL = /bin/sh
+ # Needed by $(LIBTOOL).
+ top_builddir = ..
+ 
+-OBJECTS = avcall.lo avcall-libapi.lo avcall-structcpy.lo avcall-compat.lo
++OBJECTS = avcall-$(CPU).lo avcall-libapi.lo avcall-structcpy.lo avcall-compat.lo
+ 
+ # Limit the set of exported symbols, on those platforms where libtool supports it.
+ # Currently this does not exclude any symbol; maybe sometime in the future...
+@@ -70,11 +70,6 @@ LIBAVCALL_VERSION_INFO = 2:0:1
+ 
+ all : $(OBJECTS) libavcall.la $(srcdir)/avcall.3 $(srcdir)/avcall.html
+ 
+-avcall.lo : avcall-$(CPU).lo
+-	$(RM) avcall.lo avcall.@OBJEXT@
+-	$(LN) avcall-$(CPU).lo avcall.lo
+-	if test -f avcall-$(CPU).@OBJEXT@; then $(LN) avcall-$(CPU).@OBJEXT@ avcall.@OBJEXT@; fi
+-
+ @IFNOT_MSVC@avcall-i386.lo : avcall-i386.s
+ @IFNOT_MSVC@	$(LIBTOOL_COMPILE) $(CC) $(CFLAGS) @GCC_X_NONE@ -c avcall-i386.s
+ 
+--- a/callback/Makefile.in
++++ b/callback/Makefile.in
+@@ -77,7 +77,7 @@ callback-compat.lo : $(srcdir)/callback-compat.c ../config.h
+ 	$(LIBTOOL_COMPILE) $(CC) $(CFLAGS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) -c $(srcdir)/callback-compat.c
+ 
+ libcallback.la : vacall_r/libvacall.la trampoline_r/libtrampoline.la callback-libapi.lo callback-compat.lo
+-	$(LIBTOOL_LINK) $(CC) $(CFLAGS) -o libcallback.la -rpath $(libdir) -no-undefined -export-symbols-regex $(LIBCALLBACK_EXPORTED_SYMBOLS_REGEX) -version-info $(LIBCALLBACK_VERSION_INFO) vacall_r/vacall.lo vacall_r/vacall-libapi.lo vacall_r/vacall-structcpy.lo trampoline_r/*.lo callback-libapi.lo callback-compat.lo ../gnulib-lib/libgnu.la $(LDFLAGS) $(LTLIBTHREAD)
++	$(LIBTOOL_LINK) $(CC) $(CFLAGS) -o libcallback.la -rpath $(libdir) -no-undefined -export-symbols-regex $(LIBCALLBACK_EXPORTED_SYMBOLS_REGEX) -version-info $(LIBCALLBACK_VERSION_INFO) vacall_r/vacall-$(CPU).lo vacall_r/vacall-libapi.lo vacall_r/vacall-structcpy.lo trampoline_r/*.lo callback-libapi.lo callback-compat.lo ../gnulib-lib/libgnu.la $(LDFLAGS) $(LTLIBTHREAD)
+ 
+ # Installs the library and include files only. Typically called with only
+ # $(libdir) and $(includedir) - don't use $(prefix) and $(exec_prefix) here.
+--- a/callback/vacall_r/Makefile.in
++++ b/callback/vacall_r/Makefile.in
+@@ -54,15 +54,10 @@ SHELL = /bin/sh
+ # Needed by $(LIBTOOL).
+ top_builddir = ../..
+ 
+-OBJECTS = vacall.lo vacall-libapi.lo vacall-structcpy.lo
++OBJECTS = vacall-$(CPU).lo vacall-libapi.lo vacall-structcpy.lo
+ 
+ all : $(OBJECTS) libvacall.la
+ 
+-vacall.lo : vacall-$(CPU).lo
+-	$(RM) vacall.lo vacall.@OBJEXT@
+-	$(LN) vacall-$(CPU).lo vacall.lo
+-	if test -f vacall-$(CPU).@OBJEXT@; then $(LN) vacall-$(CPU).@OBJEXT@ vacall.@OBJEXT@; fi
+-
+ @IFNOT_MSVC@vacall-i386.lo : vacall-i386.s
+ @IFNOT_MSVC@	$(LIBTOOL_COMPILE) $(CC) $(CFLAGS) @GCC_X_NONE@ -c vacall-i386.s
+