commit:     a935681a6fcabf47524c72420050b6a9030f555d
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Nov  5 06:09:35 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Nov  5 06:10:13 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a935681a

dev-libs/librep: update EAPI 7 -> 8; fix build w/ Clang 16; partial slibtool fix

re slibtool: per linked bug, there's still an issue in slibtool itself
to be fixed with --mode=execute.

Bug: https://bugs.gentoo.org/790812
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../files/librep-0.92.7-configure-clang16.patch    | 74 +++++++++++++++++++
 dev-libs/librep/files/librep-0.92.7-libtool.patch  | 47 ++++++++++++
 dev-libs/librep/librep-0.92.7-r2.ebuild            | 83 ++++++++++++++++++++++
 3 files changed, 204 insertions(+)

diff --git a/dev-libs/librep/files/librep-0.92.7-configure-clang16.patch 
b/dev-libs/librep/files/librep-0.92.7-configure-clang16.patch
new file mode 100644
index 000000000000..43c458690e43
--- /dev/null
+++ b/dev-libs/librep/files/librep-0.92.7-configure-clang16.patch
@@ -0,0 +1,74 @@
+https://github.com/SawfishWM/librep/pull/17
+
+From 5c653297288fc1d82f92d224c745d89f9e6734fd Mon Sep 17 00:00:00 2001
+From: Sam James <[email protected]>
+Date: Sat, 5 Nov 2022 06:04:27 +0000
+Subject: [PATCH] build: fix -Wimplicit-int, -Wimplicit-function-declaration
+
+Clang 16 will make -Wimplicit-int and -Wimplicit-function-declaration
+errors by default.
+
+In this case, it manifests as:
+```
+checking for data type to store Lisp values... configure: error: cannot find 
Lisp value type; set --with-value-type (see README)
+```
+
+For more information, see LWN.net [0] or LLVM's Discourse [1], or the
+(new) c-std-porting mailing list [2].
+
+[0] https://lwn.net/Articles/913505/
+[1] 
https://discourse.llvm.org/t/configure-script-breakage-with-the-new-werror-implicit-function-declaration/65213
+[2] hosted at lists.linux.dev.
+
+Signed-off-by: Sam James <[email protected]>
+--- a/configure.ac
++++ b/configure.ac
+@@ -432,15 +432,18 @@ AC_ARG_WITH(value-type,
+                          as a pointer. [TYPE=<probed>] (see README)], [],
+  [with_value_type="undef"])
+ if test "${with_value_type}" = "undef"; then
+-  AC_TRY_RUN([main () { exit (!(sizeof (int) >= sizeof (void *)));}],
++  AC_TRY_RUN([#include <stdlib.h>
++             int main () { exit (!(sizeof (int) >= sizeof (void *)));}],
+            [with_value_type=int])
+ fi
+ if test "${with_value_type}" = "undef"; then
+-  AC_TRY_RUN([main () { exit (!(sizeof (long int) >= sizeof (void *)));}],
++  AC_TRY_RUN([#include <stdlib.h>
++             int main () { exit (!(sizeof (long int) >= sizeof (void *)));}],
+            [with_value_type="long int"])
+ fi
+ if test "${with_value_type}" = "undef"; then
+-  AC_TRY_RUN([main () { exit (!(sizeof (long long int) >= sizeof (void 
*)));}],
++  AC_TRY_RUN([#include <stdlib.h>
++             int main () { exit (!(sizeof (long long int) >= sizeof (void 
*)));}],
+            [with_value_type="long long int"])
+ fi
+ if test "${with_value_type}" = "undef"; then
+@@ -457,7 +460,8 @@ AC_ARG_WITH(value-sizeof,
+ if test "${with_value_sizeof}" = "undef"; then
+   dnl the following fragment is inspired by AC_CHECK_SIZEOF
+   AC_TRY_RUN([#include <stdio.h>
+-            main () {
++              #include <stdlib.h>
++              int main () {
+               FILE *f = fopen ("conftestval", "w");
+               if (!f) exit (1);
+               fprintf (f, "%d\n", sizeof (${with_value_type}));
+@@ -548,11 +552,12 @@ if test "${with_stack_direction}" = unknown; then
+   esac
+ fi
+ if test "${with_stack_direction}" = unknown; then
+-  AC_TRY_RUN([ int level = 1;
+-             void inner (char *foo) { char bar;
++  AC_TRY_RUN([#include <stdlib.h>
++               int level = 1;
++               void inner (char *foo) { char bar;
+                if (level) { --level; inner (foo); }
+                exit (!(foo >= &bar)); }
+-             void main () { char foo; inner (&foo); } ],
++             int main () { char foo; inner (&foo); } ],
+    [AC_MSG_RESULT([downwards])
+     with_stack_direction=-1],
+    [AC_MSG_RESULT([upwards])
+

diff --git a/dev-libs/librep/files/librep-0.92.7-libtool.patch 
b/dev-libs/librep/files/librep-0.92.7-libtool.patch
new file mode 100644
index 000000000000..fd23c1fb0995
--- /dev/null
+++ b/dev-libs/librep/files/librep-0.92.7-libtool.patch
@@ -0,0 +1,47 @@
+https://github.com/SawfishWM/librep/commit/2c064d70e25137915ceaef616c2be5c8bbcc42da
+
+From 2c064d70e25137915ceaef616c2be5c8bbcc42da Mon Sep 17 00:00:00 2001
+From: orbea <[email protected]>
+Date: Wed, 19 May 2021 13:19:49 -0700
+Subject: [PATCH] build: Respect $(LIBTOOL)
+
+downstream issue: https://bugs.gentoo.org/790812
+
+Signed-off-by: orbea <[email protected]>
+--- a/Makedefs.in
++++ b/Makedefs.in
+@@ -83,7 +83,6 @@ COMPILE_ENV = REPLISPDIR=$(top_builddir)/lisp \
+             REPDOCFILE=$(top_builddir)/doc-strings
+ 
+ include $(top_srcdir)/rules.mk
+-rep_LIBTOOL=@LIBTOOL@
+ 
+ # Rule for ``normal'' C objects
+ %.o : %.c
+--- a/rules.mk.in
++++ b/rules.mk.in
+@@ -3,19 +3,18 @@
+ repcommonexecdir?=$(shell pkg-config --variable=repcommonexecdir librep)
+ rpath_repcommonexecdir:=$(repcommonexecdir)
+ 
+-rep_LIBTOOL:=$(repcommonexecdir)/libtool --tag CC
+ rep_INSTALL_ALIASES:=$(repcommonexecdir)/install-aliases
+ 
+ # use this like:
+ # foo.la : foo.lo bar.lo
+ #     $(rep_DL_LD) link-opts...
+ 
+-rep_DL_LD=$(rep_LIBTOOL) --mode=link --tag=CC $(CC) -avoid-version -module 
-rpath $(rpath_repcommonexecdir)
++rep_DL_LD=$(LIBTOOL) --mode=link --tag=CC $(CC) -avoid-version -module -rpath 
$(rpath_repcommonexecdir)
+ 
+-rep_DL_INSTALL=$(rep_LIBTOOL) --mode=install $(INSTALL)
+-rep_DL_UNINSTALL=$(rep_LIBTOOL) --mode=uninstall rm
++rep_DL_INSTALL=$(LIBTOOL) --mode=install $(INSTALL)
++rep_DL_UNINSTALL=$(LIBTOOL) --mode=uninstall rm
+ 
+ # Rule for libtool controlled C objects
+ %.lo : %.c
+-      $(rep_LIBTOOL) --mode=compile --tag=CC $(CC) -c $(CPPFLAGS) $(CFLAGS) $<
++      $(LIBTOOL) --mode=compile --tag=CC $(CC) -c $(CPPFLAGS) $(CFLAGS) $<
+ 
+

diff --git a/dev-libs/librep/librep-0.92.7-r2.ebuild 
b/dev-libs/librep/librep-0.92.7-r2.ebuild
new file mode 100644
index 000000000000..a5a9d61b116a
--- /dev/null
+++ b/dev-libs/librep/librep-0.92.7-r2.ebuild
@@ -0,0 +1,83 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit autotools elisp-common flag-o-matic
+
+DESCRIPTION="Shared library implementing a Lisp dialect"
+HOMEPAGE="https://sawfish.fandom.com/";
+SRC_URI="https://download.tuxfamily.org/librep/${PN}_${PV}.tar.xz";
+S="${WORKDIR}/${PN}_${PV}"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~ia64 ~ppc ~ppc64 ~sparc ~x86"
+IUSE="emacs gmp readline"
+
+RDEPEND="
+       >=sys-libs/gdbm-1.8.0:=
+       virtual/libcrypt:=
+       emacs? ( >=app-editors/emacs-23.1:* )
+       gmp? ( dev-libs/gmp:= )
+       readline? ( sys-libs/readline:0= )
+"
+DEPEND="${RDEPEND}"
+BDEPEND="
+       sys-apps/texinfo
+"
+
+PATCHES=(
+       "${FILESDIR}"/${PN}-0.92.0-disable-elisp.patch
+       "${FILESDIR}"/${P}-libtool.patch
+       "${FILESDIR}"/${PN}-0.92.7-configure-clang16.patch
+)
+
+src_prepare() {
+       default
+
+       # The configure script is missing from this version.
+       eautoreconf
+}
+
+src_configure() {
+       # fix #570072 by restoring pre-GCC5 inline semantics
+       append-cflags -std=gnu89
+
+       econf \
+               $(use_with gmp) \
+               $(use_with readline) \
+               --libexecdir=/usr/$(get_libdir) \
+               --without-ffi
+}
+
+src_compile() {
+       default
+
+       if use emacs; then
+               elisp-compile rep-debugger.el || die "elisp-compile failed"
+       fi
+}
+
+src_install() {
+       default
+
+       find "${D}" -name '*.la' -delete || die
+       find "${D}/usr/share/man" -name '*.gz' -exec gunzip {} \; || die
+
+       dodoc doc/*
+
+       if use emacs; then
+               elisp-install ${PN} rep-debugger.{el,elc} || die "elisp-install 
failed"
+               elisp-site-file-install "${FILESDIR}/50${PN}-gentoo.el" \
+                       || die "elisp-site-file-install failed"
+       fi
+}
+
+pkg_postinst() {
+       use emacs && elisp-site-regen
+}
+
+pkg_postrm() {
+       use emacs && elisp-site-regen
+}

Reply via email to