commit:     e2969e5bc45ec484cd75e6aaf0d403a7a14044d1
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Mar  6 06:26:48 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Mar  6 06:28:36 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e2969e5b

dev-libs/libofx: fix libdir for OpenSP, doc fixes

* Fix libdir for OpenSP (respect --libdir)
* Enable building HTML docs (we looked for Doxygen but didn't use it)
* Use patches being upstreamed for respecting libdir + docdir

See: https://github.com/libofx/libofx/pull/40
Closes: https://bugs.gentoo.org/693458
Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-libs/libofx/files/libofx-0.10.1-docdir.patch   | 41 ++++++++++++++++++++++
 .../libofx/files/libofx-0.10.1-opensp-libdir.patch | 38 ++++++++++++++++++++
 dev-libs/libofx/libofx-0.10.1-r1.ebuild            | 18 +++++++---
 3 files changed, 93 insertions(+), 4 deletions(-)

diff --git a/dev-libs/libofx/files/libofx-0.10.1-docdir.patch 
b/dev-libs/libofx/files/libofx-0.10.1-docdir.patch
new file mode 100644
index 00000000000..f99730daa02
--- /dev/null
+++ b/dev-libs/libofx/files/libofx-0.10.1-docdir.patch
@@ -0,0 +1,41 @@
+https://github.com/libofx/libofx/pull/40
+
+From 379745ff481f2cc99f96836de0307b8074bf0788 Mon Sep 17 00:00:00 2001
+From: Sam James <s...@gentoo.org>
+Date: Sat, 6 Mar 2021 06:09:11 +0000
+Subject: [PATCH] Makefile.am, doc/Makefile.am: don't override docdir
+
+'docdir' is already provided by autotools. By not overriding it,
+we allow the directory to be easily overriden at build time.
+
+By default, docdir is /usr/share/doc/libofx, so no change!
+
+e.g. In Gentoo, we prefer to use --docdir=/usr/share/doc/${PF}
+where ${PF} represents the upstream version combined with any
+internal distribution changes made.
+
+Signed-off-by: Sam James <s...@gentoo.org>
+
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -6,8 +6,6 @@ endif
+ DIST_SUBDIRS = m4 inc dtd lib doc . ofx2qif ofxdump ofxconnect
+ SUBDIRS = m4 inc dtd lib doc . ofx2qif ofxdump $(MAYBE_OFXCONNECT)
+ 
+-docdir = $(datadir)/doc/libofx
+-
+ doc_DATA = \
+   AUTHORS \
+   COPYING \
+diff --git a/doc/Makefile.am b/doc/Makefile.am
+index 23e9d34..bd0a04d 100644
+--- a/doc/Makefile.am
++++ b/doc/Makefile.am
+@@ -1,7 +1,5 @@
+ SUBDIRS =
+ 
+-docdir = ${prefix}/share/doc/libofx
+-
+ EXTRA_DIST = \
+       doxygen.cfg \
+       ofx_sample_files \

diff --git a/dev-libs/libofx/files/libofx-0.10.1-opensp-libdir.patch 
b/dev-libs/libofx/files/libofx-0.10.1-opensp-libdir.patch
new file mode 100644
index 00000000000..548d0ec9cff
--- /dev/null
+++ b/dev-libs/libofx/files/libofx-0.10.1-opensp-libdir.patch
@@ -0,0 +1,38 @@
+https://github.com/libofx/libofx/pull/40
+
+From a8f262bf557f4d49e8dbdf4e1082879020b7c7b9 Mon Sep 17 00:00:00 2001
+From: Sam James <s...@gentoo.org>
+Date: Sat, 6 Mar 2021 05:57:49 +0000
+Subject: [PATCH] configure.ac: Respect --libdir for OpenSP
+
+When searching for OpenSP, we want to use
+the libdir passed in to autotools (--libdir)
+to ensure that we find the library
+for the correct ABI.
+
+It is possible that we pick up the wrong
+copy from e.g. /usr/lib/ where a 32-bit
+copy of OpenSP exists
+when we're in the middle of a 64-bit build.
+
+Use ${libdir} to ensure we respect
+any preferences/information given and
+search for OpenSP in the right place.
+
+Bug: https://bugs.gentoo.org/693458
+Signed-off-by: Sam James <s...@gentoo.org>
+
+--- a/configure.ac
++++ b/configure.ac
+@@ -110,9 +110,9 @@ AC_ARG_WITH(opensp-includes,
+ 
+ AC_ARG_WITH(opensp-libs,
+ [  --with-opensp-libs=PATH         specify where to look for libosp
+-                                  - default is /usr/lib],
++                                  - default is /usr/lib}],
+                       OPENSPLIBPATH="$with_opensp_libs",
+-                      OPENSPLIBPATH="/usr/lib")
++                      OPENSPLIBPATH="${libdir}")
+ 
+                       echo $OPENSPLIBPATH
+ for d in /usr/include/OpenSP /usr/local/include/OpenSP 
/usr/include/sp/generic /usr/local/include/sp/generic; do

diff --git a/dev-libs/libofx/libofx-0.10.1-r1.ebuild 
b/dev-libs/libofx/libofx-0.10.1-r1.ebuild
index 0db669fdea8..11e25cba6dd 100644
--- a/dev-libs/libofx/libofx-0.10.1-r1.ebuild
+++ b/dev-libs/libofx/libofx-0.10.1-r1.ebuild
@@ -12,13 +12,14 @@ 
SRC_URI="https://github.com/${PN}/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
 LICENSE="GPL-2"
 SLOT="0/10"
 KEYWORDS="amd64 ~arm64 ppc ppc64 x86"
-IUSE="test"
+IUSE="doc test"
 RESTRICT="!test? ( test )"
 
 BDEPEND="
        dev-util/gengetopt
        sys-apps/help2man
        virtual/pkgconfig
+       doc? ( app-doc/doxygen )
        test? ( app-crypt/gnupg )
 "
 RDEPEND="
@@ -30,13 +31,16 @@ RDEPEND="
 "
 DEPEND="${RDEPEND}"
 
+PATCHES=(
+       "${FILESDIR}"/libofx-0.10.1-opensp-libdir.patch
+       "${FILESDIR}"/libofx-0.10.1-docdir.patch
+)
+
 src_prepare() {
        default
 
        # Not included in the tarball
        sed -i -e '/INSTALL/d' Makefile.am || die
-       # Use correct location for docs
-       sed -i -e 's:doc/libofx:doc/${PF}:' Makefile.am doc/Makefile.am || die
 
        # bug #566456
        append-cxxflags -std=c++14
@@ -45,11 +49,17 @@ src_prepare() {
 }
 
 src_configure() {
-       econf --disable-static
+       econf \
+               $(use_enable doc html-docs) \
+               --disable-static
 }
 
 src_compile() {
        emake -j1
+
+       if use doc ; then
+               emake doc
+       fi
 }
 
 src_install() {

Reply via email to