- Update to nim 0.11.2
- Enable the tests
- lang/nimrod -> lang/nim

OK jturner@

Comment:
statically typed, imperative programming language

Description:
Nim is a statically typed, imperative programming language that tries
to give the programmer ultimate power without compromises on runtime
efficiency. This means it focuses on compile-time mechanisms in all
their various forms.

Beneath a nice infix/indentation based syntax with a powerful (AST
based, hygienic) macro system lies a semantic model that supports a soft
realtime GC on thread local heaps. Asynchronous message passing is used
between threads, so no "stop the world" mechanism is necessary. An
unsafe shared memory heap is also provided for the increased efficiency
that results from that model.

Maintainer: James Turner <james@calminferno.net>

WWW: http://nim-lang.org/
This commit is contained in:
juanfra 2015-10-19 21:50:14 +00:00
parent c90736585a
commit 8d456a4ddc
8 changed files with 472 additions and 0 deletions

44
lang/nim/Makefile Normal file
View File

@ -0,0 +1,44 @@
# $OpenBSD: Makefile,v 1.1.1.1 2015/10/19 21:50:14 juanfra Exp $
ONLY_FOR_ARCHS = i386 amd64
COMMENT = statically typed, imperative programming language
VERSION = 0.11.2
DISTNAME = nim-${VERSION}
EXTRACT_SUFX = .tar.xz
CATEGORIES = lang
MAINTAINER = James Turner <james@calminferno.net>
HOMEPAGE = http://nim-lang.org/
MASTER_SITES = http://nim-lang.org/download/
# MIT
PERMIT_PACKAGE_CDROM = Yes
WANTLIB = c m
do-build:
cd ${WRKDIST} && ${SETENV} CC="${CC}" LINKER="${CC}" \
COMP_FLAGS="${CFLAGS}" sh build.sh
# slow machines can get a head of themselves and fail to link
cd ${WRKSRC} && ${SETENV} bin/nim c --parallelBuild:1 koch
cd ${WRKSRC} && ${SETENV} ./koch boot -d:release --parallelBuild:1
do-install:
${INSTALL_PROGRAM_DIR} ${PREFIX}/bin
${INSTALL_PROGRAM} ${WRKSRC}/bin/nim ${PREFIX}/bin
${INSTALL_DATA_DIR} ${PREFIX}/lib/nim
cp -R ${WRKSRC}/lib/* ${PREFIX}/lib/nim
chown -R ${LIBOWN}:${LIBGRP} ${PREFIX}/lib/nim
${INSTALL_DATA_DIR} ${PREFIX}/share/doc/nim
${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
do-test:
cd ${WRKSRC} && ${SETENV} ./koch test all -d:release --parallelBuild:1
.include <bsd.port.mk>

2
lang/nim/distinfo Normal file
View File

@ -0,0 +1,2 @@
SHA256 (nim-0.11.2.tar.xz) = VkDjZNi6zsgw8Bba89RCeRHEjOv5YnJOyQP+pdWnpBk=
SIZE (nim-0.11.2.tar.xz) = 2587012

View File

@ -0,0 +1,16 @@
$OpenBSD: patch-build_sh,v 1.1.1.1 2015/10/19 21:50:14 juanfra Exp $
--- build.sh.orig Sun Sep 13 00:49:57 2015
+++ build.sh Sun Sep 13 00:52:17 2015
@@ -26,9 +26,9 @@ do
esac
done
-CC="gcc"
-LINKER="gcc"
-COMP_FLAGS="-w -O3 -fno-strict-aliasing$extraBuildArgs"
+#CC="gcc"
+#LINKER="gcc"
+COMP_FLAGS="-w -fno-strict-aliasing$extraBuildArgs $COMP_FLAGS"
LINK_FLAGS=""
# platform detection
ucpu=`uname -m`

View File

@ -0,0 +1,47 @@
$OpenBSD: patch-compiler_extccomp_nim,v 1.1.1.1 2015/10/19 21:50:14 juanfra Exp $
--- compiler/extccomp.nim.orig Sun Sep 13 00:55:21 2015
+++ compiler/extccomp.nim Sun Sep 13 01:01:06 2015
@@ -18,7 +18,7 @@ import
type
TSystemCC* = enum
ccNone, ccGcc, ccLLVM_Gcc, ccCLang, ccLcc, ccBcc, ccDmc, ccWcc, ccVcc,
- ccTcc, ccPcc, ccUcc, ccIcl
+ ccTcc, ccPcc, ccUcc, ccIcl, ccEGcc
TInfoCCProp* = enum # properties of the C compiler:
hasSwitchRange, # CC allows ranges in switch statements (GNU C)
hasComputedGoto, # CC has computed goto (GNU C extension)
@@ -66,8 +66,8 @@ compiler gcc:
result = (
name: "gcc",
objExt: "o",
- optSpeed: " -O3 -ffast-math ",
- optSize: " -Os -ffast-math ",
+ optSpeed: " -O2 ",
+ optSize: " -Os ",
compilerExe: "gcc",
cppCompiler: "g++",
compileTmpl: "-c $options $include -o $objfile $file",
@@ -87,6 +87,13 @@ compiler gcc:
props: {hasSwitchRange, hasComputedGoto, hasCpp, hasGcGuard, hasGnuAsm,
hasNakedAttribute})
+compiler egcc:
+ result = gcc()
+
+ result.name = "egcc"
+ result.compilerExe = "egcc"
+ result.cppCompiler = "eg++"
+
# LLVM Frontend for GCC/G++
compiler llvmGcc:
result = gcc() # Uses settings from GCC
@@ -330,7 +337,8 @@ const
tcc(),
pcc(),
ucc(),
- icl()]
+ icl(),
+ egcc()]
hExt* = ".h"

View File

@ -0,0 +1,53 @@
$OpenBSD: patch-config_nim_cfg,v 1.1.1.1 2015/10/19 21:50:14 juanfra Exp $
--- config/nim.cfg.orig Sun Sep 13 01:02:08 2015
+++ config/nim.cfg Sun Sep 13 01:11:33 2015
@@ -82,7 +82,7 @@ path="$lib/pure/unidecode"
@end
@if bsd or haiku:
# BSD got posix_spawn only recently, so we deactivate it for osproc:
- define:useFork
+ #define:useFork
# at least NetBSD has problems with thread local storage:
tlsEmulation:on
@end
@@ -110,6 +110,8 @@ path="$lib/pure/unidecode"
@else:
gcc.options.always = "-w"
gcc.cpp.options.always = "-w -fpermissive"
+ egcc.options.always = "-w"
+ egpp.options.alaways = "-w -fpermissive"
@end
# Configuration for Objective-C compiler:
@@ -142,15 +144,20 @@ clang.objc.options.linker = "-lobjc -lgnustep-base"
gcc.options.linker %= "-L $WIND_BASE/target/lib/usr/lib/ppc/PPC32/common -mrtp -fno-strict-aliasing -D_C99 -D_HAS_C9X -std=c99 -fasm -Wall -Wno-write-strings"
@end
-gcc.options.speed = "-O3 -fno-strict-aliasing"
+gcc.options.speed = "-O2 -fno-strict-aliasing"
gcc.options.size = "-Os"
gcc.options.debug = "-g3 -O0"
-gcc.cpp.options.speed = "-O3 -fno-strict-aliasing"
+gcc.cpp.options.speed = "-O2 -fno-strict-aliasing"
gcc.cpp.options.size = "-Os"
gcc.cpp.options.debug = "-g3 -O0"
#passl = "-pg"
+# Configuration for the OpenBSD ports GCC compiler:
+egcc.options.speed = "-O2 -fno-strict-aliasing"
+egcc.options.size = "-Os"
+egcc.options.debug = "-g3 -O0"
+
# Configuration for the LLVM GCC compiler:
llvm_gcc.options.debug = "-g"
llvm_gcc.options.always = "-w"
@@ -160,7 +167,7 @@ llvm_gcc.options.size = "-Os"
# Configuration for the LLVM CLang compiler:
clang.options.debug = "-g"
clang.options.always = "-w"
-clang.options.speed = "-O3"
+clang.options.speed = "-O2"
clang.options.size = "-Os"
# Configuration for the Visual C/C++ compiler:

View File

@ -0,0 +1,29 @@
$OpenBSD: patch-tests_testament_tester_nim,v 1.1.1.1 2015/10/19 21:50:14 juanfra Exp $
"compiler/nodejs" breaks the tests:
"tester.nim(15, 22) Error: cannot open 'compiler/nodejs'
nim cc --taintMode:on tests/testament/tester
FAILURE
Error 1 in . (Makefile:42 'do-test')"
--- tests/testament/tester.nim.orig Sat Apr 25 23:17:00 2015
+++ tests/testament/tester.nim Fri Oct 9 03:17:22 2015
@@ -12,7 +12,7 @@
import
parseutils, strutils, pegs, os, osproc, streams, parsecfg, json,
marshal, backend, parseopt, specs, htmlgen, browsers, terminal,
- algorithm, compiler/nodejs
+ algorithm
const
resultsFile = "testresults.html"
@@ -224,7 +224,7 @@ proc testSpec(r: var TResults, test: TTest) =
else:
exeFile = changeFileExt(tname, ExeExt)
if existsFile(exeFile):
- let nodejs = findNodeJs()
+ let nodejs = ""
if test.target == targetJS and nodejs == "":
r.addResult(test, expected.outp, "nodejs binary not in PATH",
reExeNotFound)

11
lang/nim/pkg/DESCR Normal file
View File

@ -0,0 +1,11 @@
Nim is a statically typed, imperative programming language that tries
to give the programmer ultimate power without compromises on runtime
efficiency. This means it focuses on compile-time mechanisms in all
their various forms.
Beneath a nice infix/indentation based syntax with a powerful (AST
based, hygienic) macro system lies a semantic model that supports a soft
realtime GC on thread local heaps. Asynchronous message passing is used
between threads, so no "stop the world" mechanism is necessary. An
unsafe shared memory heap is also provided for the increased efficiency
that results from that model.

270
lang/nim/pkg/PLIST Normal file
View File

@ -0,0 +1,270 @@
@comment $OpenBSD: PLIST,v 1.1.1.1 2015/10/19 21:50:14 juanfra Exp $
@conflict nimrod-<0.11.2
@pkgpath lang/nimrod
@bin bin/nim
lib/nim/
lib/nim/core/
lib/nim/core/locks.nim
lib/nim/core/macros.nim
lib/nim/core/typeinfo.nim
lib/nim/core/unsigned.nim
lib/nim/impure/
lib/nim/impure/db_mysql.nim
lib/nim/impure/db_postgres.nim
lib/nim/impure/db_sqlite.nim
lib/nim/impure/dialogs.nim
lib/nim/impure/graphics.nim
lib/nim/impure/osinfo_posix.nim
lib/nim/impure/osinfo_win.nim
lib/nim/impure/rdstdin.nim
lib/nim/impure/re.nim
lib/nim/impure/ssl.nim
lib/nim/impure/zipfiles.nim
lib/nim/js/
lib/nim/js/dom.nim
lib/nim/nimbase.h
lib/nim/nimrtl.nim
lib/nim/nimrtl.nim.cfg
lib/nim/packages/
lib/nim/packages/docutils/
lib/nim/packages/docutils/highlite.nim
lib/nim/packages/docutils/rst.nim
lib/nim/packages/docutils/rstast.nim
lib/nim/packages/docutils/rstgen.nim
lib/nim/posix/
lib/nim/posix/epoll.nim
lib/nim/posix/inotify.nim
lib/nim/posix/linux.nim
lib/nim/posix/posix.nim
lib/nim/posix/termios.nim
lib/nim/prelude.nim
lib/nim/pure/
lib/nim/pure/actors.nim
lib/nim/pure/actors.nim.cfg
lib/nim/pure/algorithm.nim
lib/nim/pure/asyncdispatch.nim
lib/nim/pure/asyncdispatch.nim.cfg
lib/nim/pure/asyncfile.nim
lib/nim/pure/asyncftpclient.nim
lib/nim/pure/asynchttpserver.nim
lib/nim/pure/asyncio.nim
lib/nim/pure/asyncnet.nim
lib/nim/pure/base64.nim
lib/nim/pure/basic2d.nim
lib/nim/pure/basic3d.nim
lib/nim/pure/browsers.nim
lib/nim/pure/cgi.nim
lib/nim/pure/collections/
lib/nim/pure/collections/LockFreeHash.nim
lib/nim/pure/collections/conc_tables.nim
lib/nim/pure/collections/critbits.nim
lib/nim/pure/collections/intsets.nim
lib/nim/pure/collections/lists.nim
lib/nim/pure/collections/queues.nim
lib/nim/pure/collections/rtarrays.nim
lib/nim/pure/collections/sequtils.nim
lib/nim/pure/collections/sets.nim
lib/nim/pure/collections/tables.nim
lib/nim/pure/colors.nim
lib/nim/pure/complex.nim
lib/nim/pure/concurrency/
lib/nim/pure/concurrency/chans.nim
lib/nim/pure/concurrency/cpuinfo.nim
lib/nim/pure/concurrency/cpuload.nim
lib/nim/pure/concurrency/threadpool.nim
lib/nim/pure/concurrency/threadpool.nim.cfg
lib/nim/pure/cookies.nim
lib/nim/pure/dynlib.nim
lib/nim/pure/encodings.nim
lib/nim/pure/endians.nim
lib/nim/pure/events.nim
lib/nim/pure/fenv.nim
lib/nim/pure/fsmonitor.nim
lib/nim/pure/ftpclient.nim
lib/nim/pure/future.nim
lib/nim/pure/gentabs.nim
lib/nim/pure/hashes.nim
lib/nim/pure/htmlgen.nim
lib/nim/pure/htmlparser.nim
lib/nim/pure/httpclient.nim
lib/nim/pure/httpserver.nim
lib/nim/pure/json.nim
lib/nim/pure/lexbase.nim
lib/nim/pure/logging.nim
lib/nim/pure/marshal.nim
lib/nim/pure/matchers.nim
lib/nim/pure/math.nim
lib/nim/pure/md5.nim
lib/nim/pure/memfiles.nim
lib/nim/pure/mersenne.nim
lib/nim/pure/mimetypes.nim
lib/nim/pure/net.nim
lib/nim/pure/nimprof.nim
lib/nim/pure/nimprof.nim.cfg
lib/nim/pure/numeric.nim
lib/nim/pure/oids.nim
lib/nim/pure/os.nim
lib/nim/pure/osproc.nim
lib/nim/pure/parsecfg.nim
lib/nim/pure/parsecsv.nim
lib/nim/pure/parseopt.nim
lib/nim/pure/parseopt2.nim
lib/nim/pure/parsesql.nim
lib/nim/pure/parseurl.nim
lib/nim/pure/parseutils.nim
lib/nim/pure/parsexml.nim
lib/nim/pure/pegs.nim
lib/nim/pure/poly.nim
lib/nim/pure/rationals.nim
lib/nim/pure/rawsockets.nim
lib/nim/pure/redis.nim
lib/nim/pure/romans.nim
lib/nim/pure/ropes.nim
lib/nim/pure/scgi.nim
lib/nim/pure/selectors.nim
lib/nim/pure/smtp.nim
lib/nim/pure/smtp.nim.cfg
lib/nim/pure/sockets.nim
lib/nim/pure/streams.nim
lib/nim/pure/strtabs.nim
lib/nim/pure/strutils.nim
lib/nim/pure/subexes.nim
lib/nim/pure/terminal.nim
lib/nim/pure/times.nim
lib/nim/pure/typetraits.nim
lib/nim/pure/unicode.nim
lib/nim/pure/unidecode/
lib/nim/pure/unidecode/unidecode.dat
lib/nim/pure/unidecode/unidecode.nim
lib/nim/pure/unittest.nim
lib/nim/pure/uri.nim
lib/nim/pure/xmldom.nim
lib/nim/pure/xmldomparser.nim
lib/nim/pure/xmlparser.nim
lib/nim/pure/xmltree.nim
lib/nim/stdlib.nimble
lib/nim/system/
lib/nim/system.nim
lib/nim/system/alloc.nim
lib/nim/system/ansi_c.nim
lib/nim/system/arithm.nim
lib/nim/system/assign.nim
lib/nim/system/atomics.nim
lib/nim/system/avltree.nim
lib/nim/system/cellsets.nim
lib/nim/system/cgprocs.nim
lib/nim/system/channels.nim
lib/nim/system/chcks.nim
lib/nim/system/debugger.nim
lib/nim/system/deepcopy.nim
lib/nim/system/dyncalls.nim
lib/nim/system/embedded.nim
lib/nim/system/endb.nim
lib/nim/system/excpt.nim
lib/nim/system/gc.nim
lib/nim/system/gc2.nim
lib/nim/system/gc_ms.nim
lib/nim/system/hti.nim
lib/nim/system/inclrtl.nim
lib/nim/system/jssys.nim
lib/nim/system/mmdisp.nim
lib/nim/system/platforms.nim
lib/nim/system/profiler.nim
lib/nim/system/repr.nim
lib/nim/system/reprjs.nim
lib/nim/system/sets.nim
lib/nim/system/sysio.nim
lib/nim/system/syslocks.nim
lib/nim/system/sysspawn.nim
lib/nim/system/sysstr.nim
lib/nim/system/threads.nim
lib/nim/system/timers.nim
lib/nim/system/widestrs.nim
lib/nim/windows/
lib/nim/windows/mmsystem.nim
lib/nim/windows/nb30.nim
lib/nim/windows/psapi.nim
lib/nim/windows/shellapi.nim
lib/nim/windows/shfolder.nim
lib/nim/windows/windows.nim
lib/nim/windows/winlean.nim
lib/nim/wrappers/
lib/nim/wrappers/claro.nim
lib/nim/wrappers/expat.nim
lib/nim/wrappers/iup.nim
lib/nim/wrappers/joyent_http_parser.nim
lib/nim/wrappers/libcurl.nim
lib/nim/wrappers/libsvm.nim
lib/nim/wrappers/libuv.nim
lib/nim/wrappers/mysql.nim
lib/nim/wrappers/odbcsql.nim
lib/nim/wrappers/openssl.nim
lib/nim/wrappers/pcre.nim
lib/nim/wrappers/pdcurses.nim
lib/nim/wrappers/postgres.nim
lib/nim/wrappers/readline/
lib/nim/wrappers/readline/history.nim
lib/nim/wrappers/readline/readline.nim
lib/nim/wrappers/readline/rltypedefs.nim
lib/nim/wrappers/sdl/
lib/nim/wrappers/sdl/sdl.nim
lib/nim/wrappers/sdl/sdl_gfx.nim
lib/nim/wrappers/sdl/sdl_image.nim
lib/nim/wrappers/sdl/sdl_mixer.nim
lib/nim/wrappers/sdl/sdl_mixer_nosmpeg.nim
lib/nim/wrappers/sdl/sdl_net.nim
lib/nim/wrappers/sdl/sdl_ttf.nim
lib/nim/wrappers/sdl/smpeg.nim
lib/nim/wrappers/sphinx.nim
lib/nim/wrappers/sqlite3.nim
lib/nim/wrappers/tinyc.nim
lib/nim/wrappers/tre.nim
lib/nim/wrappers/zip/
lib/nim/wrappers/zip/libzip.nim
lib/nim/wrappers/zip/libzip_all.c
lib/nim/wrappers/zip/zlib.nim
lib/nim/wrappers/zip/zzip.nim
share/doc/nim/
share/doc/nim/advopt.txt
share/doc/nim/apis.txt
share/doc/nim/astspec.txt
share/doc/nim/backends.txt
share/doc/nim/basicopt.txt
share/doc/nim/docgen.txt
share/doc/nim/docs.txt
share/doc/nim/effects.txt
share/doc/nim/endb.txt
share/doc/nim/estp.txt
share/doc/nim/exception_hierarchy_fragment.txt
share/doc/nim/filelist.txt
share/doc/nim/filters.txt
share/doc/nim/gc.txt
share/doc/nim/grammar.txt
share/doc/nim/idetools.txt
share/doc/nim/intern.txt
share/doc/nim/keywords.txt
share/doc/nim/koch.txt
share/doc/nim/lib.txt
share/doc/nim/manual.txt
share/doc/nim/nimc.txt
share/doc/nim/nimfix.txt
share/doc/nim/nimgrep.txt
share/doc/nim/niminst.txt
share/doc/nim/nimsuggest.txt
share/doc/nim/overview.txt
share/doc/nim/pegdocs.txt
share/doc/nim/readme.txt
share/doc/nim/regexprs.txt
share/doc/nim/sets_fragment.txt
share/doc/nim/spawn.txt
share/doc/nim/subexes.txt
share/doc/nim/tools.txt
share/doc/nim/tut1.txt
share/doc/nim/tut2.txt
share/examples/nim/
share/examples/nim/nim.cfg
@sample ${SYSCONFDIR}/nim.cfg
share/examples/nim/nimdoc.cfg
@sample ${SYSCONFDIR}/nimdoc.cfg
share/examples/nim/nimdoc.tex.cfg
@sample ${SYSCONFDIR}/nimdoc.tex.cfg