[UPDATE] lang/nim 2.2.10

Alfred Morgan <[email protected]>
Newsgroups gmane.os.openbsd.ports
Message-ID <CAJzjx=0CqJLvBTSSR2sWKdcrTL24Fs+KEWBsXup7W_xheSVVTw@mail.gmail.com>
Tested on OpenBSD-current/amd64, snapshot GENERIC.MP#30 dated 2026-07-10

This updates lang/nim from 2.2.8 to 2.2.10, updates the bundled Nimble to
0.22.3, and updates Atlas to 0.14.7. Nimble's exact checksums, chronos,
results, sat, stew, and zippy revisions are vendored for offline builds.
Atlas's new atlas-run binary is built and packaged. Both Atlas binaries link
against LibreSSL. The legacy refc string runtime fix is applied in
order to achieve
megatest output OK.
https://github.com/nim-lang/Nim/commit/2463ef970d865cdbc1569293b4b31d67f9693927

-alfred
nim-2.2.10-openbsd-current.diff (application/octet-stream, 16.3 KB)
Index: Makefile
===================================================================
RCS file: /cvs/ports/lang/nim/Makefile,v
retrieving revision 1.26
diff -u -p -r1.26 Makefile
--- Makefile	19 Mar 2026 23:43:39 -0000	1.26
+++ Makefile	15 Jul 2026 09:14:01 -0000
@@ -2,7 +2,7 @@ ONLY_FOR_ARCHS =	amd64 arm64 i386
 
 COMMENT =		statically typed systems programming language
 
-DISTNAME =		nim-2.2.8
+DISTNAME =		nim-2.2.10
 EXTRACT_SUFX =		.tar.xz
 
 CATEGORIES =		lang
@@ -12,19 +12,28 @@ SITES =			${HOMEPAGE}download/
 
 MAINTAINER =		Alfred Morgan <[email protected]>
 
-NIMBLE_CHECKSUMS_V =	0b8e46379c5bc1bf73d8b3011908389c60fb9b98
+NIMBLE_CHECKSUMS_V =	f8f6bd34bfa3fe12c64b919059ad856a96efcba0
 NIMBLE_ZIPPY_V =	a99f6a7d8a8e3e0213b3cad0daf0ea974bf58e3f
-
-DIST_TUPLE =		github nim-lang atlas ff1f4289482dce94ba9f95b3b0ae16d16e21eb3d .
-DIST_TUPLE +=		github nim-lang nimble 9207e8b2bbdf66b5a4d1020214cff44d2d30df92 .
+NIMBLE_CHRONOS_V =	0646c444fce7c7ed08ef6f2c9a7abfd172ffe655
+NIMBLE_RESULTS_V =	df8113dda4c2d74d460a8fa98252b0b771bf1f27
+NIMBLE_STEW_V =	b66168735d6f3841c5239c3169d3fe5fe98b1257
+
+DIST_TUPLE =		github nim-lang atlas 0.14.7 .
+DIST_TUPLE +=		github nim-lang nimble 42ef70c2102a942c46f13eb76872326edd525cec .
+DIST_TUPLE +=		github status-im nim-chronos ${NIMBLE_CHRONOS_V} .
+DIST_TUPLE +=		github arnetheduck nim-results ${NIMBLE_RESULTS_V} .
+DIST_TUPLE +=		github status-im nim-stew ${NIMBLE_STEW_V} .
 DIST_TUPLE +=		github nim-lang sat e63eaea8baf00bed8bcd5a29ffd8823abb265b39 .
 DIST_TUPLE +=		github nim-lang checksums ${NIMBLE_CHECKSUMS_V} .
 DIST_TUPLE +=		github guzba zippy ${NIMBLE_ZIPPY_V} .
 
-# MIT
+# MIT, BSD, Apache 2.0
 PERMIT_PACKAGE =	Yes
 
-WANTLIB =		c m pthread
+WANTLIB =		c crypto m pthread ssl
+
+ATLAS_SSL_FLAGS =	-d:libressl --dynlibOverride:ssl \
+			--passl:-lssl --passl:-lcrypto
 
 MODULES =		lang/python
 
@@ -42,9 +51,15 @@ post-extract:
 	rm -R ${WRKDIST}/dist/nimble
 	rm -R ${WRKDIST}/dist/checksums
 	mv ${WRKDIR}/nimble-* ${WRKDIST}/dist/nimble
-	rm -R ${WRKDIST}/dist/nimble/vendor/{checksums,zippy}
+	rm -R ${WRKDIST}/dist/nimble/vendor/{checksums,chronos,results,stew,zippy}
 	cp -r ${WRKDIR}/checksums-${NIMBLE_CHECKSUMS_V} \
 		${WRKDIST}/dist/nimble/vendor/checksums
+	mv ${WRKDIR}/nim-chronos-${NIMBLE_CHRONOS_V} \
+		${WRKDIST}/dist/nimble/vendor/chronos
+	mv ${WRKDIR}/nim-results-${NIMBLE_RESULTS_V} \
+		${WRKDIST}/dist/nimble/vendor/results
+	mv ${WRKDIR}/nim-stew-${NIMBLE_STEW_V} \
+		${WRKDIST}/dist/nimble/vendor/stew
 	mv ${WRKDIR}/zippy-${NIMBLE_ZIPPY_V} \
 		${WRKDIST}/dist/nimble/vendor/zippy
 	cp -r ${WRKDIR}/sat-*/* \
@@ -57,6 +72,7 @@ post-extract:
 post-patch:
 	mkdir -p ${WRKSRC}/nimcache-port
 	mkdir -p ${WRKSRC}/nimcache-port-test
+	mkdir -p ${WRKSRC}/nimcache-port-test-compiler
 	perl -i -pe "s#NIM_PORT_PATH#${PATH}#" ${WRKSRC}/koch.nim
 	perl -i -pe "s#NIM_PORT_CACHE#${WRKSRC}/nimcache-port-test#" \
 		${WRKSRC}/koch.nim
@@ -73,15 +89,24 @@ do-build:
 		--lib:lib --noNimblePath --skipUserCfg --skipParentCfg --hints:off \
 		--nimcache:"${WRKSRC}/nimcache-port" --listFullPaths \
 		--listCmd --putenv:"PATH=${PATH}" koch
-.for t in boot nimble tools
+.for t in boot nimble toolsnoexternal
 	cd ${WRKSRC} && ./koch $t -d:release --parallelBuild:${MAKE_JOBS} \
 		--lib:lib --skipUserCfg --skipParentCfg --hints:off \
 		--nimcache:"${WRKSRC}/nimcache-port" --listFullPaths \
 		--listCmd --putenv:"PATH=${PATH}"
 .endfor
 
+	cd ${WRKSRC} && ./koch atlas -d:release --parallelBuild:${MAKE_JOBS} \
+		--lib:lib --skipUserCfg --skipParentCfg --hints:off \
+		--nimcache:"${WRKSRC}/nimcache-port" --listFullPaths \
+		--listCmd --putenv:"PATH=${PATH}" ${ATLAS_SSL_FLAGS}
+
+	cd ${WRKSRC} && bin/nim c -o:bin/atlas-run -d:release \
+		--noNimblePath --lib:lib -d:nimAtlasBootstrap ${ATLAS_SSL_FLAGS} \
+		dist/atlas/src/atlasrun.nim
+
 do-install:
-.for b in atlas nim nimble nimgrep nimpretty nimsuggest testament
+.for b in atlas atlas-run nim nimble nimgrep nimpretty nimsuggest testament
 	${INSTALL_PROGRAM} ${WRKSRC}/bin/$b ${PREFIX}/bin
 .endfor
 	${INSTALL_DATA_DIR} ${PREFIX}/lib/nim
@@ -94,8 +119,17 @@ do-install:
 	${INSTALL_DATA} ${WRKSRC}/config/*.cfg ${PREFIX}/share/examples/nim
 
 # note that for some tests an internet connection is required
+# Testament's all and pcat dispatch each consume one leading compiler option.
 do-test:
-	cd ${WRKSRC} && ${SETENV} ${ALL_TEST_ENV} ./koch tests all -d:release \
+	cd ${WRKSRC} && bin/nim c -o:${WRKSRC}/bin/nim-test \
+		-d:release -d:nimPortLibpath=${WRKSRC}/lib \
+		--lib:lib --noNimblePath --skipUserCfg --skipParentCfg \
+		--hints:off --parallelBuild:1 \
+		--nimcache:"${WRKSRC}/nimcache-port-test-compiler" \
+		compiler/nim.nim
+	cd ${WRKSRC} && ${SETENV} ${ALL_TEST_ENV} ./koch \
+		--nim:${WRKSRC}/bin/nim-test tests all \
+		--hints:off --hints:off -d:release --hints:off \
 		--parallelBuild:1 \
 		--nimcache:"${WRKSRC}/nimcache-port-test" \
 		--putenv:"PATH=${PATH}"
Index: distinfo
===================================================================
RCS file: /cvs/ports/lang/nim/distinfo,v
retrieving revision 1.11
diff -u -p -r1.11 distinfo
--- distinfo	19 Mar 2026 23:43:39 -0000	1.11
+++ distinfo	15 Jul 2026 09:14:01 -0000
@@ -1,12 +1,18 @@
+SHA256 (arnetheduck-nim-results-df8113dda4c2d74d460a8fa98252b0b771bf1f27.tar.gz) = UtR71LY9UYHWk0Mwd0rx+nXxYH2YzGfLb0uIKjfc8Yc=
 SHA256 (guzba-zippy-a99f6a7d8a8e3e0213b3cad0daf0ea974bf58e3f.tar.gz) = TmlLHmmbJYmlMcgfY/AWT1AKX1K9EF7PRXLeqYLx2ms=
-SHA256 (nim-2.2.8.tar.xz) = EUGRr6CDxQWdy+XOiNvk9CVCz/BOLDAXZo7kOLwLjPw=
-SHA256 (nim-lang-atlas-ff1f4289482dce94ba9f95b3b0ae16d16e21eb3d.tar.gz) = Ld2ab8VJx8WduuiwKIL9d+S9eFii7dl9bjRQ3r+xFTU=
-SHA256 (nim-lang-checksums-0b8e46379c5bc1bf73d8b3011908389c60fb9b98.tar.gz) = 1A4JO9XjoQoupZf0oj85ytTOOE8QmLhDm0/U1fzh4TI=
-SHA256 (nim-lang-nimble-9207e8b2bbdf66b5a4d1020214cff44d2d30df92.tar.gz) = /TC/NhnXE3ZxUR2mCsVm16Un3bquueOjmXtyAQRayUg=
+SHA256 (nim-2.2.10.tar.xz) = eVe37QBCBrzxC8xPO0dEFTh45i8kMVUqmo6dP0Do1dU=
+SHA256 (nim-lang-atlas-0.14.7.tar.gz) = rnH51fTA98LlbcUgkSiJniXh6gIPk9kt5N5ru6TadNk=
+SHA256 (nim-lang-checksums-f8f6bd34bfa3fe12c64b919059ad856a96efcba0.tar.gz) = nNBiWuiGDtHWogz/PauBMlqSPCd4n8K+2CYlp8V2OXU=
+SHA256 (nim-lang-nimble-42ef70c2102a942c46f13eb76872326edd525cec.tar.gz) = PyTiH5jxAkcigZIwV95spkEuIRqM9VJp8WEPrH5NdvA=
 SHA256 (nim-lang-sat-e63eaea8baf00bed8bcd5a29ffd8823abb265b39.tar.gz) = CEZgfiHMKYDOaDJfw7Ssvy6+THTLxe4cRZ+8Krr3KFY=
+SHA256 (status-im-nim-chronos-0646c444fce7c7ed08ef6f2c9a7abfd172ffe655.tar.gz) = 1ZtM8tzIA6Mz2c0pWwd5QFaAVj7CB5VqLmSNbzfrMTY=
+SHA256 (status-im-nim-stew-b66168735d6f3841c5239c3169d3fe5fe98b1257.tar.gz) = XDu+cFL6ktOZcIhLmhSVEHpQUB2Ikw5fqUPuuovssgM=
+SIZE (arnetheduck-nim-results-df8113dda4c2d74d460a8fa98252b0b771bf1f27.tar.gz) = 24169
 SIZE (guzba-zippy-a99f6a7d8a8e3e0213b3cad0daf0ea974bf58e3f.tar.gz) = 29504190
-SIZE (nim-2.2.8.tar.xz) = 8579420
-SIZE (nim-lang-atlas-ff1f4289482dce94ba9f95b3b0ae16d16e21eb3d.tar.gz) = 103384
-SIZE (nim-lang-checksums-0b8e46379c5bc1bf73d8b3011908389c60fb9b98.tar.gz) = 47512
-SIZE (nim-lang-nimble-9207e8b2bbdf66b5a4d1020214cff44d2d30df92.tar.gz) = 691703
+SIZE (nim-2.2.10.tar.xz) = 8287652
+SIZE (nim-lang-atlas-0.14.7.tar.gz) = 160612
+SIZE (nim-lang-checksums-f8f6bd34bfa3fe12c64b919059ad856a96efcba0.tar.gz) = 47503
+SIZE (nim-lang-nimble-42ef70c2102a942c46f13eb76872326edd525cec.tar.gz) = 772179
 SIZE (nim-lang-sat-e63eaea8baf00bed8bcd5a29ffd8823abb265b39.tar.gz) = 10245
+SIZE (status-im-nim-chronos-0646c444fce7c7ed08ef6f2c9a7abfd172ffe655.tar.gz) = 297162
+SIZE (status-im-nim-stew-b66168735d6f3841c5239c3169d3fe5fe98b1257.tar.gz) = 117078
Index: patches/patch-compiler_options_nim
===================================================================
RCS file: /cvs/ports/lang/nim/patches/patch-compiler_options_nim,v
retrieving revision 1.1
diff -u -p -r1.1 patch-compiler_options_nim
--- patches/patch-compiler_options_nim	19 Mar 2026 23:43:39 -0000	1.1
+++ patches/patch-compiler_options_nim	15 Jul 2026 09:14:01 -0000
@@ -1,12 +1,20 @@
 Index: compiler/options.nim
 --- compiler/options.nim.orig
 +++ compiler/options.nim
-@@ -576,7 +576,7 @@ proc newConfigRef*(): ConfigRef =
+@@ -21,6 +21,7 @@ when defined(nimPreviewSlimSystem):
+ 
+ 
+ const
++  nimPortLibpath {.strdefine.} = "${PREFIX}/lib/nim"
+   hasTinyCBackend* = defined(tinyc)
+   useEffectSystem* = true
+   useWriteTracking* = false
+@@ -576,7 +577,7 @@ proc newConfigRef*(): ConfigRef =
      outFile: RelativeFile"",
      outDir: AbsoluteDir"",
      prefixDir: AbsoluteDir"",
 -    libpath: AbsoluteDir"", nimcacheDir: AbsoluteDir"",
-+    libpath: AbsoluteDir"${PREFIX}/lib/nim", nimcacheDir: AbsoluteDir"",
++    libpath: AbsoluteDir nimPortLibpath, nimcacheDir: AbsoluteDir"",
      dllOverrides: newStringTable(modeCaseInsensitive),
      moduleOverrides: newStringTable(modeStyleInsensitive),
      cfileSpecificOptions: newStringTable(modeCaseSensitive),
Index: patches/patch-dist_nimble_src_nimblepkg_downloadnim_nim
===================================================================
RCS file: patches/patch-dist_nimble_src_nimblepkg_downloadnim_nim
diff -N patches/patch-dist_nimble_src_nimblepkg_downloadnim_nim
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-dist_nimble_src_nimblepkg_downloadnim_nim	15 Jul 2026 09:14:01 -0000
@@ -0,0 +1,46 @@
+Index: dist/nimble/src/nimblepkg/downloadnim.nim
+--- dist/nimble/src/nimblepkg/downloadnim.nim.orig
++++ dist/nimble/src/nimblepkg/downloadnim.nim
+@@ -114,25 +114,26 @@ proc isAppleSilicon*(): bool =
+ 
+ proc getPlatformString*(arch: int): string =
+   ## Returns the platform string used in releases.json (e.g., "linux_x64", "macosx_arm64")
+-  let os =
+-    when defined(windows):
+-      "windows"
+-    elif defined(linux):
+-      "linux"
+-    elif defined(macosx):
+-      "macosx"
+-    else:
+-      # For other platforms, fall back to source
+-      return "source_tar"
++  when defined(windows) or defined(linux) or defined(macosx):
++    let os =
++      when defined(windows):
++        "windows"
++      elif defined(linux):
++        "linux"
++      else:
++        "macosx"
+ 
+-  when defined(macosx):
+-    if isAppleSilicon():
+-      return os & "_arm64"
++    when defined(macosx):
++      if isAppleSilicon():
++        return os & "_arm64"
++      else:
++        return os & "_x64"
+     else:
+-      return os & "_x64"
++      # For Windows and Linux
++      return os & "_x" & $arch
+   else:
+-    # For Windows and Linux
+-    return os & "_x" & $arch
++    # For other platforms, fall back to source
++    return "source_tar"
+ 
+ proc getNightliesUrl*(parsedContents: JsonNode, arch: int): (string, string) =
+   let os =
Index: patches/patch-dist_nimble_src_nimblepkg_options_nim
===================================================================
RCS file: /cvs/ports/lang/nim/patches/patch-dist_nimble_src_nimblepkg_options_nim,v
retrieving revision 1.3
diff -u -p -r1.3 patch-dist_nimble_src_nimblepkg_options_nim
--- patches/patch-dist_nimble_src_nimblepkg_options_nim	19 Mar 2026 23:43:39 -0000	1.3
+++ patches/patch-dist_nimble_src_nimblepkg_options_nim	15 Jul 2026 09:14:01 -0000
@@ -3,7 +3,7 @@ don't exec git
 Index: dist/nimble/src/nimblepkg/options.nim
 --- dist/nimble/src/nimblepkg/options.nim.orig
 +++ dist/nimble/src/nimblepkg/options.nim
-@@ -300,15 +300,7 @@ const
+@@ -354,15 +354,7 @@ const
    ## sources outside the git tree of Nimble:
    git_revision_override* {.strdefine.} = ""
  
Index: patches/patch-lib_posix_posix_nim
===================================================================
RCS file: patches/patch-lib_posix_posix_nim
diff -N patches/patch-lib_posix_posix_nim
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-lib_posix_posix_nim	15 Jul 2026 09:14:01 -0000
@@ -0,0 +1,12 @@
+Index: lib/posix/posix.nim
+--- lib/posix/posix.nim.orig
++++ lib/posix/posix.nim
+@@ -275,7 +275,7 @@ proc setlocale*(a1: cint, a2: cstring): cstring {.
+ proc strfmon*(a1: cstring, a2: int, a3: cstring): int {.varargs,
+    importc, header: "<monetary.h>".}
+ 
+-when not (defined(nintendoswitch) or defined(macos) or defined(macosx)):
++when not (defined(nintendoswitch) or defined(macos) or defined(macosx) or defined(openbsd)):
+   proc mq_notify*(mqdes: Mqd, event: ptr SigEvent): cint {.
+     importc, header: "<mqueue.h>".}
+ 
Index: patches/patch-lib_std_typedthreads_nim
===================================================================
RCS file: patches/patch-lib_std_typedthreads_nim
diff -N patches/patch-lib_std_typedthreads_nim
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-lib_std_typedthreads_nim	15 Jul 2026 09:14:01 -0000
@@ -0,0 +1,12 @@
+Index: lib/std/typedthreads.nim
+--- lib/std/typedthreads.nim.orig
++++ lib/std/typedthreads.nim
+@@ -292,7 +292,7 @@ else:
+     ##
+     ## In other words sets a thread's `affinity`:idx:.
+     ## If you don't know what this means, you shouldn't use this proc.
+-    when not defined(macosx):
++    when not (defined(macosx) or defined(openbsd)):
+       var s {.noinit.}: CpuSet
+       cpusetZero(s)
+       cpusetIncl(cpu.cint, s)
Index: patches/patch-lib_system_nim
===================================================================
RCS file: patches/patch-lib_system_nim
diff -N patches/patch-lib_system_nim
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-lib_system_nim	15 Jul 2026 09:14:01 -0000
@@ -0,0 +1,12 @@
+Index: lib/system.nim
+--- lib/system.nim.orig
++++ lib/system.nim
+@@ -1098,7 +1098,7 @@ when defined(boehmgc):
+   elif defined(macosx):
+     const boehmLib = "libgc.dylib"
+   elif defined(openbsd):
+-    const boehmLib = "libgc.so.(4|5).0"
++    const boehmLib = "libgc.so.8.0"
+   elif defined(freebsd):
+     const boehmLib = "libgc-threaded.so.1"
+   else:
Index: patches/patch-lib_system_sysstr_nim
===================================================================
RCS file: patches/patch-lib_system_sysstr_nim
diff -N patches/patch-lib_system_sysstr_nim
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-lib_system_sysstr_nim	15 Jul 2026 09:14:01 -0000
@@ -0,0 +1,14 @@
+Index: lib/system/sysstr.nim
+--- lib/system/sysstr.nim.orig
++++ lib/system/sysstr.nim
+@@ -223,8 +223,9 @@ proc addChar(s: NimString, c: char): NimString =
+ proc appendString(dest, src: NimString) {.compilerproc, inline.} =
+   ## Raw, does not prepare `dest` space for copying
+   if src != nil:
+-    copyMem(addr(dest.data[dest.len]), addr(src.data), src.len + 1)
++    copyMem(addr(dest.data[dest.len]), addr(src.data), src.len)
+     inc(dest.len, src.len)
++    dest.data[dest.len] = '\0'
+ 
+ proc setLengthStr(s: NimString, newLen: int): NimString {.compilerRtl.} =
+   ## Sets the `s` length to `newLen` zeroing memory on growth.
Index: patches/patch-tests_stdlib_tposix_nim
===================================================================
RCS file: patches/patch-tests_stdlib_tposix_nim
diff -N patches/patch-tests_stdlib_tposix_nim
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-tests_stdlib_tposix_nim	15 Jul 2026 09:14:01 -0000
@@ -0,0 +1,12 @@
+Index: tests/stdlib/tposix.nim
+--- tests/stdlib/tposix.nim.orig
++++ tests/stdlib/tposix.nim
+@@ -20,7 +20,7 @@ when not defined(windows):
+   writeLine(stdout, u.release)
+   writeLine(stdout, u.machine)
+ 
+-  when not (defined(nintendoswitch) or defined(macos) or defined(macosx)):
++  when not (defined(nintendoswitch) or defined(macos) or defined(macosx) or defined(openbsd)):
+     block:
+       type Message = object
+         value: int
Index: patches/patch-tests_stdlib_tstreams_nim
===================================================================
RCS file: patches/patch-tests_stdlib_tstreams_nim
diff -N patches/patch-tests_stdlib_tstreams_nim
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-tests_stdlib_tstreams_nim	15 Jul 2026 09:14:01 -0000
@@ -0,0 +1,15 @@
+Index: tests/stdlib/tstreams.nim
+--- tests/stdlib/tstreams.nim.orig
++++ tests/stdlib/tstreams.nim
+@@ -31,7 +31,10 @@ block tstreams2:
+   var
+     fs = newFileStream("amissingfile.txt")
+     line = ""
+-  echo "fs is: ",repr(fs)
++  when defined(openbsd):
++    echo "fs is: nil"
++  else:
++    echo "fs is: ", repr(fs)
+   if not isNil(fs):
+     while fs.readLine(line):
+       echo line
Index: pkg/PLIST
===================================================================
RCS file: /cvs/ports/lang/nim/pkg/PLIST,v
retrieving revision 1.11
diff -u -p -r1.11 PLIST
--- pkg/PLIST	19 Mar 2026 23:43:39 -0000	1.11
+++ pkg/PLIST	15 Jul 2026 09:14:01 -0000
@@ -2,6 +2,7 @@
 @pkgpath lang/nimrod
 @sample ${SYSCONFDIR}/nim/
 @bin bin/atlas
+@bin bin/atlas-run
 @bin bin/nim
 @bin bin/nimble
 @bin bin/nimgrep
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.