Index | Thread | Search

From:
Bryan Vyhmeister <bryan@bsdjournal.net>
Subject:
Re: [PATCH] rsync add zstd,lz4,iconv options as default and -minimal flavor
To:
ports@openbsd.org
Date:
Wed, 3 Jul 2024 01:08:16 -0700

Download raw body.

Thread
On Tue, Jul 02, 2024 at 10:29:14PM +0200, Jeremie Courreges-Anglas wrote:
> People were complaining that it pushed too many deps, both for the
> package and for the port.  The 'minimal' FLAVOR should cover that.
> 
> > @@ -35,7 +33,10 @@ CONFIGURE_ARGS =--disable-lz4 \
> >  		--with-nobody-user=_rsync \
> >  		--with-nobody-group=_rsync
> >  CONFIGURE_ENV +=CPPFLAGS="-I${LOCALBASE}/include -DXXH_INLINE_ALL=1" \
> > -		ac_cv_search_XXH64_createState=""
> > +		LDFLAGS='-L${LOCALBASE}/lib' ac_cv_search_XXH64_createState=""
> > +LIB_DEPENDS +=	archivers/lz4 \
> > +		archivers/zstd \
> > +		converters/libiconv
> >  
> >  .include <bsd.port.arch.mk>
> >  
> > @@ -43,10 +44,11 @@ CONFIGURE_ENV +=CPPFLAGS="-I${LOCALBASE}
> >  CONFIGURE_ARGS +=--enable-md5-asm
> >  .endif
> >  
> > -.if ${FLAVOR:Miconv}
> > -CONFIGURE_ENV +=LDFLAGS='-L${LOCALBASE}/lib'
> > -LIB_DEPENDS +=	converters/libiconv
> > -WANTLIB +=	iconv
> > +.if ${FLAVOR:Mminimal}
> > +CONFIGURE_ARGS +=--disable-lz4 \
> > +		--disable-zstd
> > +WANTLIB =	c crypto
> > +LIB_DEPENDS =
> >  .endif
> 
> Not tested but I'm pretty sure that this results in iconv being picked
> up in the !minimal case.  You're adding -L/usr/local/lib to LDFLAGS
> unconditionally, but don't prevent iconv from being picked up.
> Preventing that is a bit ugly, see my earlier diff in this thread.
> 
> I suggest you don't reverse the existing logic for CONFIGURE_ENV,
> WANTLIB and LIB_DEPENDS, just add stuff as needed for the !minimal
> FLAVOR:
> 
> .if !${FLAVOR:Mminimal}
> CONFIGURE_ENV +=	LDFLAGS='-L${LOCALBASE}/lib'
> LIB_DEPENDS +=   	archivers/lz4 etc
> WANTLIB +=  	     	blah blah
> .endif

Good catch. That's a very good idea I had not considered. Seems to work
perfectly with the logic reversed. Here is the updated diff.

Bryan



Index: net/rsync/Makefile
===================================================================
RCS file: /cvs/ports/net/rsync/Makefile,v
diff -u -p -u -r1.103 Makefile
--- net/rsync/Makefile	6 May 2024 12:23:48 -0000	1.103
+++ net/rsync/Makefile	3 Jul 2024 07:56:56 -0000
@@ -3,9 +3,9 @@ COMMENT =	mirroring/synchronization over
 DISTNAME =	rsync-3.3.0
 CATEGORIES =	net
 HOMEPAGE =	https://rsync.samba.org/
-REVISION =	0
+REVISION =	1
 
-FLAVORS =	iconv
+FLAVORS =	minimal
 FLAVOR ?=
 
 # GPLv3
@@ -43,10 +43,14 @@ CONFIGURE_ENV +=CPPFLAGS="-I${LOCALBASE}
 CONFIGURE_ARGS +=--enable-md5-asm
 .endif
 
-.if ${FLAVOR:Miconv}
+.if !${FLAVOR:Mminimal}
+CONFIGURE_ARGS +=--enable-lz4 \
+		--enable-zstd
 CONFIGURE_ENV +=LDFLAGS='-L${LOCALBASE}/lib'
-LIB_DEPENDS +=	converters/libiconv
-WANTLIB +=	iconv
+LIB_DEPENDS +=	archivers/lz4 \
+		archivers/zstd \
+		converters/libiconv
+WANTLIB +=	iconv lz4 zstd
 .endif
 
 DOCDIR =	${PREFIX}/share/doc/rsync
Index: net/rsync/pkg/DESCR
===================================================================
RCS file: /cvs/ports/net/rsync/pkg/DESCR,v
diff -u -p -u -r1.6 DESCR
--- net/rsync/pkg/DESCR	26 Apr 2024 13:26:27 -0000	1.6
+++ net/rsync/pkg/DESCR	3 Jul 2024 07:57:10 -0000
@@ -7,11 +7,12 @@ its delta-transfer algorithm, which redu
 over the network by sending only the differences between the source
 files and the existing files in the destination. Rsync is widely
 used for backups and mirroring and as an improved copy command for
-everyday use.
+everyday use. This also includes options for lz4 and zstd compression
+as well as iconv for people wanting to bring files from other OSes 
+with more versatile filenames.
 
-Flavor: iconv
-    extra dependency, for people wanting to bring files from other OSes with
-    more versatile filenames.
+Flavor: minimal
+    without any extra dependencies of iconv, lz4, and zstd.
 
 To use the rrsync wrapper, python3 should be installed.
 
Index: net/rsync/pkg/PFRAG.no-minimal
===================================================================
RCS file: net/rsync/pkg/PFRAG.no-minimal
diff -N net/rsync/pkg/PFRAG.no-minimal
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ net/rsync/pkg/PFRAG.no-minimal	3 Jul 2024 07:57:10 -0000
@@ -0,0 +1 @@
+@pkgpath net/rsync,iconv
Index: net/rsync/pkg/PLIST
===================================================================
RCS file: /cvs/ports/net/rsync/pkg/PLIST,v
diff -u -p -u -r1.18 PLIST
--- net/rsync/pkg/PLIST	8 Nov 2022 11:17:01 -0000	1.18
+++ net/rsync/pkg/PLIST	3 Jul 2024 07:57:10 -0000
@@ -11,3 +11,4 @@ bin/rsync-ssl
 share/doc/rsync/
 share/doc/rsync/tech_report.tex
 @extra ${SYSCONFDIR}/rsyncd.conf
+!%%minimal%%