From 59c01aa16c4fa08f72ddda72855db11a8bd98ba29b37b224537a08fe5b0f425e Mon Sep 17 00:00:00 2001
From: David Anes <david.anes@suse.com>
Date: Mon, 25 Mar 2024 11:34:27 +0000
Subject: [PATCH] Accepting request 1160609 from
 home:favogt:branches:openSUSE:Factory:Staging:M

A bit of an RFC.

- Drop BuildRequires on latex2man, the tarball has manpages already.
  This avoids a large dependency chain:
  * Add dont-disable-documentation-without-latex2man.patch

OBS-URL: https://build.opensuse.org/request/show/1160609
OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/libunwind?expand=0&rev=72
---
 ...able-documentation-without-latex2man.patch | 33 +++++++++++++++++++
 libunwind.changes                             |  7 ++++
 libunwind.spec                                |  3 +-
 3 files changed, 42 insertions(+), 1 deletion(-)
 create mode 100644 dont-disable-documentation-without-latex2man.patch

diff --git a/dont-disable-documentation-without-latex2man.patch b/dont-disable-documentation-without-latex2man.patch
new file mode 100644
index 0000000..9a34e70
--- /dev/null
+++ b/dont-disable-documentation-without-latex2man.patch
@@ -0,0 +1,33 @@
+From 1e849719a1035f34f44873a44a3d6266a59a5f1d Mon Sep 17 00:00:00 2001
+From: Ross Burton <ross.burton@arm.com>
+Date: Thu, 18 Jan 2024 12:59:37 +0000
+Subject: [PATCH] configure: don't disable documentation if latex2man isn't
+ present
+
+latex2man is only needed to generate the manpages from the LaTeX
+sources, but as the git repository has pregenerated manpages in (and so
+do the tarballs) this tool is only needed if the sources have been
+changed.
+
+Instead of turning off documentation,  just warn that the manpages
+cannot be rebuilt.
+
+Signed-off-by: Ross Burton <ross.burton@arm.com>
+---
+ configure.ac | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 406f3773c..7744251b5 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -297,8 +297,7 @@ AC_ARG_ENABLE([documentation],
+ AC_MSG_RESULT([$enable_documentation])
+ AC_PATH_PROG([LATEX2MAN],[latex2man])
+ AS_IF([test "x$LATEX2MAN" = "x" && test "x$enable_documentation" != "xno"], [
+-  AC_MSG_WARN([latex2man not found. Install latex2man. Disabling docs.])
+-  enable_documentation="no";
++  AC_MSG_WARN([latex2man not found, unable to regenerate the manpages])
+ ])
+ AM_CONDITIONAL([CONFIG_DOCS], [test x$enable_documentation != xno])
+ AM_COND_IF([CONFIG_DOCS], [AC_CONFIG_FILES([doc/Makefile doc/common.tex])])
diff --git a/libunwind.changes b/libunwind.changes
index 0addc9d..9e35e3d 100644
--- a/libunwind.changes
+++ b/libunwind.changes
@@ -1,3 +1,10 @@
+-------------------------------------------------------------------
+Fri Mar 22 09:28:07 UTC 2024 - Fabian Vogt <fvogt@suse.com>
+
+- Drop BuildRequires on latex2man, the tarball has manpages already.
+  This avoids a large dependency chain:
+  * Add dont-disable-documentation-without-latex2man.patch
+
 -------------------------------------------------------------------
 Fri Feb 23 11:43:14 UTC 2024 - Pedro Monreal <pmonreal@suse.com>
 
diff --git a/libunwind.spec b/libunwind.spec
index b345c1a..25f9cd1 100644
--- a/libunwind.spec
+++ b/libunwind.spec
@@ -34,12 +34,13 @@ Source0:        https://github.com/libunwind/libunwind/releases/download/v%{vers
 Source1:        https://github.com/libunwind/libunwind/releases/download/v%{version}/%{name}-%{version}.tar.gz.asc#/%{name}-%{version}.tar.gz.asc
 Source2:        %{name}.keyring
 Source3:        baselibs.conf
+# PATCH-FIX-UPSTREAM https://github.com/libunwind/libunwind/pull/712
+Patch1:         dont-disable-documentation-without-latex2man.patch
 BuildRequires:  automake >= 1.14
 BuildRequires:  gcc-c++
 BuildRequires:  libtool
 BuildRequires:  lzma-devel
 BuildRequires:  pkgconfig
-BuildRequires:  texlive-latex2man
 ExcludeArch:    s390
 
 %description