git: 35db578d6257 - main - devel/distcc: Patch small bugs

From: Robert Clausecker <fuz_at_FreeBSD.org>
Date: Sun, 06 Oct 2024 11:50:07 UTC
The branch main has been updated by fuz:

URL: https://cgit.FreeBSD.org/ports/commit/?id=35db578d625710b24f9746b86d5197ec96713faa

commit 35db578d625710b24f9746b86d5197ec96713faa
Author:     Laurent Chardon <laurent.chardon@gmail.com>
AuthorDate: 2024-09-20 02:27:01 +0000
Commit:     Robert Clausecker <fuz@FreeBSD.org>
CommitDate: 2024-10-06 11:49:18 +0000

    devel/distcc: Patch small bugs
    
    - Fix GUI option not working and made it a flavor
    - Fix service not starting
    - Improve default options
    - Update available compilers masquerade
    - Create proper pkg-plist
    - Use pyXY- pkg prefix when pump mode is compiled with non-default python version
    - Take maintainership
    
    PR:             281706
---
 devel/distcc/Makefile                 | 119 +++++++++++-----------------------
 devel/distcc/files/patch-Makefile.in  |   6 +-
 devel/distcc/files/patch-src_daemon.c |  11 ++++
 devel/distcc/pkg-descr                |   5 +-
 devel/distcc/pkg-descr.gtk            |  19 ++++++
 devel/distcc/pkg-plist                | 105 ++++++++++++++++++++++++++++++
 6 files changed, 179 insertions(+), 86 deletions(-)

diff --git a/devel/distcc/Makefile b/devel/distcc/Makefile
index afaed671d281..0cb1029f6f72 100644
--- a/devel/distcc/Makefile
+++ b/devel/distcc/Makefile
@@ -1,11 +1,11 @@
 PORTNAME=	distcc
 DISTVERSIONPREFIX=	v
 DISTVERSION=	3.4
-PORTREVISION=	1
-CATEGORIES=	devel
+PORTREVISION=	2
+CATEGORIES=	devel python
 
-MAINTAINER=	ports@FreeBSD.org
-COMMENT=	Distribute compilation of C(++) code across machines on a network
+MAINTAINER=	laurent.chardon@gmail.com
+COMMENT=	Distribute compilation of C(++) code across machines ${${FLAVOR}_COMMENT}
 WWW=		https://distcc.github.io/
 
 LICENSE=	GPLv2
@@ -14,6 +14,13 @@ LICENSE_FILE=	${WRKSRC}/COPYING
 BUILD_DEPENDS=	${LOCALBASE}/lib/libiberty.a:devel/gnulibiberty
 LIB_DEPENDS=	libpopt.so:devel/popt
 
+FLAVORS=	default gtk
+FLAVOR?=	${FLAVORS:[1]}
+default_COMMENT=	(text monitor)
+gtk_PKGNAMESUFFIX=	-gtk
+gtk_DESCR=	${.CURDIR}/pkg-descr.gtk
+gtk_COMMENT=	(gtk monitor)
+
 USES=		alias autoreconf cpe gmake libtool localbase pkgconfig
 USE_GITHUB=	yes
 USE_RC_SUBR=	distccd
@@ -35,103 +42,59 @@ SUB_LIST=	DISTCCD_PIDFILE=/var/run/distccd.pid
 USERS=		distcc
 GROUPS=		distcc
 
-PLIST_FILES=	${_BIN_FILES:S|^|bin/|} \
-		${_CONFIG_FILES:S|^|${ETCDIR}/${PORTNAME}/|} \
-		${_DISTCC_COMPILERS:S|^|${CCLINKDIR}/|} \
-		${_MAN_FILES:S|^|share/man/man1/|:S|$|.gz|} \
-		${_SBIN_FILES:S|^|sbin/|} \
-		etc/default/distcc
-
-OPTIONS_DEFINE=		AVAHI CLANGLINK DOCS IPV6 LLVMLINK PUMP GUI
+OPTIONS_DEFINE=		AVAHI CLANGLINK DOCS IPV6 LLVMLINK PUMP
+OPTIONS_DEFAULT=	CLANGLINK PUMP
+OPTIONS_SUB=	yes
 
 CLANGLINK_DESC=	Create clang compiler links if clang is installed
-GUI_DESC=	Build GUI distcc monitor
 LLVMLINK_DESC=	Create llvm compiler links if llvm is installed
 PUMP_DESC=	Distribute compilation as well as preprocessing to distcc servers
 
 AVAHI_LIB_DEPENDS=	libavahi-client.so:net/avahi-app
 AVAHI_CONFIGURE_WITH=	avahi
-DOCS_PLIST_FILES+=	${_DOC_FILES:S|^|${DOCSDIR_REL}/|} \
-			${_README_FILES:S|^|${DOCSDIR_REL}/|}
-GUI_USES=		gnome
-GUI_USE=		GNOME=gtk20
-GUI_CONFIGURE_WITH=	gtk
 IPV6_CONFIGURE_ENABLE=	rfc2553
+PUMP_BUILD_DEPENDS=	${PYTHON_PKGNAMEPREFIX}setuptools>=0:devel/py-setuptools@${PY_FLAVOR}
 PUMP_USES=		python
+PUMP_USE_PYTHON=	flavors
 PUMP_CONFIGURE_ENABLE=	pump-mode
-PUMP_PLIST_FILES=	${PYTHON_SITELIBDIR}/include_server-${PORTVERSION}-py${PYTHON_VER}.egg-info \
-			${PYTHON_SITELIBDIR}/include_server/basics.py \
-			${PYTHON_SITELIBDIR}/include_server/basics_test.py \
-			${PYTHON_SITELIBDIR}/include_server/c_extensions_test.py \
-			${PYTHON_SITELIBDIR}/include_server/cache_basics.py \
-			${PYTHON_SITELIBDIR}/include_server/compiler_defaults.py \
-			${PYTHON_SITELIBDIR}/include_server/compress_files.py \
-			${PYTHON_SITELIBDIR}/include_server/distcc_pump_c_extensions.cpython-${PYTHON_SUFFIX}.so \
-			${PYTHON_SITELIBDIR}/include_server/include_analyzer.py \
-			${PYTHON_SITELIBDIR}/include_server/include_analyzer_memoizing_node.py \
-			${PYTHON_SITELIBDIR}/include_server/include_analyzer_memoizing_node_test.py \
-			${PYTHON_SITELIBDIR}/include_server/include_analyzer_test.py \
-			${PYTHON_SITELIBDIR}/include_server/include_server.py \
-			${PYTHON_SITELIBDIR}/include_server/include_server_test.py \
-			${PYTHON_SITELIBDIR}/include_server/macro_eval.py \
-			${PYTHON_SITELIBDIR}/include_server/macro_eval_test.py \
-			${PYTHON_SITELIBDIR}/include_server/mirror_path.py \
-			${PYTHON_SITELIBDIR}/include_server/mirror_path_test.py \
-			${PYTHON_SITELIBDIR}/include_server/parse_command.py \
-			${PYTHON_SITELIBDIR}/include_server/parse_command_test.py \
-			${PYTHON_SITELIBDIR}/include_server/parse_file.py \
-			${PYTHON_SITELIBDIR}/include_server/parse_file_test.py \
-			${PYTHON_SITELIBDIR}/include_server/run.py \
-			${PYTHON_SITELIBDIR}/include_server/setup.py \
-			${PYTHON_SITELIBDIR}/include_server/statistics.py
 
 # Leave CCLINKDIR without a leading underscore as it is a variable, which could
 # be set by the user.
 CCLINKDIR?=		libexec/distcc
 _DISTCC_COMPILERS=	CC c++ cc
 
-_CONFIG_FILES=	clients.allow commands.allow.sh hosts
-_BIN_FILES=	distcc distccmon-text lsdistcc
-_DOC_FILES=	protocol-1.txt protocol-2.txt protocol-3.txt \
-		protocol-3-impl.txt protocol-gssapi.txt reporting-bugs.txt \
-		status-1.txt survey.txt
-_MAN_FILES=	distcc.1 distccd.1 distccmon-text.1 include_server.1 lsdistcc.1 \
-		pump.1
-_README_FILES=	AUTHORS COPYING INSTALL NEWS README README.pump TODO
-_SBIN_FILES=	distccd
+GNU_COMPILERS=		10 11 12 13 14 15 6
+_DISTCC_COMPILERS+=	gcc g++ ${GNU_COMPILERS:S|^|g++|} \
+			${GNU_COMPILERS:S|^|gcc|} \
+			${EXTRA_COMPILERS}
 
 .include <bsd.port.options.mk>
 
+.if ${FLAVOR} == gtk
+USES+=		gnome
+USE_GNOME=	gtk30
+CONFIGURE_ARGS+=	--with-gtk
+PLIST_SUB+=	GTK=""
+.else
+PLIST_SUB+=	GTK="@comment "
+.endif
+
+.include <bsd.port.pre.mk>
+
+.if ${PORT_OPTIONS:MPUMP}
+.if ${PYTHON_VER} != ${PYTHON_DEFAULT}
+PKGNAMEPREFIX=		${PYTHON_PKGNAMEPREFIX}
+.endif
+.endif
+
 .if ${PORT_OPTIONS:MCLANGLINK}
-CLANG_COMPILERS=	-devel 31 32 33 34 35 36 37 38 39
+CLANG_COMPILERS=	-devel 11 12 13 14 15 16 17 18 19
 _DISTCC_COMPILERS+=	clang++ clang ${CLANG_COMPILERS:S|^|clang++|} \
 			${CLANG_COMPILERS:S|^|clang|}
 .endif
-GNU_COMPILERS=		34 42 43 44 45 46 47 48 49 5
-_DISTCC_COMPILERS+=	gcc g++ ${GNU_COMPILERS:S|^|g++|} \
-			${GNU_COMPILERS:S|^|gcc|}
-.if ${ARCH} == "i386"
-_DISTCC_COMPILERS+=	icc icpc
-.endif
 .if ${PORT_OPTIONS:MLLVMLINK}
 _DISTCC_COMPILERS+=	llvm-c++ llvm-g++ llvm-gcc
 .endif
-_DISTCC_COMPILERS+=	${EXTRA_COMPILERS}
-
-.if ${PORT_OPTIONS:MGTUI}
-PKGNAMESUFFIX=	-gtk
-_BIN_FILES+=	distccmon-gnome
-PLIST_FILES+=	${DESKTOPDIR}/distccmon-gnome.desktop \
-		share/pixmaps/distccmon-gnome-icon.png
-.endif
-
-post-patch-GUI-on:
-	${REINPLACE_CMD} -e 's|PKGDATADIR "|"${PREFIX}/share/pixmaps|' \
-	    ${WRKSRC}/src/mon-gnome.c
-
-.if ${PORT_OPTIONS:MPUMP}
-_BIN_FILES+=	pump
-.endif
 
 post-install:
 	@${MKDIR} ${STAGEDIR}${PREFIX}/${CCLINKDIR}
@@ -145,8 +108,4 @@ post-install:
 post-install-PUMP-on:
 	${STRIP_CMD} ${STAGEDIR}${PYTHON_SITELIBDIR}/include_server/distcc_pump_c_extensions.cpython-${PYTHON_SUFFIX}.so
 
-post-install-PUMP-off:
-	${RM} ${STAGEDIR}${PUMP_PLIST_FILES}
-	${RM} ${STAGEDIR}/bin/pump
-
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
diff --git a/devel/distcc/files/patch-Makefile.in b/devel/distcc/files/patch-Makefile.in
index 90ab0de63746..6507eec42647 100644
--- a/devel/distcc/files/patch-Makefile.in
+++ b/devel/distcc/files/patch-Makefile.in
@@ -1,6 +1,6 @@
---- Makefile.in.orig	2019-08-23 16:46:20 UTC
+--- Makefile.in.orig	2021-05-11 17:26:29 UTC
 +++ Makefile.in
-@@ -184,7 +184,7 @@ include_server_PY = \
+@@ -185,7 +185,7 @@ include_server_SRC = \
  include_server_SRC = \
  	include_server/c_extensions/distcc_pump_c_extensions_module.c
  
@@ -9,7 +9,7 @@
  
  # These are included in the distribution but not installed anywhere.
  dist_extra =							\
-@@ -415,13 +415,12 @@ popt_EXTRA = popt/README.popt popt/.stamp-conf.in
+@@ -416,13 +416,12 @@ bin_PROGRAMS = \
  
  bin_PROGRAMS = \
  	distcc@EXEEXT@ \
diff --git a/devel/distcc/files/patch-src_daemon.c b/devel/distcc/files/patch-src_daemon.c
new file mode 100644
index 000000000000..c8ea0cd39f8b
--- /dev/null
+++ b/devel/distcc/files/patch-src_daemon.c
@@ -0,0 +1,11 @@
+--- src/daemon.c.orig	2024-09-20 02:11:57 UTC
++++ src/daemon.c
+@@ -160,7 +160,7 @@ static void dcc_warn_masquerade_whitelist(void) {
+                        " --enable-tcp-insecure. To set up masquerade automatically" \
+                        " run update-distcc-symlinks.";
+ 
+-    e = opendir("/usr/lib/distcc");
++    e = opendir("/usr/local/libexec/distcc");
+     d = opendir(LIBDIR "/distcc");
+     if (!e && !d) {
+         rs_log_crit(LIBDIR "/distcc not found. %s", warn);
diff --git a/devel/distcc/pkg-descr b/devel/distcc/pkg-descr
index 462cae5bfa89..b6a2156d2814 100644
--- a/devel/distcc/pkg-descr
+++ b/devel/distcc/pkg-descr
@@ -14,6 +14,5 @@ for each job, so all it requires of the volunteer machines is that
 they be running the distccd daemon, and that they have an appropriate
 compiler installed.
 
-This version also comes with a text-based as well as a GNOME-based monitor
-to inspect the load on the cluster, and how it is distributed among the
-various distcc nodes.
+This package comes with a text-based monitor to inspect the load on
+the cluster, and how it is distributed among the various distcc nodes.
diff --git a/devel/distcc/pkg-descr.gtk b/devel/distcc/pkg-descr.gtk
new file mode 100644
index 000000000000..5b27e4e63337
--- /dev/null
+++ b/devel/distcc/pkg-descr.gtk
@@ -0,0 +1,19 @@
+distcc is a program to distribute compilation of C code across
+several machines on a network. distcc should always generate the
+same results as a local compile, is simple to install and use, and
+is often significantly faster than a local compile.
+
+Unlike other distributed build systems, distcc does not require all
+machines to share a filesystem, have synchronized clocks, or to
+have the same libraries or header files installed. Machines can be
+running different operating systems, as long as they have compatible
+binary formats or cross-compilers.
+
+distcc sends the complete preprocessed source code across the network
+for each job, so all it requires of the volunteer machines is that
+they be running the distccd daemon, and that they have an appropriate
+compiler installed.
+
+This package contains the GTK-based monitor for distcc to inspect
+the load on the cluster, and how it is distributed among the various
+distcc nodes.
diff --git a/devel/distcc/pkg-plist b/devel/distcc/pkg-plist
new file mode 100644
index 000000000000..991bd07e3b48
--- /dev/null
+++ b/devel/distcc/pkg-plist
@@ -0,0 +1,105 @@
+bin/distcc
+%%GTK%%bin/distccmon-gnome
+bin/distccmon-text
+bin/lsdistcc
+%%PUMP%%bin/pump
+%%ETCDIR%%/default/distcc
+%%ETCDIR%%/distcc/clients.allow
+%%ETCDIR%%/distcc/commands.allow.sh
+%%ETCDIR%%/distcc/hosts
+%%PUMP%%%%PYTHON_SITELIBDIR%%/include_server-3.4-py%%PYTHON_VER%%.egg-info/PKG-INFO
+%%PUMP%%%%PYTHON_SITELIBDIR%%/include_server-3.4-py%%PYTHON_VER%%.egg-info/SOURCES.txt
+%%PUMP%%%%PYTHON_SITELIBDIR%%/include_server-3.4-py%%PYTHON_VER%%.egg-info/dependency_links.txt
+%%PUMP%%%%PYTHON_SITELIBDIR%%/include_server-3.4-py%%PYTHON_VER%%.egg-info/top_level.txt
+%%PUMP%%%%PYTHON_SITELIBDIR%%/include_server/basics.py
+%%PUMP%%%%PYTHON_SITELIBDIR%%/include_server/basics_test.py
+%%PUMP%%%%PYTHON_SITELIBDIR%%/include_server/c_extensions_test.py
+%%PUMP%%%%PYTHON_SITELIBDIR%%/include_server/cache_basics.py
+%%PUMP%%%%PYTHON_SITELIBDIR%%/include_server/compiler_defaults.py
+%%PUMP%%%%PYTHON_SITELIBDIR%%/include_server/compress_files.py
+%%PUMP%%%%PYTHON_SITELIBDIR%%/include_server/distcc_pump_c_extensions%%PYTHON_EXT_SUFFIX%%.so
+%%PUMP%%%%PYTHON_SITELIBDIR%%/include_server/include_analyzer.py
+%%PUMP%%%%PYTHON_SITELIBDIR%%/include_server/include_analyzer_memoizing_node.py
+%%PUMP%%%%PYTHON_SITELIBDIR%%/include_server/include_analyzer_memoizing_node_test.py
+%%PUMP%%%%PYTHON_SITELIBDIR%%/include_server/include_analyzer_test.py
+%%PUMP%%%%PYTHON_SITELIBDIR%%/include_server/include_server.py
+%%PUMP%%%%PYTHON_SITELIBDIR%%/include_server/include_server_test.py
+%%PUMP%%%%PYTHON_SITELIBDIR%%/include_server/macro_eval.py
+%%PUMP%%%%PYTHON_SITELIBDIR%%/include_server/macro_eval_test.py
+%%PUMP%%%%PYTHON_SITELIBDIR%%/include_server/mirror_path.py
+%%PUMP%%%%PYTHON_SITELIBDIR%%/include_server/mirror_path_test.py
+%%PUMP%%%%PYTHON_SITELIBDIR%%/include_server/parse_command.py
+%%PUMP%%%%PYTHON_SITELIBDIR%%/include_server/parse_command_test.py
+%%PUMP%%%%PYTHON_SITELIBDIR%%/include_server/parse_file.py
+%%PUMP%%%%PYTHON_SITELIBDIR%%/include_server/parse_file_test.py
+%%PUMP%%%%PYTHON_SITELIBDIR%%/include_server/run.py
+%%PUMP%%%%PYTHON_SITELIBDIR%%/include_server/setup.py
+%%PUMP%%%%PYTHON_SITELIBDIR%%/include_server/statistics.py
+libexec/distcc/CC
+libexec/distcc/c++
+libexec/distcc/cc
+%%CLANGLINK%%libexec/distcc/clang
+%%CLANGLINK%%libexec/distcc/clang++
+%%CLANGLINK%%libexec/distcc/clang++-devel
+%%CLANGLINK%%libexec/distcc/clang++11
+%%CLANGLINK%%libexec/distcc/clang++12
+%%CLANGLINK%%libexec/distcc/clang++13
+%%CLANGLINK%%libexec/distcc/clang++14
+%%CLANGLINK%%libexec/distcc/clang++15
+%%CLANGLINK%%libexec/distcc/clang++16
+%%CLANGLINK%%libexec/distcc/clang++17
+%%CLANGLINK%%libexec/distcc/clang++18
+%%CLANGLINK%%libexec/distcc/clang++19
+%%CLANGLINK%%libexec/distcc/clang-devel
+%%CLANGLINK%%libexec/distcc/clang11
+%%CLANGLINK%%libexec/distcc/clang12
+%%CLANGLINK%%libexec/distcc/clang13
+%%CLANGLINK%%libexec/distcc/clang14
+%%CLANGLINK%%libexec/distcc/clang15
+%%CLANGLINK%%libexec/distcc/clang16
+%%CLANGLINK%%libexec/distcc/clang17
+%%CLANGLINK%%libexec/distcc/clang18
+%%CLANGLINK%%libexec/distcc/clang19
+libexec/distcc/g++
+libexec/distcc/g++10
+libexec/distcc/g++11
+libexec/distcc/g++12
+libexec/distcc/g++13
+libexec/distcc/g++14
+libexec/distcc/g++15
+libexec/distcc/g++6
+libexec/distcc/gcc
+libexec/distcc/gcc10
+libexec/distcc/gcc11
+libexec/distcc/gcc12
+libexec/distcc/gcc13
+libexec/distcc/gcc14
+libexec/distcc/gcc15
+libexec/distcc/gcc6
+%%LLVMLINK%%libexec/distcc/llvm-c++
+%%LLVMLINK%%libexec/distcc/llvm-g++
+%%LLVMLINK%%libexec/distcc/llvm-gcc
+sbin/distccd
+%%GTK%%share/applications/distccmon-gnome.desktop
+%%PORTDOCS%%%%DOCSDIR%%/AUTHORS
+%%PORTDOCS%%%%DOCSDIR%%/COPYING
+%%PORTDOCS%%%%DOCSDIR%%/INSTALL
+%%PORTDOCS%%%%DOCSDIR%%/NEWS
+%%PORTDOCS%%%%DOCSDIR%%/README
+%%PORTDOCS%%%%DOCSDIR%%/README.pump
+%%PORTDOCS%%%%DOCSDIR%%/TODO
+%%PORTDOCS%%%%DOCSDIR%%/protocol-1.txt
+%%PORTDOCS%%%%DOCSDIR%%/protocol-2.txt
+%%PORTDOCS%%%%DOCSDIR%%/protocol-3-impl.txt
+%%PORTDOCS%%%%DOCSDIR%%/protocol-3.txt
+%%PORTDOCS%%%%DOCSDIR%%/protocol-gssapi.txt
+%%PORTDOCS%%%%DOCSDIR%%/reporting-bugs.txt
+%%PORTDOCS%%%%DOCSDIR%%/status-1.txt
+%%PORTDOCS%%%%DOCSDIR%%/survey.txt
+share/man/man1/distcc.1.gz
+share/man/man1/distccd.1.gz
+share/man/man1/distccmon-text.1.gz
+share/man/man1/include_server.1.gz
+share/man/man1/lsdistcc.1.gz
+share/man/man1/pump.1.gz
+%%GTK%%share/pixmaps/distccmon-gnome.png