commit:     ac2eef59aae978a9c5c530de067bc4b28ab37ff0
Author:     Jakov Smolic <jakov.smolic <AT> sartura <DOT> hr>
AuthorDate: Sun Jan  3 21:39:23 2021 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Sun Jan  3 21:39:23 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ac2eef59

dev-db/repmgr: Fix build with gcc-10

Closes: https://bugs.gentoo.org/733304
Package-Manager: Portage-3.0.12, Repoman-3.0.2
Signed-off-by: Jakov Smolic <jakov.smolic <AT> sartura.hr>
Signed-off-by: David Seifert <soap <AT> gentoo.org>

 dev-db/repmgr/files/repmgr-5.1.0-fno-common.patch | 51 +++++++++++++++++++++++
 dev-db/repmgr/repmgr-5.1.0.ebuild                 | 32 ++++++++------
 2 files changed, 70 insertions(+), 13 deletions(-)

diff --git a/dev-db/repmgr/files/repmgr-5.1.0-fno-common.patch 
b/dev-db/repmgr/files/repmgr-5.1.0-fno-common.patch
new file mode 100644
index 00000000000..c5450291dbb
--- /dev/null
+++ b/dev-db/repmgr/files/repmgr-5.1.0-fno-common.patch
@@ -0,0 +1,51 @@
+--- a/repmgr-action-cluster.c
++++ b/repmgr-action-cluster.c
+@@ -26,6 +26,7 @@
+ 
+ #define SHOW_HEADER_COUNT 9
+ 
++extern t_conninfo_param_list source_conninfo;
+ typedef enum
+ {
+       SHOW_ID = 0,
+--- a/repmgr-action-node.c
++++ b/repmgr-action-node.c
+@@ -32,6 +32,7 @@
+ #include "repmgr-action-node.h"
+ #include "repmgr-action-standby.h"
+ 
++extern t_conninfo_param_list source_conninfo;
+ static bool copy_file(const char *src_file, const char *dest_file);
+ static void format_archive_dir(PQExpBufferData *archive_dir);
+ static t_server_action parse_server_action(const char *action);
+--- a/repmgr-action-service.c
++++ b/repmgr-action-service.c
+@@ -26,6 +26,7 @@
+ #include "repmgr-client-global.h"
+ #include "repmgr-action-service.h"
+ 
++extern t_conninfo_param_list source_conninfo;
+ 
+ /*
+  * Possibly also show:
+--- a/repmgr-action-witness.c
++++ b/repmgr-action-witness.c
+@@ -28,6 +28,7 @@
+ #include "repmgr-client-global.h"
+ #include "repmgr-action-witness.h"
+ 
++extern t_conninfo_param_list source_conninfo;
+ static char           repmgr_user[MAXLEN];
+ static char           repmgr_db[MAXLEN];
+ 
+--- a/repmgr-client-global.h
++++ b/repmgr-client-global.h
+@@ -236,7 +236,7 @@ typedef struct ColHeader
+ extern t_runtime_options runtime_options;
+ extern t_configuration_options config_file_options;
+ 
+-t_conninfo_param_list source_conninfo;
++extern t_conninfo_param_list source_conninfo;
+ 
+ 
+ extern bool config_file_required;

diff --git a/dev-db/repmgr/repmgr-5.1.0.ebuild 
b/dev-db/repmgr/repmgr-5.1.0.ebuild
index 06a26ac1e9b..2691cff5714 100644
--- a/dev-db/repmgr/repmgr-5.1.0.ebuild
+++ b/dev-db/repmgr/repmgr-5.1.0.ebuild
@@ -1,38 +1,44 @@
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
-inherit eutils multilib
+
 DESCRIPTION="PostgreSQL Replication Manager"
 HOMEPAGE="http://www.repmgr.org/";
 SRC_URI="http://www.repmgr.org/download/${P}.tar.gz";
+
 LICENSE="GPL-3"
 SLOT="0"
 KEYWORDS="~amd64 ~x86"
 
-IUSE=""
-
-DEPEND=">=dev-db/postgresql-9.3[server,static-libs]"
+DEPEND="dev-db/postgresql:*[server,static-libs]"
 RDEPEND="${DEPEND}
        net-misc/rsync"
 
+PATCHES=( "${FILESDIR}"/${P}-fno-common.patch )
+
 src_compile() {
        emake USE_PGXS=1
 }
 
 src_install() {
        emake DESTDIR="${D}" USE_PGXS=1 install
-       export PGSLOT="$(postgresql-config show)"
+       dodoc CREDITS HISTORY COPYRIGHT *.md
+
+       local PGSLOT="$(postgresql-config show)"
        einfo "PGSLOT: ${PGSLOT}"
-       PGBASEDIR=/usr/$(get_libdir)/postgresql-${PGSLOT}
-       PGBINDIR=${PGBASEDIR}/bin/
-       PGCONTRIB=/usr/share/postgresql-${PGSLOT}/contrib/
-       dodir $PGCONTRIB $PGBINDIR
-       dosym $PGBINDIR/repmgr /usr/bin/repmgr${PGSLOT//.}
-       dosym $PGBINDIR/repmgrd /usr/bin/repmgrd${PGSLOT//.}
-       dodoc  CREDITS HISTORY COPYRIGHT *.md
+
+       dodir /usr/share/postgresql-${PGSLOT}/contrib
+       dodir /usr/$(get_libdir)/postgresql-${PGSLOT}
+
+       local repmgr="/usr/bin/repmgr${PGSLOT//.}"
+       local repmgrd="/usr/bin/repmgrd${PGSLOT//.}"
+       dosym ../$(get_libdir)/postgresql-${PGSLOT}/bin/repmgr ${repmgr}
+       dosym ../$(get_libdir)/postgresql-${PGSLOT}/bin/repmgrd ${repmgrd}
+
        insinto /etc
        newins repmgr.conf.sample repmgr.conf
+
        fowners postgres:postgres /etc/repmgr.conf
        ewarn "Remember to modify /etc/repmgr.conf"
 }

Reply via email to