Hi,
thank you everyone for the feedback.

On Fri, Jan 15, 2021 at 05:01:19PM +0000, Stuart Henderson wrote:
> 3 days is way too soon to be prodding really, especially for what is
> a relatively specialist port that most ports devs won't use. Anyway a
> few quick comments I am short on time - as mentioned by others please
> send a diff not a tar for updates. Use cvs add / cvs rm if there are
> any new/removed files and cvs diff -uNp.
> 
> patch-config_nim_cfg:
> -cc = gcc
> +cc = clang
> 
> The compiler should be passed from the port in CC not hardcoded.
nim.cfg is read by the nim compiler to know what C compiler it has to run
when it is going to compile nim code.
It cannot be left neither unset nor set to cc %= "$CC", otherwise the
compilation will fail.
That said, I added the --cc:$CC parameter in Makefile order to let the port
build with the compiler of choice, as long as it is supported by nim. This
parameter will override the value in nim.cfg during the building of the port.


> 
> PLIST: missing @sample for the new cfg file
Now it should be ok.

$ grep sample pkg/PLIST                                                         
                                                                                
             
@sample ${SYSCONFDIR}/nim/
@sample ${SYSCONFDIR}/nim/nim.cfg
@sample ${SYSCONFDIR}/nim/nimdoc.cfg
@sample ${SYSCONFDIR}/nim/nimdoc.tex.cfg

 
> Makefile: drop REVISION, maybe the --parallelBuild:1 should really
> be ${MAKE_JOBS} instead of 1
>
Fixed.


Best regards,
Luca De Pandis




Index: Makefile
===================================================================
RCS file: /cvs/ports/lang/nim/Makefile,v
retrieving revision 1.11
diff -u -p -u -p -r1.11 Makefile
--- Makefile    2 May 2020 09:33:06 -0000       1.11
+++ Makefile    16 Jan 2021 13:10:55 -0000
@@ -6,7 +6,7 @@ BROKEN-i386 = hardcodes gcc; see config/
 
 COMMENT =              statically typed, imperative programming language
 
-VERSION =              1.2.0
+VERSION =              1.4.2
 DISTNAME =             nim-${VERSION}
 EXTRACT_SUFX =         .tar.xz
 REVISION =             0
@@ -22,6 +22,13 @@ PERMIT_PACKAGE =     Yes
 
 WANTLIB =              c m
 
+# cc is not a supported compiler, so CC has to be set as clang instead
+CC =                   clang
+
+MODULES =              lang/python
+
+MODPY_VERSION =                ${MODPY_DEFAULT_VERSION_3}
+
 post-patch:
        mkdir -p ${WRKSRC}/nimcache-port
        mkdir -p ${WRKSRC}/nimcache-port-test
@@ -33,15 +40,15 @@ do-build:
        cd ${WRKSRC} && ${SETENV} CC="${CC}" LINKER="${CC}" \
                CFLAGS="${CFLAGS}" sh build.sh
        # slow machines can get a head of themselves and fail to link
-       cd ${WRKSRC} && bin/nim c -d:release --parallelBuild:1 \
+       cd ${WRKSRC} && bin/nim c -d:release --parallelBuild:${MAKE_JOBS} \
                --nimcache:"${WRKSRC}/nimcache-port" --listFullPaths \
-               --listCmd --putenv:"PATH=${PATH}" koch
-       cd ${WRKSRC} && ./koch boot -d:release --parallelBuild:1 \
+               --listCmd --putenv:"PATH=${PATH}" --cc:${CC} koch
+       cd ${WRKSRC} && ./koch boot -d:release --parallelBuild:${MAKE_JOBS} \
                --nimcache:"${WRKSRC}/nimcache-port" --listFullPaths \
-               --listCmd --putenv:"PATH=${PATH}"
-       cd ${WRKSRC} && ./koch nimble -d:release --parallelBuild:1 \
+               --listCmd --putenv:"PATH=${PATH}" --cc:${CC}
+       cd ${WRKSRC} && ./koch nimble -d:release --parallelBuild:${MAKE_JOBS} \
                --nimcache:"${WRKSRC}/nimcache-port" --listFullPaths \
-               --listCmd --putenv:"PATH=${PATH}"
+               --listCmd --putenv:"PATH=${PATH}" --cc:${CC}
 
 do-install:
        ${INSTALL_PROGRAM_DIR} ${PREFIX}/bin
@@ -54,11 +61,13 @@ do-install:
        ${INSTALL_DATA} ${WRKSRC}/doc/*.txt ${PREFIX}/share/doc/nim
        ${INSTALL_DATA_DIR} ${PREFIX}/share/examples/nim
        ${INSTALL_DATA} ${WRKSRC}/config/*.cfg ${PREFIX}/share/examples/nim
+       ${MODPY_BIN} ${MODPY_LIBDIR}/compileall.py \
+               ${PREFIX}/lib/nim/pure/unidecode/gen.py
 
 do-test:
        cd ${WRKSRC} && ${SETENV} ./koch test all -d:release \
-               --parallelBuild:1 --listFullPaths --listCmd \
+               --parallelBuild:${MAKE_JOBS} --listFullPaths --listCmd \
                --nimcache:"${WRKSRC}/nimcache-port-test" \
-               --putenv:"PATH=${PATH}"
+               --putenv:"PATH=${PATH}" --cc:${CC}
 
 .include <bsd.port.mk>
Index: distinfo
===================================================================
RCS file: /cvs/ports/lang/nim/distinfo,v
retrieving revision 1.5
diff -u -p -u -p -r1.5 distinfo
--- distinfo    2 May 2020 09:33:06 -0000       1.5
+++ distinfo    16 Jan 2021 13:10:55 -0000
@@ -1,2 +1,2 @@
-SHA256 (nim-1.2.0.tar.xz) = TpRYOjc5ZYIYBeZl4KBfUvthCRZnbtsJFIlBQVY3xXU=
-SIZE (nim-1.2.0.tar.xz) = 5869428
+SHA256 (nim-1.4.2.tar.xz) = 
03a47583777dd81380a3407aa6a788c9aa8a67df4821025770c9ac4186291161
+SIZE (nim-1.4.2.tar.xz) = 4770616
Index: patches/patch-install_sh
===================================================================
RCS file: /cvs/ports/lang/nim/patches/patch-install_sh,v
retrieving revision 1.1
diff -u -p -u -p -r1.1 patch-install_sh
--- patches/patch-install_sh    2 May 2020 09:33:06 -0000       1.1
+++ patches/patch-install_sh    16 Jan 2021 13:10:55 -0000
@@ -1,4 +1,7 @@
---- install.sh.orig 2020-04-03 17:25:49 UTC
+$OpenBSD$
+
+Index: install.sh
+--- install.sh.orig
 +++ install.sh
 @@ -15,48 +15,14 @@ if [ $# -eq 1 ] ; then
      "--help"|"-h"|"help"|"h")
@@ -19,7 +22,7 @@
 -      libdir=/usr/lib/nim
 -      docdir=/usr/share/nim/doc
 -      datadir=/usr/share/nim/data
--      nimbleDir="/opt/nimble/pkgs/compiler-1.2.0"
+-      nimbleDir="/opt/nimble/pkgs/compiler-1.4.2"
 -      ;;
 -    "/usr/local/bin")
 -      bindir=/usr/local/bin
@@ -27,7 +30,7 @@
 -      libdir=/usr/local/lib/nim
 -      docdir=/usr/local/share/nim/doc
 -      datadir=/usr/local/share/nim/data
--      nimbleDir="/opt/nimble/pkgs/compiler-1.2.0"
+-      nimbleDir="/opt/nimble/pkgs/compiler-1.4.2"
 -      ;;
 -    "/opt")
 -      bindir="/opt/nim/bin"
@@ -35,7 +38,7 @@
 -      libdir="/opt/nim/lib"
 -      docdir="/opt/nim/doc"
 -      datadir="/opt/nim/data"
--      nimbleDir="/opt/nimble/pkgs/compiler-1.2.0"
+-      nimbleDir="/opt/nimble/pkgs/compiler-1.4.2"
 -      mkdir -p /opt/nim
 -      mkdir -p $bindir
 -      mkdir -p $configdir
@@ -54,7 +57,7 @@
        nimbleDir="$1/nim"
        mkdir -p $1/nim
        mkdir -p $bindir
-@@ -973,13 +939,6 @@ chmod 644 $nimbleDir/compiler.nimble
+@@ -1044,13 +1010,6 @@ chmod 644 $nimbleDir/compiler.nimble
  else
    echo "Nim installation script"
    echo "Usage: [sudo] sh install.sh DIR"

Reply via email to