dev-libs/libfstrcmp: Fix build with rlibtool

Bug: https://bugs.gentoo.org/778371
Signed-off-by: orbea <orbea@riseup.net>
Closes: https://github.com/gentoo/gentoo/pull/25969
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
orbea
2022-06-18 20:56:48 -07:00
committed by Sam James
parent 2990abfcf2
commit 3f4b2de7cb
2 changed files with 129 additions and 0 deletions

View File

@@ -0,0 +1,81 @@
https://bugs.gentoo.org/778371
From: orbea <orbea@riseup.net>
Date: Sat, 18 Jun 2022 20:49:52 -0700
Subject: [PATCH] configure: Use LT_INIT to find libtool
LT_INIT will generate libtool for the build which is required by
rlibtool to determine if building shared or static libraries.
--- a/Makefile.in
+++ b/Makefile.in
@@ -37,6 +37,11 @@
srcdir = @srcdir@
VPATH = @srcdir@
+#
+# directory containing the build
+#
+top_builddir = @top_builddir@
+
#
# the name of the install program to use
#
--- a/configure.ac
+++ b/configure.ac
@@ -22,7 +22,7 @@ AC_PROG_CC
AC_CANONICAL_HOST
AC_GNU_SOURCE
AC_PROG_INSTALL
-AC_PROG_RANLIB
+LT_INIT
AC_CHECK_PROGS(AR, ar)
AC_USE_SYSTEM_EXTENSIONS
@@ -32,6 +32,8 @@ AC_ISC_POSIX
AC_OBJEXT
AC_EXEEXT
+AC_SUBST([top_builddir], [$abs_builddir])
+
dnl @synopsis AC_ADD_CFLAGS
dnl
dnl Add the given option to CFLAGS, if it doesn't break the compiler
@@ -53,37 +55,6 @@ AC_ADD_CFLAGS(-Wshadow)
dnl! AC_ADD_CFLAGS(-Werror)
dnl! AC_ADD_CFLAGS([-Wl,--as-needed])
-AC_CHECK_PROGS(LIBTOOL, libtool)
-
-if test -z "$LIBTOOL"
-then
- AC_MSG_RESULT([
- You must have GNU Libtool installed to build fstrcmp.
- Homepage: http://www.gnu.org/software/libtool/])
- OK=no
- if apt-get --version > /dev/null 2> /dev/null; then
- AC_MSG_RESULT([
- The following command may be used to install it:
- sudo apt-get install libtool
- ])
- OK=yes
- fi
- if yum --version > /dev/null 2> /dev/null; then
- AC_MSG_RESULT([
- The following command may be used to install it:
- sudo yum install libtool
- ])
- OK=yes
- fi
- if test "$OK" != "yes"; then
- AC_MSG_RESULT([
- If you are using a package based install, you will need the
- libtool package.
- ])
- fi
- exit 1
-fi
-
AC_CHECK_PROGS(GROFF, groff roff)
AC_CHECK_PROGS(SOELIM, gsoelim soelim)
AC_CHECK_PROGS(REFER, refer grefer)

View File

@@ -0,0 +1,48 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit autotools
DESCRIPTION="Make fuzzy comparisons of strings and byte arrays"
HOMEPAGE="http://fstrcmp.sourceforge.net/"
LICENSE="GPL-3+"
IUSE="doc static-libs test"
SLOT="0"
SRC_URI="http://fstrcmp.sourceforge.net/fstrcmp-0.7.D001.tar.gz -> ${P}.tar.gz"
S="${WORKDIR}/fstrcmp-0.7.D001"
KEYWORDS="amd64 ~arm arm64 x86"
DEPEND="
sys-apps/groff
doc? ( app-text/ghostscript-gpl )
test? ( app-text/ghostscript-gpl )
"
RESTRICT="!test? ( test )"
PATCHES=(
"${FILESDIR}"/${P}-libtool.patch # 778371
)
src_prepare() {
default
eautoreconf
}
src_compile() {
emake all-bin
use doc && emake all-doc
}
src_install() {
emake DESTDIR="${D}" install-bin install-include install-libdir install-man
find "${D}" -name '*.la' -delete || die
if ! use static-libs ; then
find "${D}" -name '*.a' -delete || die
fi
use doc && emake DESTDIR="${D}" install-doc
einstalldocs
}