pkgsrc-WIP-changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
bsddialog: portability fixes for macOS
Module Name: pkgsrc-wip
Committed By: Pierre Pronchery <khorben%defora.org@localhost>
Pushed By: khorben
Date: Wed Dec 4 00:56:54 2024 +0100
Changeset: 02ffb1b8bce7b92fdcdbc2f6428e9d2cdfc41d5f
Modified Files:
bsddialog/distinfo
bsddialog/patches/patch-lib_Makefile
Added Files:
bsddialog/patches/patch-utility_util__builders.c
Log Message:
bsddialog: portability fixes for macOS
To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=02ffb1b8bce7b92fdcdbc2f6428e9d2cdfc41d5f
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
diffstat:
bsddialog/distinfo | 3 +-
bsddialog/patches/patch-lib_Makefile | 19 ++-
bsddialog/patches/patch-utility_util__builders.c | 200 +++++++++++++++++++++++
3 files changed, 214 insertions(+), 8 deletions(-)
diffs:
diff --git a/bsddialog/distinfo b/bsddialog/distinfo
index 5413d05b68..b3dd373412 100644
--- a/bsddialog/distinfo
+++ b/bsddialog/distinfo
@@ -4,5 +4,6 @@ BLAKE2s (bsddialog-1.0.4.tar.gz) = 44fe9cf0b05a2ea3a003093debb77a6ad890774ce98fd
SHA512 (bsddialog-1.0.4.tar.gz) = 317ee8c7f69e7e24cc70b0e701c25b17b744aa606cb60ca9a67d756856a253a0fee231f05b55b187400c2f98cfbc464640f75457513cbeebb17aea3dd9057772
Size (bsddialog-1.0.4.tar.gz) = 87327 bytes
SHA1 (patch-lib_GNUmakefile) = 5e97c44570ea93a6f476920b6404432128d0952c
-SHA1 (patch-lib_Makefile) = c8b5387d496d1b6a45ae15258ba4a1bdb6625f80
+SHA1 (patch-lib_Makefile) = d8a425fe756d15bab356c09856a44270637b36e0
SHA1 (patch-utility_Makefile) = 08247e044594740830c8c418a3e54d31dd7b44d5
+SHA1 (patch-utility_util__builders.c) = 166e97b4eef7f02e1305a84b7efbaae84505596a
diff --git a/bsddialog/patches/patch-lib_Makefile b/bsddialog/patches/patch-lib_Makefile
index f6965c6c74..128b35aca8 100644
--- a/bsddialog/patches/patch-lib_Makefile
+++ b/bsddialog/patches/patch-lib_Makefile
@@ -6,16 +6,21 @@ Also install bsddialog_theme.h
--- lib/Makefile.orig 2024-12-02 18:36:02.000000000 +0000
+++ lib/Makefile
-@@ -19,7 +19,7 @@ CFLAGS += -D_XOPEN_SOURCE_EXTENDED -fPIC
- -fstack-protector-strong
- LDFLAGS += -fstack-protector-strong -shared -Wl,-x -Wl,--fatal-warnings \
- -Wl,--warn-shared-textrel -Wl,-soname,${LIBRARY_SO}.${VERSION} \
+@@ -15,11 +15,8 @@ PREFIX = /usr/local
+ .if defined(DEBUG)
+ CFLAGS += -g
+ .endif
+-CFLAGS += -D_XOPEN_SOURCE_EXTENDED -fPIC -Wall -Wextra -std=gnu99 \
+- -fstack-protector-strong
+-LDFLAGS += -fstack-protector-strong -shared -Wl,-x -Wl,--fatal-warnings \
+- -Wl,--warn-shared-textrel -Wl,-soname,${LIBRARY_SO}.${VERSION} \
- -L/usr/lib -lncursesw -ltinfow
-+ -L/usr/lib -lcurses
++CFLAGS += -D_XOPEN_SOURCE_EXTENDED -fPIC -Wall -Wextra -std=gnu99
++LDFLAGS += -shared -L${PREFIX}/lib -Wl,-rpath,${PREFIX}/lib -lcurses
LN = ln -s -f
RM = rm -f
-@@ -29,6 +29,7 @@ all: ${LIBRARY}
+@@ -29,6 +26,7 @@ all: ${LIBRARY}
install: all
${INSTALL} -m 0644 bsddialog.h ${DESTDIR}${PREFIX}/include/bsddialog.h
${INSTALL} -m 0644 bsddialog_progressview.h ${DESTDIR}${PREFIX}/include/bsddialog_progressview.h
@@ -23,7 +28,7 @@ Also install bsddialog_theme.h
${INSTALL} -m 0644 ${LIBRARY_A} ${DESTDIR}${PREFIX}/lib/${LIBRARY_A}
${INSTALL} -m 0755 ${LIBRARY_SO}.${VERSION} ${DESTDIR}${PREFIX}/lib/${LIBRARY_SO}.${VERSION}
${LN} ${LIBRARY_SO}.${VERSION} ${DESTDIR}${PREFIX}/lib/${LIBRARY_SO}
-@@ -36,6 +37,7 @@ install: all
+@@ -36,6 +34,7 @@ install: all
uninstall:
${RM} ${DESTDIR}${PREFIX}/include/bsddialog.h
${RM} ${DESTDIR}${PREFIX}/include/bsddialog_progressview.h
diff --git a/bsddialog/patches/patch-utility_util__builders.c b/bsddialog/patches/patch-utility_util__builders.c
new file mode 100644
index 0000000000..1af46e6852
--- /dev/null
+++ b/bsddialog/patches/patch-utility_util__builders.c
@@ -0,0 +1,200 @@
+$NetBSD$
+
+Portability fix
+
+--- utility/util_builders.c.orig 2024-12-03 23:51:29.672563271 +0000
++++ utility/util_builders.c
+@@ -82,7 +82,7 @@ int gauge_builder(BUILDER_ARGS)
+
+ perc = 0;
+ if (argc == 1) {
+- perc = (u_int)strtoul(argv[0], NULL, 10);
++ perc = (unsigned int)strtoul(argv[0], NULL, 10);
+ perc = perc > 100 ? 100 : perc;
+ } else if (argc > 1) {
+ error_args(opt->name, argc - 1, argv + 1);
+@@ -106,7 +106,7 @@ int mixedgauge_builder(BUILDER_ARGS)
+ exit_error(true,
+ "bad %s pair number [<minilabel> <miniperc>]", opt->name);
+
+- mainperc = (u_int)strtoul(argv[0], NULL, 10);
++ mainperc = (unsigned int)strtoul(argv[0], NULL, 10);
+ mainperc = mainperc > 100 ? 100 : mainperc;
+ argc--;
+ argv++;
+@@ -138,7 +138,7 @@ int pause_builder(BUILDER_ARGS)
+ if (argc > 1)
+ error_args(opt->name, argc - 1, argv + 1);
+
+- secs = (u_int)strtoul(argv[0], NULL, 10);
++ secs = (unsigned int)strtoul(argv[0], NULL, 10);
+ output = bsddialog_pause(conf, text, rows, cols, &secs);
+
+ return (output);
+@@ -189,9 +189,9 @@ static int date(BUILDER_ARGS)
+ error_args(opt->name, argc - 3, argv + 3);
+ } else if (argc == 3) {
+ /* lib checks/sets max and min */
+- dd = (u_int)strtoul(argv[0], NULL, 10);
+- mm = (u_int)strtoul(argv[1], NULL, 10);
+- yy = (u_int)strtoul(argv[2], NULL, 10);
++ dd = (unsigned int)strtoul(argv[0], NULL, 10);
++ mm = (unsigned int)strtoul(argv[1], NULL, 10);
++ yy = (unsigned int)strtoul(argv[2], NULL, 10);
+ }
+
+ if (strcmp(opt->name, "--datebox") == 0)
+@@ -259,9 +259,9 @@ int timebox_builder(BUILDER_ARGS)
+ if (argc > 3) {
+ error_args("--timebox", argc - 3, argv + 3);
+ } else if (argc == 3) {
+- hh = (u_int)strtoul(argv[0], NULL, 10);
+- mm = (u_int)strtoul(argv[1], NULL, 10);
+- ss = (u_int)strtoul(argv[2], NULL, 10);
++ hh = (unsigned int)strtoul(argv[0], NULL, 10);
++ mm = (unsigned int)strtoul(argv[1], NULL, 10);
++ ss = (unsigned int)strtoul(argv[2], NULL, 10);
+ }
+
+ output = bsddialog_timebox(conf, text, rows, cols, &hh, &mm, &ss);
+@@ -315,7 +315,7 @@ get_menu_items(int argc, char **argv, bo
+ for (i = 0; i < *nitems; i++) {
+ (*items)[i].prefix = setprefix ? argv[j++] : "";
+ (*items)[i].depth = setdepth ?
+- (u_int)strtoul(argv[j++], NULL, 0) : 0;
++ (unsigned int)strtoul(argv[j++], NULL, 0) : 0;
+ (*items)[i].name = setname ? argv[j++] : "";
+ (*items)[i].desc = setdesc ? argv[j++] : "";
+ if (setstatus) {
+@@ -436,7 +436,7 @@ int checklist_builder(BUILDER_ARGS)
+
+ if (argc < 1)
+ exit_error(true, "--checklist missing <menurows>");
+- menurows = (u_int)strtoul(argv[0], NULL, 10);
++ menurows = (unsigned int)strtoul(argv[0], NULL, 10);
+
+ get_menu_items(argc-1, argv+1, opt->item_prefix, opt->item_depth, true,
+ true, true, opt->item_bottomdesc, &nitems, &items, &focusitem, opt);
+@@ -461,7 +461,7 @@ int menu_builder(BUILDER_ARGS)
+
+ if (argc < 1)
+ exit_error(true, "--menu missing <menurows>");
+- menurows = (u_int)strtoul(argv[0], NULL, 10);
++ menurows = (unsigned int)strtoul(argv[0], NULL, 10);
+
+ get_menu_items(argc-1, argv+1, opt->item_prefix, opt->item_depth, true,
+ true, false, opt->item_bottomdesc, &nitems, &items, &focusitem,
+@@ -487,7 +487,7 @@ int radiolist_builder(BUILDER_ARGS)
+
+ if (argc < 1)
+ exit_error(true, "--radiolist missing <menurows>");
+- menurows = (u_int)strtoul(argv[0], NULL, 10);
++ menurows = (unsigned int)strtoul(argv[0], NULL, 10);
+
+ get_menu_items(argc-1, argv+1, opt->item_prefix, opt->item_depth, true,
+ true, true, opt->item_bottomdesc, &nitems, &items, &focusitem, opt);
+@@ -512,7 +512,7 @@ int treeview_builder(BUILDER_ARGS)
+
+ if (argc < 1)
+ exit_error(true, "--treeview missing <menurows>");
+- menurows = (u_int)strtoul(argv[0], NULL, 10);
++ menurows = (unsigned int)strtoul(argv[0], NULL, 10);
+
+ get_menu_items(argc-1, argv+1, opt->item_prefix, true, true, true, true,
+ opt->item_bottomdesc, &nitems, &items, &focusitem, opt);
+@@ -595,7 +595,7 @@ int form_builder(BUILDER_ARGS)
+
+ if (argc < 1)
+ exit_error(true, "--form missing <formheight>");
+- formheight = (u_int)strtoul(argv[0], NULL, 10);
++ formheight = (unsigned int)strtoul(argv[0], NULL, 10);
+
+ argc--;
+ argv++;
+@@ -609,11 +609,11 @@ int form_builder(BUILDER_ARGS)
+ j = 0;
+ for (i = 0; i < nitems; i++) {
+ items[i].label = argv[j++];
+- items[i].ylabel = (u_int)strtoul(argv[j++], NULL, 10);
+- items[i].xlabel = (u_int)strtoul(argv[j++], NULL, 10);
++ items[i].ylabel = (unsigned int)strtoul(argv[j++], NULL, 10);
++ items[i].xlabel = (unsigned int)strtoul(argv[j++], NULL, 10);
+ items[i].init = argv[j++];
+- items[i].yfield = (u_int)strtoul(argv[j++], NULL, 10);
+- items[i].xfield = (u_int)strtoul(argv[j++], NULL, 10);
++ items[i].yfield = (unsigned int)strtoul(argv[j++], NULL, 10);
++ items[i].xfield = (unsigned int)strtoul(argv[j++], NULL, 10);
+
+ fieldlen = (int)strtol(argv[j++], NULL, 10);
+ if (fieldlen == 0)
+@@ -621,7 +621,7 @@ int form_builder(BUILDER_ARGS)
+ else
+ items[i].fieldlen = abs(fieldlen);
+
+- items[i].maxvaluelen = (u_int)strtoul(argv[j++], NULL, 10);
++ items[i].maxvaluelen = (unsigned int)strtoul(argv[j++], NULL, 10);
+ if (items[i].maxvaluelen == 0)
+ items[i].maxvaluelen = items[i].fieldlen;
+
+@@ -678,7 +678,7 @@ int mixedform_builder(BUILDER_ARGS)
+
+ if (argc < 1)
+ exit_error(true, "--mixedform missing <formheight>");
+- formheight = (u_int)strtoul(argv[0], NULL, 10);
++ formheight = (unsigned int)strtoul(argv[0], NULL, 10);
+
+ argc--;
+ argv++;
+@@ -692,21 +692,21 @@ int mixedform_builder(BUILDER_ARGS)
+ j = 0;
+ for (i = 0; i < nitems; i++) {
+ items[i].label = argv[j++];
+- items[i].ylabel = (u_int)strtoul(argv[j++], NULL, 10);
+- items[i].xlabel = (u_int)strtoul(argv[j++], NULL, 10);
++ items[i].ylabel = (unsigned int)strtoul(argv[j++], NULL, 10);
++ items[i].xlabel = (unsigned int)strtoul(argv[j++], NULL, 10);
+ items[i].init = argv[j++];
+- items[i].yfield = (u_int)strtoul(argv[j++], NULL, 10);
+- items[i].xfield = (u_int)strtoul(argv[j++], NULL, 10);
++ items[i].yfield = (unsigned int)strtoul(argv[j++], NULL, 10);
++ items[i].xfield = (unsigned int)strtoul(argv[j++], NULL, 10);
+ fieldlen = (int)strtol(argv[j++], NULL, 10);
+ if (fieldlen == 0)
+ items[i].fieldlen = strcols(items[i].init);
+ else
+ items[i].fieldlen = abs(fieldlen);
+- items[i].maxvaluelen = (u_int)strtoul(argv[j++], NULL, 10);
++ items[i].maxvaluelen = (unsigned int)strtoul(argv[j++], NULL, 10);
+ if (items[i].maxvaluelen == 0)
+ items[i].maxvaluelen = items[i].fieldlen;
+
+- items[i].flags = (u_int)strtoul(argv[j++], NULL, 10);
++ items[i].flags = (unsigned int)strtoul(argv[j++], NULL, 10);
+ if (fieldlen <= 0)
+ items[i].flags |= BSDDIALOG_FIELDREADONLY;
+
+@@ -765,7 +765,7 @@ int passwordform_builder(BUILDER_ARGS)
+
+ if (argc < 1)
+ exit_error(true, "--passwordform missing <formheight>");
+- formheight = (u_int)strtoul(argv[0], NULL, 10);
++ formheight = (unsigned int)strtoul(argv[0], NULL, 10);
+
+ argc--;
+ argv++;
+@@ -780,11 +780,11 @@ int passwordform_builder(BUILDER_ARGS)
+ j = 0;
+ for (i = 0; i < nitems; i++) {
+ items[i].label = argv[j++];
+- items[i].ylabel = (u_int)strtoul(argv[j++], NULL, 10);
+- items[i].xlabel = (u_int)strtoul(argv[j++], NULL, 10);
++ items[i].ylabel = (unsigned int)strtoul(argv[j++], NULL, 10);
++ items[i].xlabel = (unsigned int)strtoul(argv[j++], NULL, 10);
+ items[i].init = argv[j++];
+- items[i].yfield = (u_int)strtoul(argv[j++], NULL, 10);
+- items[i].xfield = (u_int)strtoul(argv[j++], NULL, 10);
++ items[i].yfield = (unsigned int)strtoul(argv[j++], NULL, 10);
++ items[i].xfield = (unsigned int)strtoul(argv[j++], NULL, 10);
+
+ fieldlen = (int)strtol(argv[j++], NULL, 10);
+ items[i].fieldlen = abs(fieldlen);
Home |
Main Index |
Thread Index |
Old Index