Re: UPDATE net/unison-2.53.4

2024-02-22 Thread Jeremie Courreges-Anglas
Le Tue, Feb 20, 2024 at 08:42:23PM +0100, Bjorn Ketelaars a écrit :
> On Tue 20/02/2024 11:30, Jeremie Courreges-Anglas wrote:
> > On Mon, Feb 19 2024, Bjorn Ketelaars  wrote:
> > > Diff below updates net/unison to 2.53.4, which includes bug fixes, minor
> > > improvements and clean-ups. Release notes:
> > > https://github.com/bcpierce00/unison/releases/tag/v2.53.4.
> > >
> > > Change in the build system is that the gtk3 flavor of unison is
> > > renamed to unison-gui. This is undone in the diff below by setting the
> > > correct binary and renaming it in the do-install phase. I'm not sure
> > > if this is the way to go, or if there is a better way to do this.
> > 
> > If lablgtk3 is installed then both unison and unison-gui are built, with
> > or without FLAVOR=no_x11.  The problem is you're *adding* to MAKE_FLAGS
> > instead of *setting* ALL_TARGET=gui/tui.
> > 
> > Now that the build system lets you build both, it would be interesting
> > to use MULTI_PACKAGES, with a -gui subpackage shipping just the
> > unison-gui program and carrying the gtk3 dep.  With proper @pkgpaths the
> > upgrade path would be mostly transparent for users (gotta retrain their
> > fingers to type unison-gui when needed).
> > 
> > Additionally no_x11 could stay as a PSEUDO_FLAVOR so that people can
> > build and install the tui program/package without having lablgtk3
> > installed.
> 
> New diff, which addresses Jeremie's feedback:
> - uses MULTI_PACKAGES (with a -x11 subpackage);
> - no_x11 as PSEUDO_FLAVOR;
> - updated @pkgpath markers;
> - added quirks entry;
> - updated net/Makefile.
>
> With this users are able to use `pkg_add -u` and:
> - update unison-2.53.3 to unison-x11-2.53.4 (pulls in unison-2.53.4 as
>   RDEP);
> - update unison-no_x11-2.53.3 to unison-2.53.4.
> 
> Comments/OK?

Looks mostly good, please see comments inline.

> diff --git devel/quirks/Makefile devel/quirks/Makefile
> index b52a6ca153c..29352025828 100644
> --- devel/quirks/Makefile
> +++ devel/quirks/Makefile
> @@ -3,7 +3,7 @@ CATEGORIES =  devel databases
>  DISTFILES =
>  
>  # API.rev
> -PKGNAME =quirks-7.6
> +PKGNAME =quirks-7.7
>  PKG_ARCH =   *
>  MAINTAINER = Marc Espie 
>  
> diff --git devel/quirks/files/Quirks.pm devel/quirks/files/Quirks.pm
> index a5641d20104..e0a8ce89fc4 100644
> --- devel/quirks/files/Quirks.pm
> +++ devel/quirks/files/Quirks.pm
> @@ -809,6 +809,8 @@ my $stem_extensions = {
>   'py-analyzemft' => 'py3-analyzemft',
>   'llama' => 'walk',
>   'py-setuptools-git' => 'py3-setuptools-git',
> + 'unison' => 'unison-x11',

This line is correct and needed for the upgrade path.

> + 'unison-no_x11' => 'unison',

This one looks incorrect: there never was a unison-no_x11 package
(rather unison--no_x11).  It's not needed for pkg_add -u to work so
you can just drop it.

>  };
>  
>  my $obsolete_reason = {};
> diff --git net/Makefile net/Makefile
> index eaee3c5bf66..370c6a22f70 100644
> --- net/Makefile
> +++ net/Makefile
> @@ -749,7 +749,6 @@
>   SUBDIR += uhttpmock
>   SUBDIR += unifi
>   SUBDIR += unison
> - SUBDIR += unison,no_x11
>   SUBDIR += unworkable
>   SUBDIR += usockets
>   SUBDIR += utox
> diff --git net/unison/Makefile net/unison/Makefile
> index d240adb9879..da4c1fef4e1 100644
> --- net/unison/Makefile
> +++ net/unison/Makefile
> @@ -2,12 +2,12 @@
>  USE_NOEXECONLY = yes
>  .endif
>  
> -COMMENT =multi-platform file synchronization tool
> +COMMENT-main =   multi-platform file synchronization tool
> +COMMENT-x11 =gtk3 based interface for unison

You're using the default unison-x11 package name for the GUI program.
Was there a reason not to name the package unison-gui instead, just
like the program it ships?  (Not objecting, just wondering.)

>  GH_ACCOUNT = bcpierce00
>  GH_PROJECT = unison
> -GH_TAGNAME = v2.53.3
> -REVISION =   2
> +GH_TAGNAME = v2.53.4
>  
>  CATEGORIES = net
>  
> @@ -16,47 +16,46 @@ MAINTAINER =  Bjorn Ketelaars 
>  # GPLv3
>  PERMIT_PACKAGE = Yes
>  
> -WANTLIB =c m util
> +WANTLIB =c m pthread util
> +WANTLIB-x11 =${WANTLIB} atk-1.0 cairo cairo-gobject fontconfig 
> freetype
> +WANTLIB-x11 +=   gdk-3 gdk_pixbuf-2.0 gio-2.0 glib-2.0 gobject-2.0 gtk-3
> +WANTLIB-x11 +=   harfbuzz intl pango-1.0 pangocairo-1.0
>  
>  MODULES =lang/ocaml
>  MODOCAML_RUNDEP =if-not-native
>  
> -USE_GMAKE =  Yes
> +LIB_DEPENDS-x11 =x11/gtk+3
> +RUN_DEPENDS-x11 =${BASE_PKGPATH},-main=${GH_TAGNAME:S/v//} \
> + devel/desktop-file-utils
>  
>  # CFLAGS _must_ be empty. This is an OCaml compiler.
>  MAKE_FLAGS = NATIVE=${MODOCAML_NATIVE:S/Yes/true/:S/No/false/} \
>   OCAMLOPT=ocamlopt.opt \
>   CFLAGS=
>  
> -FLAVORS =no_x11
> -FLAVOR ?=
> -
> -.if ${FLAVOR:Mno_x11}
> -MAKE_FLAGS +=UISTYLE=text
> -.else
> -WANTLIB +=   atk-1.0 cairo cairo-gobject fontconfig freetype gdk-3
> -WANTLIB +=   gdk_pixbuf-2.0 gio-2.0 glib-2.0 gobject-2.0 

Re: UPDATE net/unison-2.53.4

2024-02-20 Thread Bjorn Ketelaars
On Tue 20/02/2024 11:30, Jeremie Courreges-Anglas wrote:
> On Mon, Feb 19 2024, Bjorn Ketelaars  wrote:
> > Diff below updates net/unison to 2.53.4, which includes bug fixes, minor
> > improvements and clean-ups. Release notes:
> > https://github.com/bcpierce00/unison/releases/tag/v2.53.4.
> >
> > Change in the build system is that the gtk3 flavor of unison is
> > renamed to unison-gui. This is undone in the diff below by setting the
> > correct binary and renaming it in the do-install phase. I'm not sure
> > if this is the way to go, or if there is a better way to do this.
> 
> If lablgtk3 is installed then both unison and unison-gui are built, with
> or without FLAVOR=no_x11.  The problem is you're *adding* to MAKE_FLAGS
> instead of *setting* ALL_TARGET=gui/tui.
> 
> Now that the build system lets you build both, it would be interesting
> to use MULTI_PACKAGES, with a -gui subpackage shipping just the
> unison-gui program and carrying the gtk3 dep.  With proper @pkgpaths the
> upgrade path would be mostly transparent for users (gotta retrain their
> fingers to type unison-gui when needed).
> 
> Additionally no_x11 could stay as a PSEUDO_FLAVOR so that people can
> build and install the tui program/package without having lablgtk3
> installed.

New diff, which addresses Jeremie's feedback:
- uses MULTI_PACKAGES (with a -x11 subpackage);
- no_x11 as PSEUDO_FLAVOR;
- updated @pkgpath markers;
- added quirks entry;
- updated net/Makefile.

With this users are able to use `pkg_add -u` and:
- update unison-2.53.3 to unison-x11-2.53.4 (pulls in unison-2.53.4 as
  RDEP);
- update unison-no_x11-2.53.3 to unison-2.53.4.

Comments/OK?


diff --git devel/quirks/Makefile devel/quirks/Makefile
index b52a6ca153c..29352025828 100644
--- devel/quirks/Makefile
+++ devel/quirks/Makefile
@@ -3,7 +3,7 @@ CATEGORIES =devel databases
 DISTFILES =
 
 # API.rev
-PKGNAME =  quirks-7.6
+PKGNAME =  quirks-7.7
 PKG_ARCH = *
 MAINTAINER =   Marc Espie 
 
diff --git devel/quirks/files/Quirks.pm devel/quirks/files/Quirks.pm
index a5641d20104..e0a8ce89fc4 100644
--- devel/quirks/files/Quirks.pm
+++ devel/quirks/files/Quirks.pm
@@ -809,6 +809,8 @@ my $stem_extensions = {
'py-analyzemft' => 'py3-analyzemft',
'llama' => 'walk',
'py-setuptools-git' => 'py3-setuptools-git',
+   'unison' => 'unison-x11',
+   'unison-no_x11' => 'unison',
 };
 
 my $obsolete_reason = {};
diff --git net/Makefile net/Makefile
index eaee3c5bf66..370c6a22f70 100644
--- net/Makefile
+++ net/Makefile
@@ -749,7 +749,6 @@
  SUBDIR += uhttpmock
  SUBDIR += unifi
  SUBDIR += unison
- SUBDIR += unison,no_x11
  SUBDIR += unworkable
  SUBDIR += usockets
  SUBDIR += utox
diff --git net/unison/Makefile net/unison/Makefile
index d240adb9879..da4c1fef4e1 100644
--- net/unison/Makefile
+++ net/unison/Makefile
@@ -2,12 +2,12 @@
 USE_NOEXECONLY = yes
 .endif
 
-COMMENT =  multi-platform file synchronization tool
+COMMENT-main = multi-platform file synchronization tool
+COMMENT-x11 =  gtk3 based interface for unison
 
 GH_ACCOUNT =   bcpierce00
 GH_PROJECT =   unison
-GH_TAGNAME =   v2.53.3
-REVISION = 2
+GH_TAGNAME =   v2.53.4
 
 CATEGORIES =   net
 
@@ -16,47 +16,46 @@ MAINTAINER =Bjorn Ketelaars 
 # GPLv3
 PERMIT_PACKAGE =   Yes
 
-WANTLIB =  c m util
+WANTLIB =  c m pthread util
+WANTLIB-x11 =  ${WANTLIB} atk-1.0 cairo cairo-gobject fontconfig freetype
+WANTLIB-x11 += gdk-3 gdk_pixbuf-2.0 gio-2.0 glib-2.0 gobject-2.0 gtk-3
+WANTLIB-x11 += harfbuzz intl pango-1.0 pangocairo-1.0
 
 MODULES =  lang/ocaml
 MODOCAML_RUNDEP =  if-not-native
 
-USE_GMAKE =Yes
+LIB_DEPENDS-x11 =  x11/gtk+3
+RUN_DEPENDS-x11 =  ${BASE_PKGPATH},-main=${GH_TAGNAME:S/v//} \
+   devel/desktop-file-utils
 
 # CFLAGS _must_ be empty. This is an OCaml compiler.
 MAKE_FLAGS =   NATIVE=${MODOCAML_NATIVE:S/Yes/true/:S/No/false/} \
OCAMLOPT=ocamlopt.opt \
CFLAGS=
 
-FLAVORS =  no_x11
-FLAVOR ?=
-
-.if ${FLAVOR:Mno_x11}
-MAKE_FLAGS +=  UISTYLE=text
-.else
-WANTLIB += atk-1.0 cairo cairo-gobject fontconfig freetype gdk-3
-WANTLIB += gdk_pixbuf-2.0 gio-2.0 glib-2.0 gobject-2.0 gtk-3 harfbuzz
-WANTLIB += intl pango-1.0 pangocairo-1.0
-BUILD_DEPENDS +=   x11/lablgtk3
-LIB_DEPENDS += x11/gtk+3
-RUN_DEPENDS += devel/desktop-file-utils
-MAKE_FLAGS +=  UISTYLE=gtk3
-.endif
+USE_GMAKE =Yes
 
-FLAVOR_COMMA = ${FLAVOR_EXT:S/-/,/g}
-SUBST_VARS =   FLAVOR_COMMA
+MULTI_PACKAGES =   -main -x11
+PSEUDO_FLAVORS =   no_x11
+FLAVOR ?=
 
 PORTHOME = ${WRKDIR}
 DOCS = NEWS.md README.md
 
-# Avoid the nightmare of their Makefile install target.
+.include 
+
+.if ${BUILD_PACKAGES:M-x11}
+BUILD_DEPENDS =x11/lablgtk3
+.endif
+
 # Do not use INSTALL_PROGRAM, as the bytecode version must not be stripped!
 do-install:
${INSTALL_SCRIPT} ${WRKSRC}/src/unison 

Re: UPDATE net/unison-2.53.4

2024-02-20 Thread Jeremie Courreges-Anglas
On Mon, Feb 19 2024, Bjorn Ketelaars  wrote:
> Diff below updates net/unison to 2.53.4, which includes bug fixes, minor
> improvements and clean-ups. Release notes:
> https://github.com/bcpierce00/unison/releases/tag/v2.53.4.
>
> Change in the build system is that the gtk3 flavor of unison is
> renamed to unison-gui. This is undone in the diff below by setting the
> correct binary and renaming it in the do-install phase. I'm not sure
> if this is the way to go, or if there is a better way to do this.

If lablgtk3 is installed then both unison and unison-gui are built, with
or without FLAVOR=no_x11.  The problem is you're *adding* to MAKE_FLAGS
instead of *setting* ALL_TARGET=gui/tui.

Now that the build system lets you build both, it would be interesting
to use MULTI_PACKAGES, with a -gui subpackage shipping just the
unison-gui program and carrying the gtk3 dep.  With proper @pkgpaths the
upgrade path would be mostly transparent for users (gotta retrain their
fingers to type unison-gui when needed).

Additionally no_x11 could stay as a PSEUDO_FLAVOR so that people can
build and install the tui program/package without having lablgtk3
installed.

> Run tested on amd64.
>
> Comments / OK?
>
>
> diff --git Makefile Makefile
> index d240adb9879..d9b47062baf 100644
> --- Makefile
> +++ Makefile
> @@ -6,8 +6,7 @@ COMMENT = multi-platform file synchronization tool
>  
>  GH_ACCOUNT = bcpierce00
>  GH_PROJECT = unison
> -GH_TAGNAME = v2.53.3
> -REVISION =   2
> +GH_TAGNAME = v2.53.4
>  
>  CATEGORIES = net
>  
> @@ -16,7 +15,7 @@ MAINTAINER =Bjorn Ketelaars 
>  # GPLv3
>  PERMIT_PACKAGE = Yes
>  
> -WANTLIB =c m util
> +WANTLIB =c m pthread util
>  
>  MODULES =lang/ocaml
>  MODOCAML_RUNDEP =if-not-native
> @@ -32,7 +31,8 @@ FLAVORS =   no_x11
>  FLAVOR ?=
>  
>  .if ${FLAVOR:Mno_x11}
> -MAKE_FLAGS +=UISTYLE=text
> +MAKE_FLAGS +=tui
> +PROG =   unison
>  .else
>  WANTLIB +=   atk-1.0 cairo cairo-gobject fontconfig freetype gdk-3
>  WANTLIB +=   gdk_pixbuf-2.0 gio-2.0 glib-2.0 gobject-2.0 gtk-3 harfbuzz
> @@ -40,7 +40,8 @@ WANTLIB +=  intl pango-1.0 pangocairo-1.0
>  BUILD_DEPENDS += x11/lablgtk3
>  LIB_DEPENDS +=   x11/gtk+3
>  RUN_DEPENDS +=   devel/desktop-file-utils
> -MAKE_FLAGS +=UISTYLE=gtk3
> +MAKE_FLAGS +=gui
> +PROG =   unison-gui
>  .endif
>  
>  FLAVOR_COMMA =   ${FLAVOR_EXT:S/-/,/g}
> @@ -49,10 +50,9 @@ SUBST_VARS =   FLAVOR_COMMA
>  PORTHOME =   ${WRKDIR}
>  DOCS =   NEWS.md README.md
>  
> -# Avoid the nightmare of their Makefile install target.
>  # Do not use INSTALL_PROGRAM, as the bytecode version must not be stripped!
>  do-install:
> - ${INSTALL_SCRIPT} ${WRKSRC}/src/unison ${PREFIX}/bin
> + ${INSTALL_SCRIPT} ${WRKSRC}/src/${PROG} ${PREFIX}/bin/unison
>   ${INSTALL_MAN} ${WRKSRC}/man/unison.1 ${PREFIX}/man/man1
>   ${INSTALL_DATA_DIR} ${PREFIX}/share/doc/unison
>   @cd ${WRKSRC} && ${INSTALL_DATA} ${DOCS} ${PREFIX}/share/doc/unison
> diff --git distinfo distinfo
> index df466e43a6d..aaf7e3e2284 100644
> --- distinfo
> +++ distinfo
> @@ -1,2 +1,2 @@
> -SHA256 (unison-2.53.3.tar.gz) = quoE/FvHbc/oYnaDyWWe5MGU1PmSzIqqFbuygg/I3kY=
> -SIZE (unison-2.53.3.tar.gz) = 1415490
> +SHA256 (unison-2.53.4.tar.gz) = 0Z5CkwE1gdvE0Umu+Js0x2Ih78vYc8eqUZPeSJrduFo=
> +SIZE (unison-2.53.4.tar.gz) = 1407429
>

-- 
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE