git: 03ff10027e28 - main - audio/libcanberra: split a gtk2 from non graphic port

From: Baptiste Daroussin <bapt_at_FreeBSD.org>
Date: Thu, 19 May 2022 12:34:07 UTC
The branch main has been updated by bapt:

URL: https://cgit.FreeBSD.org/ports/commit/?id=03ff10027e28f1047a3057b5c3615a9a4d324276

commit 03ff10027e28f1047a3057b5c3615a9a4d324276
Author:     Baptiste Daroussin <bapt@FreeBSD.org>
AuthorDate: 2022-05-19 12:30:01 +0000
Commit:     Baptiste Daroussin <bapt@FreeBSD.org>
CommitDate: 2022-05-19 12:34:03 +0000

    audio/libcanberra: split a gtk2 from non graphic port
    
    there was already a slave port for gtk3, now make a slaveport for gtk2 as
    well.
    
    While here fix the option definition which was wrongly done making libcanberra
    have no options at all while libcanberra-gtk3 had and the opposite was expected
    
    Use options helpers to simplify the port.
    Drop the gtkdoc by default
    bump revision and track no package for the 2 only port requiring the gtk2 library
    Reduce the slave port to its bare minimal requirement
    
    This change has been made in a slaveport instead of a flavor, because flavors depending
    on its own origin is not supported. this is a candidate for subpackages in the futur.
    
    note that this changes also removes gtk2 from the dependency path of many gtk3 only
     application
---
 audio/Makefile                        |  1 +
 audio/libcanberra-gtk2/Makefile       |  7 ++++
 audio/libcanberra-gtk3/Makefile       | 25 +-------------
 audio/libcanberra-gtk3/pkg-plist      |  6 ----
 audio/libcanberra/Makefile            | 52 ++++++++++++++--------------
 audio/libcanberra/pkg-plist           | 64 ++++++++++++++++-------------------
 games/gnubg/Makefile                  |  4 +--
 mail/claws-mail-notification/Makefile |  4 +--
 8 files changed, 67 insertions(+), 96 deletions(-)

diff --git a/audio/Makefile b/audio/Makefile
index dfd0e46a77a6..aafd1d8fd88e 100644
--- a/audio/Makefile
+++ b/audio/Makefile
@@ -365,6 +365,7 @@
     SUBDIR += libbpm
     SUBDIR += libbs2b
     SUBDIR += libcanberra
+    SUBDIR += libcanberra-gtk2
     SUBDIR += libcanberra-gtk3
     SUBDIR += libcdaudio
     SUBDIR += libcddb
diff --git a/audio/libcanberra-gtk2/Makefile b/audio/libcanberra-gtk2/Makefile
new file mode 100644
index 000000000000..80b43da73f6e
--- /dev/null
+++ b/audio/libcanberra-gtk2/Makefile
@@ -0,0 +1,7 @@
+# Created by: Joe Marcus Clarke <marcus@FreeBSD.org>
+#   $MCom: ports/trunk/audio/libcanberra-gtk3/Makefile 19814 2014-08-15 20:17:00Z gusi $
+
+MASTERDIR=	${.CURDIR:H}/libcanberra
+SLAVEPORT=	gtk2
+
+.include "${MASTERDIR}/Makefile"
diff --git a/audio/libcanberra-gtk3/Makefile b/audio/libcanberra-gtk3/Makefile
index cf04fbe60144..cccd151f3676 100644
--- a/audio/libcanberra-gtk3/Makefile
+++ b/audio/libcanberra-gtk3/Makefile
@@ -1,30 +1,7 @@
 # Created by: Joe Marcus Clarke <marcus@FreeBSD.org>
 #   $MCom: ports/trunk/audio/libcanberra-gtk3/Makefile 19814 2014-08-15 20:17:00Z gusi $
 
-CATEGORIES=	audio devel
-PKGNAMESUFFIX=	-gtk3
-
-MAINTAINER=	desktop@FreeBSD.org
-COMMENT=	Implementation of the Freedesktop sound theme spec
-
-MASTERDIR=	${.CURDIR}/../../audio/libcanberra
+MASTERDIR=	${.CURDIR:H}/libcanberra
 SLAVEPORT=	gtk3
-PLIST=		${.CURDIR}/pkg-plist
-
-do-build:
-	cd ${WRKSRC} && ${GMAKE} libcanberra-gtk3.pc
-	cd ${WRKSRC}/src && ${GMAKE} libcanberra-gtk3.la
-	cd ${WRKSRC}/src && ${GMAKE} libcanberra-gtk3-module.la
-
-do-install:
-	${INSTALL_DATA} ${WRKSRC}/libcanberra-gtk3.pc \
-		${STAGEDIR}${PREFIX}/libdata/pkgconfig/
-.for i in .so .so.0 .so.0.1.9
-	${INSTALL_LIB} ${WRKSRC}/src/.libs/libcanberra-gtk3${i} \
-		${STAGEDIR}${PREFIX}/lib/
-.endfor
-	cd ${WRKSRC}/src && env DESTDIR=${STAGEDIR} ${GMAKE} install-gtk3moduleLTLIBRARIES
-	${LN} -sf libcanberra-gtk3-module.so \
-		${STAGEDIR}${PREFIX}/lib/gtk-3.0/modules/libcanberra-gtk-module.so
 
 .include "${MASTERDIR}/Makefile"
diff --git a/audio/libcanberra-gtk3/pkg-plist b/audio/libcanberra-gtk3/pkg-plist
deleted file mode 100644
index d11f10495e16..000000000000
--- a/audio/libcanberra-gtk3/pkg-plist
+++ /dev/null
@@ -1,6 +0,0 @@
-lib/gtk-3.0/modules/libcanberra-gtk-module.so
-lib/gtk-3.0/modules/libcanberra-gtk3-module.so
-lib/libcanberra-gtk3.so
-lib/libcanberra-gtk3.so.0
-lib/libcanberra-gtk3.so.0.1.9
-libdata/pkgconfig/libcanberra-gtk3.pc
diff --git a/audio/libcanberra/Makefile b/audio/libcanberra/Makefile
index 76b99d7bbe9d..4f2d3d9262a9 100644
--- a/audio/libcanberra/Makefile
+++ b/audio/libcanberra/Makefile
@@ -3,7 +3,7 @@
 
 PORTNAME=	libcanberra
 PORTVERSION=	0.30
-PORTREVISION=	5
+PORTREVISION=	6
 CATEGORIES=	audio devel
 MASTER_SITES=	http://0pointer.de/lennart/projects/libcanberra/ \
 		http://pkgs.fedoraproject.org/repo/pkgs/libcanberra/libcanberra-0.30.tar.xz/34cb7e4430afaf6f447c4ebdb9b42072/
@@ -17,47 +17,45 @@ LICENSE_FILE=	${WRKSRC}/LGPL
 LIB_DEPENDS=	libvorbisfile.so:audio/libvorbis \
 		libltdl.so:devel/libltdl
 
-USES=		gmake gnome libtool pathfix pkgconfig tar:xz
+USES=		gmake gnome localbase libtool pathfix pkgconfig tar:xz
 USE_GNOME=	gnomeprefix gtk20
 USE_LDCONFIG=	yes
 GNU_CONFIGURE=	yes
 CONFIGURE_ARGS=	--disable-lynx --disable-tdb --disable-alsa
-CPPFLAGS+=	-I${LOCALBASE}/include
-LDFLAGS+=	-L${LOCALBASE}/lib
 INSTALL_TARGET=	install-strip
 
-.if defined(SLAVEPORT)
-OPTIONS_DEFINE=	PULSEAUDIO GSTREAMER
-.endif
+SLAVEPORT?=
 
 PLIST_SUB=	VERSION=${PORTVERSION}
 
-.include <bsd.port.options.mk>
-
-.if defined(SLAVEPORT)
+.if ${SLAVEPORT} != ""
+PKGNAMESUFFIX=	-${SLAVEPORT}
+.endif
+.if ${SLAVEPORT:U} == gtk3
 USE_GNOME+=	gtk30
 LIB_DEPENDS+=	libcanberra.so:audio/libcanberra
-CONFIGURE_ARGS+=--enable-gtk3
-.else
-CONFIGURE_ARGS+=--disable-gtk3
-
-.if ${PORT_OPTIONS:MPULSEAUDIO}
-LIB_DEPENDS+=	libpulse.so:audio/pulseaudio
-PLIST_SUB+=	PULSE=""
+CONFIGURE_ARGS+=	--enable-gtk3 \
+			--disable-gtk
+PLIST_SUB+=	BASE="@comment " GTK3="" GTK2="@comment "
+.elif ${SLAVEPORT:U} == gtk2
+USE_GNOME+=	gnomeprefix gtk20
+LIB_DEPENDS+=	libcanberra.so:audio/libcanberra
+CONFIGURE_ARGS+=	--enable-gtk \
+			--disable-gtk3
+PLIST_SUB+=	BASE="@comment " GTK3="@comment " GTK2=""
 .else
-CONFIGURE_ARGS+=--disable-pulse
-PLIST_SUB+=	PULSE="@comment "
+CONFIGURE_ARGS+=	--disable-gtk \
+			--disable-gtk3
+PLIST_SUB+=	BASE="" GTK3="@comment " GTK2="@comment "
+OPTIONS_DEFINE=	PULSEAUDIO GSTREAMER
+OPTIONS_SUB=	yes
 .endif
 
-.if ${PORT_OPTIONS:MGSTREAMER}
-USES+=		gstreamer
-PLIST_SUB+=	GSTREAMER=""
-.else
-CONFIGURE_ARGS+=--disable-gstreamer
-PLIST_SUB+=	GSTREAMER="@comment "
-.endif
+PULSEAUDIO_LIB_DEPENDS=	libpulse.so:audio/pulseaudio
+PULSEAUDIO__CONFIGURE_ENABLE=	pulse
 
-.endif # end slaveport
+GSTREAMER_USES=	gstreamer
+GSTREAMER_CONFIGURE_ENABLE=	gstreamer
 
 post-patch:
 	@${REINPLACE_CMD} -e 's|-Wmissing-include-dirs||g' \
diff --git a/audio/libcanberra/pkg-plist b/audio/libcanberra/pkg-plist
index f649156de2c2..e92f3d0a6c9a 100644
--- a/audio/libcanberra/pkg-plist
+++ b/audio/libcanberra/pkg-plist
@@ -1,35 +1,29 @@
-bin/canberra-gtk-play
-include/canberra-gtk.h
-include/canberra.h
-lib/gnome-settings-daemon-3.0/gtk-modules/canberra-gtk-module.desktop
-lib/gtk-2.0/modules/libcanberra-gtk-module.so
-lib/libcanberra-gtk.so
-lib/libcanberra-gtk.so.0
-lib/libcanberra-gtk.so.0.1.9
-lib/libcanberra.so
-lib/libcanberra.so.0
-lib/libcanberra.so.0.2.5
-%%GSTREAMER%%lib/libcanberra-%%VERSION%%/libcanberra-gstreamer.so
-lib/libcanberra-%%VERSION%%/libcanberra-multi.so
-lib/libcanberra-%%VERSION%%/libcanberra-null.so
-lib/libcanberra-%%VERSION%%/libcanberra-oss.so
-%%PULSE%%lib/libcanberra-%%VERSION%%/libcanberra-pulse.so
-libdata/pkgconfig/libcanberra-gtk.pc
-libdata/pkgconfig/libcanberra.pc
-%%DOCSDIR%%/README
-%%DOCSDIR%%/ch01.html
-%%DOCSDIR%%/home.png
-%%DOCSDIR%%/index.html
-%%DOCSDIR%%/index.sgml
-%%DOCSDIR%%/left.png
-%%DOCSDIR%%/libcanberra-canberra-gtk.html
-%%DOCSDIR%%/libcanberra-canberra.html
-%%DOCSDIR%%/libcanberra.devhelp2
-%%DOCSDIR%%/right.png
-%%DOCSDIR%%/style.css
-%%DOCSDIR%%/up.png
-share/gdm/autostart/LoginWindow/libcanberra-ready-sound.desktop
-share/gnome/autostart/libcanberra-login-sound.desktop
-share/gnome/shutdown/libcanberra-logout-sound.sh
-share/vala/vapi/libcanberra-gtk.vapi
-share/vala/vapi/libcanberra.vapi
+%%GTK2%%bin/canberra-gtk-play
+%%GTK2%%include/canberra-gtk.h
+%%BASE%%include/canberra.h
+%%GTK2%%lib/gnome-settings-daemon-3.0/gtk-modules/canberra-gtk-module.desktop
+%%GTK2%%lib/gtk-2.0/modules/libcanberra-gtk-module.so
+%%GTK3%%lib/gtk-3.0/modules/libcanberra-gtk-module.so
+%%GTK3%%lib/gtk-3.0/modules/libcanberra-gtk3-module.so
+%%GTK2%%lib/libcanberra-gtk.so
+%%GTK2%%lib/libcanberra-gtk.so.0
+%%GTK2%%lib/libcanberra-gtk.so.0.1.9
+%%GTK3%%lib/libcanberra-gtk3.so
+%%GTK3%%lib/libcanberra-gtk3.so.0
+%%GTK3%%lib/libcanberra-gtk3.so.0.1.9
+%%BASE%%lib/libcanberra.so
+%%BASE%%lib/libcanberra.so.0
+%%BASE%%lib/libcanberra.so.0.2.5
+%%BASE%%%%GSTREAMER%%lib/libcanberra-%%VERSION%%/libcanberra-gstreamer.so
+%%BASE%%lib/libcanberra-%%VERSION%%/libcanberra-multi.so
+%%BASE%%lib/libcanberra-%%VERSION%%/libcanberra-null.so
+%%BASE%%lib/libcanberra-%%VERSION%%/libcanberra-oss.so
+%%BASE%%%%PULSEAUDIO%%lib/libcanberra-%%VERSION%%/libcanberra-pulse.so
+%%BASE%%libdata/pkgconfig/libcanberra.pc
+%%GTK2%%libdata/pkgconfig/libcanberra-gtk.pc
+%%GTK3%%libdata/pkgconfig/libcanberra-gtk3.pc
+%%GTK2%%share/gdm/autostart/LoginWindow/libcanberra-ready-sound.desktop
+%%GTK2%%share/gnome/autostart/libcanberra-login-sound.desktop
+%%GTK2%%share/gnome/shutdown/libcanberra-logout-sound.sh
+%%GTK2%%share/vala/vapi/libcanberra-gtk.vapi
+%%BASE%%share/vala/vapi/libcanberra.vapi
diff --git a/games/gnubg/Makefile b/games/gnubg/Makefile
index 8b510d21e20e..09f8ed3fd5d4 100644
--- a/games/gnubg/Makefile
+++ b/games/gnubg/Makefile
@@ -2,7 +2,7 @@
 
 PORTNAME=	gnubg
 PORTVERSION=	1.06.002
-PORTREVISION=	4
+PORTREVISION=	5
 CATEGORIES=	games
 MASTER_SITES=	GNU
 DISTFILES=	gnubg-release-${PORTVERSION}-sources.tar.gz
@@ -15,7 +15,7 @@ LICENSE=	GPLv3
 RUN_DEPENDS=	sqlite3:databases/sqlite3
 LIB_DEPENDS=	libpng.so:graphics/png \
 		libgtkglext-x11-1.0.so:x11-toolkits/gtkglext \
-		libcanberra-gtk.so:audio/libcanberra \
+		libcanberra-gtk.so:audio/libcanberra-gtk \
 		libgmp.so:math/gmp \
 		libcurl.so:ftp/curl \
 		libfontconfig.so:x11-fonts/fontconfig \
diff --git a/mail/claws-mail-notification/Makefile b/mail/claws-mail-notification/Makefile
index 60c3554a6f3e..c1b3a0ed93b6 100644
--- a/mail/claws-mail-notification/Makefile
+++ b/mail/claws-mail-notification/Makefile
@@ -1,11 +1,11 @@
 # Created by: Pawel Pekala <c0rn@o2.pl>
 
 PORTNAME=	notification
-PORTREVISION=	0
+PORTREVISION=	1
 
 COMMENT=	New mail notification plugin for Claws Mail
 
-LIB_DEPENDS=	libcanberra-gtk.so:audio/libcanberra \
+LIB_DEPENDS=	libcanberra-gtk.so:audio/libcanberra-gtk2 \
 		libnotify.so:devel/libnotify
 
 CLAWS_PLUGINS_BUILD=	${PORTNAME}