pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

mctool-dev: fix build and installation



Module Name:	pkgsrc-wip
Committed By:	Thomas Klausner <wiz%NetBSD.org@localhost>
Pushed By:	wiz
Date:		Mon Apr 27 16:42:50 2026 +0200
Changeset:	8a90e7d0a975fb394839679e22f07b2cc246221f

Modified Files:
	mctool-dev/Makefile
Added Files:
	mctool-dev/distinfo
	mctool-dev/patches/patch-bin_cmd__fetch.c
	mctool-dev/patches/patch-lib_distinfo.c
	mctool-dev/patches/patch-test_readdistinfo_t__readdistinfo.c

Log Message:
mctool-dev: fix build and installation

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=8a90e7d0a975fb394839679e22f07b2cc246221f

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 mctool-dev/Makefile                                | 10 +++++-
 mctool-dev/distinfo                                |  5 +++
 mctool-dev/patches/patch-bin_cmd__fetch.c          | 41 ++++++++++++++++++++++
 mctool-dev/patches/patch-lib_distinfo.c            | 22 ++++++++++++
 .../patch-test_readdistinfo_t__readdistinfo.c      | 19 ++++++++++
 5 files changed, 96 insertions(+), 1 deletion(-)

diffs:
diff --git a/mctool-dev/Makefile b/mctool-dev/Makefile
index ce19c87b89..d55bb9b7d8 100644
--- a/mctool-dev/Makefile
+++ b/mctool-dev/Makefile
@@ -16,10 +16,18 @@ USE_TOOLS+=	pkg-config
 NO_CONFIGURE=	yes
 
 INSTALLATION_DIRS+=	bin
-INSTALL_MAKE_FLAGS+=	BINDIR=${PREFIX:Q}/bin
+#INSTALL_MAKE_FLAGS+=	BINDIR=${PREFIX:Q}/bin
 
 TEST_TARGET=	check
 
+# #   install  /tmp/wip/mctool-dev/work/.destdir/usr/pkg/bin/mctool
+# install  -c  -r -o root -g wheel -m 555   mctool /tmp/wip/mctool-dev/work/.destdir/usr/pkg/bin/mctool
+# install: /tmp/wip/mctool-dev/work/.destdir/usr/pkg/bin/mctool.inst.92mbrc: chown/chgrp: Operation not permitted
+# *** Error code 1
+
+do-install:
+	${INSTALL_PROGRAM} ${WRKSRC}/bin/mctool ${DESTDIR}${PREFIX}/bin
+
 .include "../../security/openssl/buildlink3.mk"
 .include "../../www/curl/buildlink3.mk"
 .include "../../wip/mk/hg-package.mk"
diff --git a/mctool-dev/distinfo b/mctool-dev/distinfo
new file mode 100644
index 0000000000..7fa2021ba7
--- /dev/null
+++ b/mctool-dev/distinfo
@@ -0,0 +1,5 @@
+$NetBSD$
+
+SHA1 (patch-bin_cmd__fetch.c) = eba81c51fe123bf46c272864e10b3cd46c178ba0
+SHA1 (patch-lib_distinfo.c) = e8e8742b374f988f128340abd6fd66bc407b9ac0
+SHA1 (patch-test_readdistinfo_t__readdistinfo.c) = f353984af5d65ca9c3a17235b5c957bbcd06c3d3
diff --git a/mctool-dev/patches/patch-bin_cmd__fetch.c b/mctool-dev/patches/patch-bin_cmd__fetch.c
new file mode 100644
index 0000000000..f8e0d66009
--- /dev/null
+++ b/mctool-dev/patches/patch-bin_cmd__fetch.c
@@ -0,0 +1,41 @@
+$NetBSD$
+
+In file included from cmd_fetch.c:47:
+In function 'xferstart',
+    inlined from 'cmd_common' at cmd_fetch.c:952:9:
+/tmp/wip/mctool-dev/work/.buildlink/include/curl/typecheck-gcc.h:50:13: error: call to 'Wcurl_easy_setopt_err_long' declared with attribute warning: curl_easy_setopt expects a long argument [-Werror=attribute-warning]
+   50 |             Wcurl_easy_setopt_err_long();                               \
+      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
+/tmp/wip/mctool-dev/work/.buildlink/include/curl/curl.h:54:7: note: in definition of macro 'CURL_IGNORE_DEPRECATION'
+   54 |       statements \
+      |       ^~~~~~~~~~
+cmd_fetch.c:244:24: note: in expansion of macro 'curl_easy_setopt'
+  244 |                 cerr = curl_easy_setopt(X->handle, CURLOPT_FAILONERROR, 1);
+      |                        ^~~~~~~~~~~~~~~~
+/tmp/wip/mctool-dev/work/.buildlink/include/curl/typecheck-gcc.h:50:13: error: call to 'Wcurl_easy_setopt_err_long' declared with attribute warning: curl_easy_setopt expects a long argument [-Werror=attribute-warning]
+   50 |             Wcurl_easy_setopt_err_long();                               \
+      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
+/tmp/wip/mctool-dev/work/.buildlink/include/curl/curl.h:54:7: note: in definition of macro 'CURL_IGNORE_DEPRECATION'
+   54 |       statements \
+      |       ^~~~~~~~~~
+cmd_fetch.c:249:24: note: in expansion of macro 'curl_easy_setopt'
+  249 |                 cerr = curl_easy_setopt(X->handle, CURLOPT_FOLLOWLOCATION, 1);
+      |                        ^~~~~~~~~~~~~~~~
+
+--- bin/cmd_fetch.c.orig	2026-04-27 14:38:59.952317267 +0000
++++ bin/cmd_fetch.c
+@@ -241,12 +241,12 @@ xferstart(struct cmd_fetch *F, struct distfile *D, con
+ 		 */
+ 		if ((X->handle = curl_easy_init()) == NULL)
+ 			errx(1, "curl_easy_init");
+-		cerr = curl_easy_setopt(X->handle, CURLOPT_FAILONERROR, 1);
++		cerr = curl_easy_setopt(X->handle, CURLOPT_FAILONERROR, 1L);
+ 		if (cerr) {
+ 			errx(1, "curl_easy_setopt(CURLOPT_FAILONERROR): %s",
+ 			    curl_easy_strerror(cerr));
+ 		}
+-		cerr = curl_easy_setopt(X->handle, CURLOPT_FOLLOWLOCATION, 1);
++		cerr = curl_easy_setopt(X->handle, CURLOPT_FOLLOWLOCATION, 1L);
+ 		if (cerr) {
+ 			errx(1, "curl_easy_setopt(CURLOPT_FOLLOWLOCATION): %s",
+ 			    curl_easy_strerror(cerr));
diff --git a/mctool-dev/patches/patch-lib_distinfo.c b/mctool-dev/patches/patch-lib_distinfo.c
new file mode 100644
index 0000000000..4c0be6b58a
--- /dev/null
+++ b/mctool-dev/patches/patch-lib_distinfo.c
@@ -0,0 +1,22 @@
+$NetBSD$
+
+In file included from /usr/include/string.h:154,
+                 from distinfo.c:40:
+In function '__strncpy_ichk',
+    inlined from 'parsedistinfo' at distinfo.c:357:2,
+    inlined from 'readdistinfo' at distinfo.c:448:8:
+/usr/include/ssp/string.h:91:1: error: '__builtin_strncpy' specified bound 128 equals destination size [-Werror=stringop-truncation]
+   91 | __ssp_bos_icheck3_restrict(strncpy, char *, const char *)
+      | ^~~~~~~~~~~~~~~~~~~~~~~~~~
+
+--- lib/distinfo.c.orig	2026-04-27 14:34:38.654216613 +0000
++++ lib/distinfo.c
+@@ -354,7 +354,7 @@ parsedistinfo(char *text, size_t nentries)
+ 		errx(1, "overlong rcsid");
+ 	*p++ = '\0';
+ 	L++;
+-	strncpy(tab->dit_rcsid, text, sizeof(tab->dit_rcsid));
++	memcpy(tab->dit_rcsid, text, strlen(text));
+ 
+ 	/*
+ 	 * Parse all the lines.
diff --git a/mctool-dev/patches/patch-test_readdistinfo_t__readdistinfo.c b/mctool-dev/patches/patch-test_readdistinfo_t__readdistinfo.c
new file mode 100644
index 0000000000..3c7c6bc68a
--- /dev/null
+++ b/mctool-dev/patches/patch-test_readdistinfo_t__readdistinfo.c
@@ -0,0 +1,19 @@
+$NetBSD$
+
+t_readdistinfo.c: In function 'main':
+t_readdistinfo.c:71:29: error: 'calloc' sizes specified with 'sizeof' in the earlier argument and not in the later argument [-Werror=calloc-transposed-args]
+   71 |         perm = calloc(sizeof(*perm), tab->dit_size);
+      |                             ^
+t_readdistinfo.c:71:29: note: earlier argument should specify number of elements, later size of each element
+
+--- test/readdistinfo/t_readdistinfo.c.orig	2026-04-27 14:39:26.548386062 +0000
++++ test/readdistinfo/t_readdistinfo.c
+@@ -68,7 +68,7 @@ main(int argc, char **argv)
+ 	tab = readdistinfo(argv[1], 0);
+ 	if (tab == NULL)
+ 		err(1, "read distinfo");
+-	perm = calloc(sizeof(*perm), tab->dit_size);
++	perm = calloc(tab->dit_size, sizeof(*perm));
+ 	if (perm == NULL)
+ 		err(1, "calloc");
+ 	for (i = 0; i < tab->dit_size; i++)


Home | Main Index | Thread Index | Old Index