git: 43ecb9346397 - main - databases/pgbackrest: update to 2.51

From: Zsolt Udvari <uzsolt_at_FreeBSD.org>
Date: Sat, 27 Apr 2024 05:48:50 UTC
The branch main has been updated by uzsolt:

URL: https://cgit.FreeBSD.org/ports/commit/?id=43ecb93463973dbe210d4fd5dc2158b962a012bc

commit 43ecb93463973dbe210d4fd5dc2158b962a012bc
Author:     Michael Schout <schoutm@gmail.com>
AuthorDate: 2024-04-14 16:08:30 +0000
Commit:     Zsolt Udvari <uzsolt@FreeBSD.org>
CommitDate: 2024-04-27 05:48:06 +0000

    databases/pgbackrest: update to 2.51
    
    Switch to meson build system.
    Rename option SSH to SFTP.
    
    The origin of patch is
    https://github.com/pgbackrest/pgbackrest/commit/7b95fd3bd29346e7325aa161bfee45efd71e22eb
    It is upstreamed and can remove it at update to 2.52.
    
    Changelog: https://pgbackrest.org/release.html#2.51
    
    PR:             276559
    Approved by:    diizzy (mentor)
    Differential Revision:  https://reviews.freebsd.org/D44791
---
 databases/pgbackrest/Makefile                      | 30 +++++++++++++---------
 databases/pgbackrest/distinfo                      |  6 ++---
 databases/pgbackrest/files/patch-meson.build       | 28 ++++++++++++++++++++
 .../pgbackrest/files/patch-meson__options.txt      |  8 ++++++
 databases/pgbackrest/files/patch-src_meson.build   | 10 ++++++++
 5 files changed, 67 insertions(+), 15 deletions(-)

diff --git a/databases/pgbackrest/Makefile b/databases/pgbackrest/Makefile
index 99d7f8a1cb99..49b628288584 100644
--- a/databases/pgbackrest/Makefile
+++ b/databases/pgbackrest/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	pgbackrest
 DISTVERSIONPREFIX=	release/
-DISTVERSION=	2.49
+DISTVERSION=	2.51
 CATEGORIES=	databases
 
 MAINTAINER=	schoutm@gmail.com
@@ -8,31 +8,37 @@ COMMENT=	Reliable PostgreSQL Backup & Restore
 WWW=		https://pgbackrest.org/
 
 LICENSE=	MIT
-LICENSE_FILE=	${WRKSRC}/../LICENSE
+LICENSE_FILE=	${WRKSRC}/LICENSE
 
 LIB_DEPENDS=	liblz4.so:archivers/liblz4 \
 		libyaml.so:textproc/libyaml
 
-USES=		gmake gnome pkgconfig pgsql ssl
+USES=		gnome meson pgsql pkgconfig python ssl
+USE_GITHUB=	yes
 USE_GNOME=	libxml2
-GNU_CONFIGURE=	yes
 
-USE_GITHUB=	yes
+MESON_ARGS+=	-Dconfigdir="${LOCALBASE}/etc/pgbackrest"
+
+BINARY_ALIAS=	python3=${PYTHON_CMD}
 
-WRKSRC_SUBDIR=	src
+OPTIONS_DEFINE=		LZ4 SFTP ZSTD
+OPTIONS_DEFAULT=	LZ4
 
-ALL_TARGET=
+SFTP_DESC=	Enable SFTP storage support
 
-CONFIGURE_ARGS=	--with-configdir="${LOCALBASE}/etc/pgbackrest"
+LZ4_LIB_DEPENDS=	liblz4.so:archivers/liblz4
+LZ4_MESON_ON=		-Dliblz4=enabled
+LZ4_MESON_OFF=		-Dliblz4=disabled
 
-OPTIONS_DEFINE=	ZSTD
+SFTP_LIB_DEPENDS=	libssh2.so:security/libssh2
+SFTP_MESON_ON=		-Dlibssh2=enabled
+SFTP_MESON_OFF=		-Dlibssh2=disabled
 
 ZSTD_LIB_DEPENDS=	libzstd.so:archivers/zstd
-ZSTD_CONFIGURE_OFF=	ac_cv_lib_zstd_ZSTD_isError=no
-ZSTD_CONFIGURE_ON=	ac_cv_lib_zstd_ZSTD_isError=yes
+ZSTD_MESON_ON=		-Dlibzstd=enabled
+ZSTD_MESON_OFF=		-Dlibzstd=disabled
 
 post-install:
-	${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/pgbackrest
 	${MKDIR} ${STAGEDIR}${PREFIX}/etc/pgbackrest
 
 .include <bsd.port.mk>
diff --git a/databases/pgbackrest/distinfo b/databases/pgbackrest/distinfo
index f3db3ba835a5..1f96f8d089b8 100644
--- a/databases/pgbackrest/distinfo
+++ b/databases/pgbackrest/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1704919820
-SHA256 (pgbackrest-pgbackrest-release-2.49_GH0.tar.gz) = 32a2d1bd504cc13f6e01533811104da39e2e842cdd8a7ba87293021cf03162f3
-SIZE (pgbackrest-pgbackrest-release-2.49_GH0.tar.gz) = 6162457
+TIMESTAMP = 1712155789
+SHA256 (pgbackrest-pgbackrest-release-2.51_GH0.tar.gz) = 9fa6760032927de448251fb1e5b824e2d17caf560796e74947275b72dc20ed2a
+SIZE (pgbackrest-pgbackrest-release-2.51_GH0.tar.gz) = 6119922
diff --git a/databases/pgbackrest/files/patch-meson.build b/databases/pgbackrest/files/patch-meson.build
new file mode 100644
index 000000000000..96a8b063da4b
--- /dev/null
+++ b/databases/pgbackrest/files/patch-meson.build
@@ -0,0 +1,28 @@
+--- meson.build.orig	2024-04-10 11:23:05 UTC
++++ meson.build
+@@ -144,7 +144,7 @@ lib_bz2 = cc.find_library('bz2')
+ lib_bz2 = cc.find_library('bz2')
+ 
+ # Find optional lz4 library
+-lib_lz4 = dependency('liblz4', required: false)
++lib_lz4 = dependency('liblz4', required: get_option('liblz4'))
+ 
+ if lib_lz4.found()
+     configuration.set('HAVE_LIBLZ4', true, description: 'Is liblz4 present?')
+@@ -168,14 +168,14 @@ configuration.set('ZLIB_CONST', true, description: 'Re
+ configuration.set('ZLIB_CONST', true, description: 'Require zlib const input buffer')
+ 
+ # Find optional libssh2 library
+-lib_ssh2 = dependency('libssh2', required: false)
++lib_ssh2 = dependency('libssh2', required: get_option('libssh2'))
+ 
+ if lib_ssh2.found()
+     configuration.set('HAVE_LIBSSH2', true, description: 'Is libssh2 present?')
+ endif
+ 
+ # Find optional zstd library
+-lib_zstd = dependency('libzstd', version: '>=1.0', required: false)
++lib_zstd = dependency('libzstd', version: '>=1.0', required: get_option('libzstd'))
+ 
+ if lib_zstd.found()
+     configuration.set('HAVE_LIBZST', true, description: 'Is libzstd present?')
diff --git a/databases/pgbackrest/files/patch-meson__options.txt b/databases/pgbackrest/files/patch-meson__options.txt
new file mode 100644
index 000000000000..30bdd3e9599f
--- /dev/null
+++ b/databases/pgbackrest/files/patch-meson__options.txt
@@ -0,0 +1,8 @@
+--- meson_options.txt.orig	2024-03-24 20:53:22 UTC
++++ meson_options.txt
+@@ -1,2 +1,5 @@ option('fatal-errors', type: 'boolean', value: false, 
+ option('configdir', type: 'string', value: '/etc/pgbackrest', description: 'Configuration directory')
+ option('fatal-errors', type: 'boolean', value: false, description: 'Stop compilation on first error')
++option('liblz4', type: 'feature', value: 'auto', description: 'Enable LZ4 compression support')
++option('libssh2', type: 'feature', value: 'auto', description: 'Enable SFTP storage support')
++option('libzstd', type: 'feature', value: 'auto', description: 'Enable Zstandard compression support')
diff --git a/databases/pgbackrest/files/patch-src_meson.build b/databases/pgbackrest/files/patch-src_meson.build
new file mode 100644
index 000000000000..3ea71633e6c1
--- /dev/null
+++ b/databases/pgbackrest/files/patch-src_meson.build
@@ -0,0 +1,10 @@
+--- src/meson.build.orig	2024-03-24 20:53:22 UTC
++++ src/meson.build
+@@ -284,5 +284,6 @@ executable(
+         lib_xml,
+         lib_z,
+         lib_zstd,
+-    ]
++    ],
++    install: true,
+ )