Hello,

Please find attached a patch for editors/micro 2.0.15, with a
REVISION bump.

The main changes are:

- Fix the embedded version string by removing the "v" prefix from
  MODGO_VERSION. Micro parses this value using blang/semver at startup,
  which rejects the prefixed version.
- Set WRKDIST explicitly to the Go module extraction directory.
- Use OpenBSD's base-system doas instead of sudo as the default
  privilege escalation command when saving protected files.
- Update the bundled help and configuration example accordingly.

The privilege command remains configurable through the existing
"sucmd" option. No additional runtime dependency is required.

Thank you for your time and consideration.

Best regards,
David.
Index: editors/micro/Makefile
===================================================================
RCS file: /cvs/ports/editors/micro/Makefile,v
diff -u -p -u -p -r1.15 Makefile
--- editors/micro/Makefile	1 Jan 2026 14:44:40 -0000	1.15
+++ editors/micro/Makefile	16 Oct 2026 02:10:07 -0000
@@ -1,23 +1,29 @@
-COMMENT=	modern and intuitive terminal-based text editor
+COMMENT =	modern and intuitive terminal-based text editor
 
-MODGO_MODNAME=	github.com/zyedidia/micro/v2
-MODGO_VERSION=	v2.0.15
+MODGO_MODNAME =	github.com/zyedidia/micro/v2
+MODGO_VERSION =	v2.0.15
 
-DISTNAME=	micro-${MODGO_VERSION}
-CATEGORIES=	editors
-HOMEPAGE=	https://micro-editor.github.io/
+DISTNAME =	micro-${MODGO_VERSION}
+REVISION =       0
+WRKDIST = 	${WRKDIR}/${MODGO_MODNAME}@${MODGO_VERSION}
+CATEGORIES =	editors
+HOMEPAGE =	https://micro-editor.github.io/
 
 # MIT "Expat" License
-PERMIT_PACKAGE=	Yes
+PERMIT_PACKAGE =	Yes
 
 WANTLIB += c pthread
 
-MODULES=	lang/go
-MODGO_TYPE=	bin
+MODULES =	lang/go
+MODGO_TYPE =	bin
 
-MODGO_LDFLAGS=	-X github.com/zyedidia/micro/v2/internal/util.Version=${MODGO_VERSION}
+# micro parses the embedded version with blang/semver at startup
+# (internal/util/util.go).  Upstream's tools/build-version.go emits the numeric
+# form (version.String()), so the Go module "v" prefix must be stripped here or
+# semver rejects it ("Invalid character(s) found in major number \"v2\"").
+MODGO_LDFLAGS =	-X github.com/zyedidia/micro/v2/internal/util.Version=${MODGO_VERSION:S/^v//}
 
-NO_TEST=	Yes
+NO_TEST =	Yes
 
 post-install:
 	${INSTALL_DATA} ${WRKSRC}/assets/packaging/micro.1 ${PREFIX}/man/man1/
Index: editors/micro/patches/patch-internal_config_settings_go
===================================================================
RCS file: editors/micro/patches/patch-internal_config_settings_go
diff -N editors/micro/patches/patch-internal_config_settings_go
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ editors/micro/patches/patch-internal_config_settings_go	16 Oct 2026 02:10:07 -0000
@@ -0,0 +1,15 @@
+Use base-system doas as the default privilege command on OpenBSD.
+Keep upstream sucmd configuration and its save/truncate call sites intact.
+
+Index: internal/config/settings.go
+--- internal/config/settings.go.orig
++++ internal/config/settings.go
+@@ -128,7 +128,7 @@
+ 	"pluginrepos":    []string{},
+ 	"savehistory":    true,
+ 	"scrollbarchar":  "|",
+-	"sucmd":          "sudo",
++	"sucmd":          "doas",
+ 	"tabhighlight":   false,
+ 	"tabreverse":     true,
+ 	"xterm":          false,
Index: editors/micro/patches/patch-runtime_help_options_md
===================================================================
RCS file: editors/micro/patches/patch-runtime_help_options_md
diff -N editors/micro/patches/patch-runtime_help_options_md
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ editors/micro/patches/patch-runtime_help_options_md	16 Oct 2026 02:10:07 -0000
@@ -0,0 +1,23 @@
+Document the OpenBSD port's doas default in the bundled help and example.
+
+Index: runtime/help/options.md
+--- runtime/help/options.md.orig
++++ runtime/help/options.md
+@@ -454,7 +454,7 @@
+    on BSD it can be "doas." This option can be customized and is only used when
+    saving with su.
+ 
+-    default value: `sudo`
++    default value: `doas`
+ 
+ * `syntax`: enables syntax highlighting.
+ 
+@@ -624,7 +624,7 @@
+     "statusformatl": "$(filename) $(modified)$(overwrite)($(line),$(col)) $(status.paste)| ft:$(opt:filetype) | $(opt:fileformat) | $(opt:encoding)",
+     "statusformatr": "$(bind:ToggleKeyMenu): bindings, $(bind:ToggleHelp): help",
+     "statusline": true,
+-    "sucmd": "sudo",
++    "sucmd": "doas",
+     "syntax": true,
+     "tabhighlight": true,
+     "tabmovement": false,

Reply via email to