uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead

https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948
this can do it nicely.

Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
Anton Arapov 2021-04-03 12:58:10 +02:00 committed by Alan Daniels
commit 56de2bcd43
30691 changed files with 3076956 additions and 0 deletions

View file

@ -0,0 +1,8 @@
{ fetchFromGitHub }:
fetchFromGitHub {
owner = "krux02";
repo = "ast-pattern-matching";
rev = "87f7d163421af5a4f5e5cb6da7b93278e6897e96";
sha256 = "19mb5bb6riia8380p5dpc3q0vwgrj958dd6p7vw8vkvwiqrzg6zq";
}

View file

@ -0,0 +1,44 @@
{ lib, stdenv, nim, nim_builder }:
{ strictDeps ? true, nativeBuildInputs ? [ ], configurePhase ? null
, buildPhase ? null, checkPhase ? null, installPhase ? null, meta ? { }, ...
}@attrs:
stdenv.mkDerivation (attrs // {
inherit strictDeps;
nativeBuildInputs = [ nim nim_builder ] ++ nativeBuildInputs;
configurePhase = if isNull configurePhase then ''
runHook preConfigure
export NIX_NIM_BUILD_INPUTS=''${pkgsHostTarget[@]} $NIX_NIM_BUILD_INPUTS
nim_builder --phase:configure
runHook postConfigure
'' else
configurePhase;
buildPhase = if isNull buildPhase then ''
runHook preBuild
nim_builder --phase:build
runHook postBuild
'' else
buildPhase;
checkPhase = if isNull checkPhase then ''
runHook preCheck
nim_builder --phase:check
runHook postCheck
'' else
checkPhase;
installPhase = if isNull installPhase then ''
runHook preInstall
nim_builder --phase:install
runHook postInstall
'' else
installPhase;
meta = meta // {
platforms = meta.platforms or nim.meta.platforms;
maintainers = (meta.maintainers or [ ]) ++ [ lib.maintainers.ehmry ];
};
})

View file

@ -0,0 +1,24 @@
{ lib, buildNimPackage, fetchFromGitHub, vmath }:
buildNimPackage rec {
pname = "bumpy";
version = "1.0.3";
src = fetchFromGitHub {
owner = "treeform";
repo = pname;
rev = version;
hash = "sha256-mDmDlhOGoYYjKgF5j808oT2NqRlfcOdLSDE3WtdJFQ0=";
};
propagatedBuildInputs = [ vmath ];
doCheck = true;
meta = with lib;
src.meta // {
description = "2d collision library";
license = [ licenses.mit ];
maintainers = [ maintainers.ehmry ];
};
}

View file

@ -0,0 +1,19 @@
{ lib, buildNimPackage, fetchFromGitHub, SDL2 }:
buildNimPackage rec {
pname = "c2nim";
version = "0.9.18";
nimBinOnly = true;
src = fetchFromGitHub {
owner = "nim-lang";
repo = pname;
rev = version;
hash = "sha256-127ux36mfC+PnS2HIQffw+z0TSvzdQXnKRxqYV3XahU=";
};
meta = with lib;
src.meta // {
description = "Tool to translate Ansi C code to Nim";
license = licenses.mit;
maintainers = [ maintainers.ehmry ];
};
}

View file

@ -0,0 +1,7 @@
{ fetchNimble }:
fetchNimble {
pname = "chroma";
version = "0.2.5";
hash = "sha256-6lNHpO2aMorgkaPfo6kRcOs9r5R6T/kislVmkeoulw8=";
}

View file

@ -0,0 +1,8 @@
{ fetchFromGitHub }:
fetchFromGitHub {
owner = "docopt";
repo = "docopt.nim";
rev = "v0.6.7";
sha256 = "1ga7ckg21fzwwvh26jp2phn2h3pvkn8g8sm13dxif33rp471bv37";
}

View file

@ -0,0 +1,12 @@
source $stdenv/setup
export HOME=$NIX_BUILD_TOP
nimble --accept --noSSLCheck develop "${pkgname}@${version}"
# TODO: bring in the certificates for Nimble to verify the fetch of
# the package list.
pkgdir=${NIX_BUILD_TOP}/${pkgname}
find "$pkgdir" -name .git -print0 | xargs -0 rm -rf
cp -a "$pkgdir" "$out"

View file

@ -0,0 +1,20 @@
{ lib, makeOverridable, stdenv, gitMinimal, nim, cacert }:
makeOverridable (
{ pname, version, hash ? lib.fakeHash,
meta ? { }, passthru ? { }, preferLocalBuild ? true }:
stdenv.mkDerivation {
inherit version meta passthru preferLocalBuild;
pname = pname + "-src";
pkgname = pname;
builder = ./builder.sh;
nativeBuildInputs = [ gitMinimal nim ];
outputHash = hash;
outputHashAlgo = null;
outputHashMode = "recursive";
impureEnvVars = lib.fetchers.proxyImpureEnvVars
++ [ "GIT_PROXY_COMMAND" "SOCKS_SERVER" ];
GIT_SSL_CAINFO = "${cacert}/etc/ssl/certs/ca-bundle.crt";
})

View file

@ -0,0 +1,22 @@
{ lib, buildNimPackage, fetchFromGitHub }:
buildNimPackage rec {
pname = "flatty";
version = "0.2.3";
src = fetchFromGitHub {
owner = "treeform";
repo = pname;
rev = version;
hash = "sha256-1tPLtnlGtE4SF5/ti/2svvYHpEy/0Za5N4YAOHFOyjA=";
};
doCheck = true;
meta = with lib;
src.meta // {
description = "Tools and serializer for plain flat binary files";
license = [ licenses.mit ];
maintainers = [ maintainers.ehmry ];
};
}

View file

@ -0,0 +1,8 @@
{ fetchFromGitHub }:
fetchFromGitHub {
owner = "disruptek";
repo = "frosty";
rev = "0.3.1";
sha256 = "0hd6484ihjgl57gmqyp5xfq5prycb49k0313fqky600mhz71nmyz";
}

View file

@ -0,0 +1,13 @@
{ buildNimPackage, fetchFromGitHub, htslib }:
buildNimPackage rec {
pname = "hts-nim";
version = "0.3.4";
src = fetchFromGitHub {
owner = "brentp";
repo = pname;
rev = "v${version}";
sha256 = "0670phk1bq3l9j2zaa8i5wcpc5dyfrc0l2a6c21g0l2mmdczffa7";
};
propagatedBuildInputs = [ htslib ];
}

View file

@ -0,0 +1,8 @@
{ fetchFromGitHub }:
fetchFromGitHub {
owner = "dom96";
repo = "jester";
rev = "v0.5.0";
sha256 = "0m8a4ss4460jd2lcbqcbdd68jhcy35xg7qdyr95mh8rflwvmcvhk";
}

View file

@ -0,0 +1,22 @@
{ lib, buildNimPackage, fetchFromGitHub, astpatternmatching }:
buildNimPackage rec {
pname = "jsonschema";
version = "unstable-2019-09-12";
src = fetchFromGitHub {
owner = "PMunch";
repo = "jsonschema";
rev = "7b41c03e3e1a487d5a8f6b940ca8e764dc2cbabf";
sha256 = "1js64jqd854yjladxvnylij4rsz7212k31ks541pqrdzm6hpblbz";
};
propagatedBuildInputs = [ astpatternmatching ];
meta = with lib; {
homepage = "https://github.com/PMunch/jsonschema";
description = "Schema validation of JSON for Nim";
license = licenses.mit;
maintainers = [ maintainers.marsam ];
};
}

View file

@ -0,0 +1,22 @@
{ lib, buildNimPackage, fetchFromGitHub }:
buildNimPackage rec {
pname = "jsony";
version = "d0e69bddf83874e15b5c2f52f8b1386ac080b443";
src = fetchFromGitHub {
owner = "treeform";
repo = pname;
rev = version;
sha256 = "1p250wb97nzz2g0vvq6mn521fx7sn1jpk1ralbzqh5q8clh4g7wr";
};
doCheck = true;
meta = with lib;
src.meta // {
description = "A loose, direct to object json parser with hooks";
license = [ licenses.mit ];
maintainers = [ maintainers.erdnaxe ];
};
}

View file

@ -0,0 +1,8 @@
{ fetchFromGitHub }:
fetchFromGitHub {
owner = "karaxnim";
repo = "karax";
rev = "fa4a2dc";
sha256 = "0xl83jsfb9l8kb0nfan9h5y6v96iz4psng2fx06a0qmig4993408";
}

View file

@ -0,0 +1,8 @@
{ fetchFromGitHub }:
fetchFromGitHub {
owner = "joachimschmidt557";
repo = "nim-lscolors";
rev = "v0.3.3";
sha256 = "0526hqh46lcfsvymb67ldsc8xbfn24vicn3b8wrqnh6mag8wynf4";
}

View file

@ -0,0 +1,8 @@
{ fetchFromGitHub }:
fetchFromGitHub {
owner = "soasme";
repo = "nim-markdown";
rev = "a661c26";
hash = "sha256-/GkCSOmg2JxQhiDS8vgnKIoKvVgld/uIilUHslvwMnk=";
}

View file

@ -0,0 +1,19 @@
{ lib, stdenv, nim }:
stdenv.mkDerivation {
pname = "nim_builder";
inherit (nim) version;
dontUnpack = true;
nativeBuildInputs = [ nim ];
buildPhase = ''
cp ${./nim_builder.nim} nim_builder.nim
nim c --nimcache:$TMPDIR nim_builder
'';
installPhase = ''
install -Dt $out/bin nim_builder
'';
meta = {
description = "Internal Nixpkgs utility for buildNimPackage.";
maintainers = [ lib.maintainers.ehmry ];
};
}

View file

@ -0,0 +1,179 @@
# SPDX-FileCopyrightText: 2021 Nixpkgs/NixOS contributors
## Custom Nim builder for Nixpkgs.
import std/[os, osproc, parseutils, sequtils, streams, strutils]
proc findNimbleFile(): string =
## Copied from Nimble.
## Copyright (c) 2015, Dominik Picheta
## BSD3
let dir = getCurrentDir()
result = ""
var hits = 0
for kind, path in walkDir(dir):
if kind in {pcFile, pcLinkToFile}:
let ext = path.splitFile.ext
if ext == ".nimble":
result = path
inc hits
if hits >= 2:
quit("Only one .nimble file should be present in " & dir)
elif hits == 0:
quit("Could not find a file with a .nimble extension in " & dir)
proc getEnvBool(key: string; default = false): bool =
## Parse a boolean environmental variable.
let val = getEnv(key)
if val == "": default
else: parseBool(val)
proc getNimbleFilePath(): string =
## Get the Nimble file for the current package.
if existsEnv"nimbleFile":
getEnv"nimbleFile"
else:
findNimbleFile()
proc getNimbleValue(filePath, key: string; default = ""): string =
## Extract a string value from the Nimble file at ``filePath``.
var
fs = newFileStream(filePath, fmRead)
line: string
if fs.isNil:
quit("could not open " & filePath)
while fs.readline(line):
if line.startsWith(key):
var i = key.len
i.inc skipWhile(line, Whitespace, i)
if line[i] == '=':
inc i
i.inc skipWhile(line, Whitespace, i)
discard parseUntil(line, result, Newlines, i)
if result.len > 0 and result[0] == '"':
result = result.unescape
return
default
proc getNimbleValues(filePath, key: string): seq[string] =
## Extract a string sequence from the Nimble file at ``filePath``.
var gunk = getNimbleValue(filePath, key)
result = gunk.strip(chars = {'@', '[', ']'}).split(',')
if result == @[""]: reset result
apply(result) do (s: var string):
s = s.strip()
if s.len > 0 and s[0] == '"':
s = s.unescape()
proc getOutputDir(name: string): string =
## Return the output directory for output `name`.
## If `name` is not a valid output then the first output
## is returned as a default.
let outputs = splitWhitespace getEnv("outputs")
doAssert(outputs.len > 0)
if outputs.contains name:
result = getEnv(name)
if result == "":
result = getEnv("out")
if result == "":
result = getEnv(outputs[0], "/dev/null")
proc configurePhase*() =
## Generate "config.nims" which will be read by the Nim
## compiler during later phases.
const configFilePath = "config.nims"
echo "generating ", configFilePath
let
nf = getNimbleFilePath()
mode =
if fileExists configFilePath: fmAppend
else: fmWrite
var cfg = newFileStream(configFilePath, mode)
proc switch(key, val: string) =
cfg.writeLine("switch(", key.escape, ",", val.escape, ")")
switch("backend", nf.getNimbleValue("backend", "c"))
switch("nimcache", getEnv("NIX_BUILD_TOP", ".") / "nimcache")
if getEnvBool("nimRelease", true):
switch("define", "release")
for def in getEnv("nimDefines").split:
if def != "":
switch("define", def)
for input in getEnv("NIX_NIM_BUILD_INPUTS").split:
if input != "":
for nimbleFile in walkFiles(input / "*.nimble"):
let inputSrc = normalizedPath(
input / nimbleFile.getNimbleValue("srcDir", "."))
echo "found nimble input ", inputSrc
switch("path", inputSrc)
close(cfg)
proc buildPhase*() =
## Build the programs listed in the Nimble file and
## optionally some documentation.
var cmds: seq[string]
proc before(idx: int) =
echo "build job ", idx, ": ", cmds[idx]
let
nf = getNimbleFilePath()
bins = nf.getNimbleValues("bin")
srcDir = nf.getNimbleValue("srcDir", ".")
binDir = getOutputDir("bin") / "bin"
if bins != @[]:
for bin in bins:
cmds.add("nim compile $# --outdir:$# $#" %
[getenv"nimFlags", binDir, normalizedPath(srcDir / bin)])
if getEnvBool"nimDoc":
echo "generating documentation"
let docDir = getOutputDir("doc") / "doc"
for path in walkFiles(srcDir / "*.nim"):
cmds.add("nim doc --outdir:$# $#" % [docDir, path])
if cmds.len > 0:
let err = execProcesses(
cmds, n = 1,
beforeRunEvent = before)
if err != 0: quit("build phase failed", err)
proc installPhase*() =
## Install the Nim sources if ``nimBinOnly`` is not
## set in the environment.
if not getEnvBool"nimBinOnly":
let
nf = getNimbleFilePath()
srcDir = nf.getNimbleValue("srcDir", ".")
devDir = getOutputDir "dev"
echo "Install ", srcDir, " to ", devDir
copyDir(normalizedPath(srcDir), normalizedPath(devDir / srcDir))
copyFile(nf, devDir / nf.extractFilename)
proc checkPhase*() =
## Build and run the tests in ``tests``.
var cmds: seq[string]
proc before(idx: int) =
echo "check job ", idx, ": ", cmds[idx]
for path in walkPattern("tests/t*.nim"):
cmds.add("nim r $#" % [path])
let err = execProcesses(
cmds, n = 1,
beforeRunEvent = before)
if err != 0: quit("check phase failed", err)
when isMainModule:
import std/parseopt
var phase: string
for kind, key, val in getopt():
case kind
of cmdLongOption:
case key.toLowerAscii
of "phase":
if phase != "": quit("only a single phase may be specified")
phase = val
else: quit("unhandled argument " & key)
of cmdEnd: discard
else: quit("unhandled argument " & key)
case phase
of "configure": configurePhase()
of "build": buildPhase()
of "install": installPhase()
of "check": checkPhase()
else: quit("unhandled phase " & phase)

View file

@ -0,0 +1,8 @@
{ fetchFromGitHub }:
fetchFromGitHub {
owner = "dom96";
repo = "nimbox";
rev = "6a56e76c01481176f16ae29b7d7c526bd83f229b";
sha256 = "15x1sdfxa1xcqnr68705jfnlv83lm0xnp2z9iz3pgc4bz5vwn4x1";
}

View file

@ -0,0 +1,8 @@
{ fetchFromGitHub }:
fetchFromGitHub {
owner = "cheatfate";
repo = "nimcrypto";
rev = "a5742a9a214ac33f91615f3862c7b099aec43b00";
sha256 = "0al0jsaicm8vyr63n909dq1glhvpra1n9sllmj0r7lsjsdb59wsz";
}

View file

@ -0,0 +1,7 @@
{ fetchNimble }:
fetchNimble {
pname = "nimsimd";
version = "1.0.0";
hash = "sha256-kp61fylAJ6MSN9hLYLi7CU2lxVR/lbrNCvZTe0LJLGo=";
}

View file

@ -0,0 +1,8 @@
{ fetchFromGitHub }:
fetchFromGitHub {
owner = "jangko";
repo = "nim-noise";
rev = "v0.1.14";
sha256 = "0wndiphznfyb1pac6zysi3bqljwlfwj6ziarcwnpf00sw2zni449";
}

View file

@ -0,0 +1,8 @@
{ fetchFromGitHub }:
fetchFromGitHub {
owner = "Araq";
repo = "packedjson";
rev = "d11d167";
sha256 = "1302rn58277c3ic5sfq89c4mkn0d66bhilifh5xjf40x74ahir5x";
}

View file

@ -0,0 +1,25 @@
{ lib, buildNimPackage, fetchFromGitHub, bumpy, chroma, flatty, nimsimd, vmath
, zippy }:
buildNimPackage rec {
pname = "pixie";
version = "3.1.2";
src = fetchFromGitHub {
owner = "treeform";
repo = pname;
rev = version;
hash = "sha256-rF72ybfsipBHgQmH0e6DBn1e7WWY6dGn9yp1qvLIS3A=";
};
propagatedBuildInputs = [ bumpy chroma flatty nimsimd vmath zippy ];
doCheck = true;
meta = with lib;
src.meta // {
description = "Full-featured 2d graphics library for Nim";
license = [ licenses.mit ];
maintainers = [ maintainers.ehmry ];
};
}

View file

@ -0,0 +1,8 @@
{ fetchFromGitHub }:
fetchFromGitHub {
owner = "zedeus";
repo = "redis";
rev = "d0a0e6f";
sha256 = "166kzflb3wgwvqnv9flyynp8b35xby617lxmk0yas8i4m6vjl00f";
}

View file

@ -0,0 +1,8 @@
{ fetchFromGitHub }:
fetchFromGitHub {
owner = "zedeus";
repo = "redpool";
rev = "8b7c1db";
sha256 = "10xh5fhwnahnq1nf6j69vvnbi55kixa0ari630gr6cdx80arvbs6";
}

View file

@ -0,0 +1,8 @@
{ fetchFromGitHub }:
fetchFromGitHub {
owner = "nitely";
repo = "nim-regex";
rev = "eeefb4f";
sha256 = "13gn0qhnxz07474kv94br5qlac9j8pz2555fk83538fiq83vgbm5";
}

View file

@ -0,0 +1,20 @@
{ lib, buildNimPackage, fetchFromGitHub, rocksdb, stew, tempfile }:
buildNimPackage rec {
pname = "rocksdb";
version = "0.2.0";
src = fetchFromGitHub {
owner = "status-im";
repo = "nim-${pname}";
rev = "5b1307cb1f4c85bb72ff781d810fb8c0148b1183";
hash = "sha256-gjMCB9kpWVi9Qv73/jhoAYw857OmQpry//bDQCtyJo0=";
};
buildInputs = [ stew tempfile ];
propagatedBuildInputs = [ rocksdb ];
doCheck = false;
meta = with lib;
src.meta // {
description = "Nim wrapper for RocksDB";
maintainers = [ maintainers.ehmry ];
};
}

View file

@ -0,0 +1,13 @@
{ buildNimPackage, fetchFromGitHub, libsass }:
buildNimPackage rec {
pname = "sass";
version = "e683aa1";
src = fetchFromGitHub {
owner = "dom96";
repo = pname;
rev = version;
sha256 = "0qvly5rilsqqsyvr67pqhglm55ndc4nd6v90jwswbnigxiqf79lc";
};
propagatedBuildInputs = [ libsass ];
}

View file

@ -0,0 +1,17 @@
{ lib, buildNimPackage, fetchNimble, SDL2 }:
buildNimPackage rec {
pname = "sdl2";
version = "2.0.4";
src = fetchNimble {
inherit pname version;
hash = "sha256-Vtcj8goI4zZPQs2TbFoBFlcR5UqDtOldaXSH/+/xULk=";
};
propagatedBuildInputs = [ SDL2 ];
doCheck = true;
meta = {
description = "Nim wrapper for SDL 2.x";
platforms = lib.platforms.linux; # Problems with Darwin.
license = [ lib.licenses.mit ];
};
}

View file

@ -0,0 +1,8 @@
{ fetchFromGitHub }:
fetchFromGitHub {
owner = "nitely";
repo = "nim-segmentation";
rev = "v0.1.0";
sha256 = "007bkx8dwy8n340zbp6wyqfsq9bh6q5ykav1ywdlwykyp1n909bh";
}

View file

@ -0,0 +1,7 @@
diff --git a/tests/config.nims b/tests/config.nims
index 46348f1..fbe9f5e 100644
--- a/tests/config.nims
+++ b/tests/config.nims
@@ -1 +1,2 @@
switch("path", "..")
+switch("passL", "-lsnappy")

View file

@ -0,0 +1,24 @@
{ lib, buildNimPackage, fetchFromGitHub, snappy }:
buildNimPackage rec {
pname = "snappy";
version = "0.1.0";
src = fetchFromGitHub {
owner = "jangko";
repo = pname;
rev = "d13e2ccb2acaa4e8dedce4f25e8dbf28e19278a6";
hash = "sha256-18CFRuDK+E701MHrCixx22QSVmglTc0EJwrMCsKwayM=";
};
propagatedBuildInputs = [ snappy ];
patches = [ ./config.patch ];
preCheck = ''
mkdir $NIX_BUILD_TOP/nimcache/
mv -v tests/data $NIX_BUILD_TOP/nimcache/data
''; # test standards, please
meta = with lib;
src.meta // {
description = "Nim implementation of snappy compression algorithm";
license = [ lib.licenses.mit ];
maintainers = [ maintainers.ehmry ];
};
}

View file

@ -0,0 +1,23 @@
{ lib, buildNimPackage, fetchFromGitHub, rocksdb, snappy, spryvm, stew
, tempfile, ui }:
buildNimPackage rec {
pname = "spry";
version = "0.9.0";
src = fetchFromGitHub {
owner = "gokr";
repo = pname;
rev = "098da7bb34a9113d5db5402fecfc76b1c3fa3b36";
hash = "sha256-PfWBrG2Z16tLgcN8JYpHaNMysBbbYX812Lkgk0ItMwE=";
};
buildInputs = [ rocksdb snappy spryvm stew tempfile ui ];
patches = [ ./nil.patch ./python.patch ];
doCheck = true;
meta = with lib;
src.meta // {
description =
"A Smalltalk and Rebol inspired language implemented as an AST interpreter in Nim";
license = [ licenses.mit ];
maintainers = [ maintainers.ehmry ];
};
}

View file

@ -0,0 +1,35 @@
diff --git a/src/ispry.nim b/src/ispry.nim
index 23ad6c3..dc38a9d 100644
--- a/src/ispry.nim
+++ b/src/ispry.nim
@@ -134,8 +134,8 @@ proc main() =
#discard spry.setBinding(newEvalWord("@"), result)
var output = $result
# Print any result
- if output.isNil:
- output = if suspended: "nil" else: ""
+ if output == "" and suspended:
+ output = "nil"
stdout.write(output & "\n")
# except:
# echo "Oops, sorry about that: " & getCurrentExceptionMsg() & "\n"
diff --git a/src/spry.nim b/src/spry.nim
index 670a280..d81bb4c 100644
--- a/src/spry.nim
+++ b/src/spry.nim
@@ -87,13 +87,13 @@ for kind, key, val in getopt():
of cmdEnd: assert(false) # cannot happen
if eval:
- if filename == nil:
+ if filename == "":
writeHelp()
else:
code = filename
else:
code =
- if filename == nil:
+ if filename == "":
# no filename has been given, so we use stdin
readAll stdin
else:

View file

@ -0,0 +1,43 @@
diff --git a/src/ispry.nim b/src/ispry.nim
index 23ad6c3..d2cfc89 100644
--- a/src/ispry.nim
+++ b/src/ispry.nim
@@ -21,7 +21,7 @@ import spryvm/sprycore, spryvm/sprylib, spryvm/spryextend, spryvm/sprymath,
spryvm/spryos, spryvm/spryio, spryvm/sprymemfile, spryvm/sprythread,
spryvm/spryoo, spryvm/sprydebug, spryvm/sprycompress, spryvm/sprystring,
spryvm/sprymodules, spryvm/spryreflect, spryvm/spryblock, spryvm/sprynet,
- spryvm/sprysmtp, spryvm/spryjson, spryvm/sprysqlite, spryvm/sprypython,
+ spryvm/sprysmtp, spryvm/spryjson, spryvm/sprysqlite,
spryvm/spryrocksdb
const Prompt = ">>> "
@@ -63,7 +63,6 @@ proc main() =
spry.addMemfile()
spry.addThread()
- spry.addPython()
spry.addDebug()
spry.addCompress()
spry.addReflect()
diff --git a/src/spry.nim b/src/spry.nim
index 670a280..cda9027 100644
--- a/src/spry.nim
+++ b/src/spry.nim
@@ -14,8 +14,7 @@ import spryvm/sprycore, spryvm/sprylib, spryvm/spryextend, spryvm/sprymath,
spryvm/spryos, spryvm/spryio, spryvm/sprymemfile, spryvm/sprythread,
spryvm/spryoo, spryvm/sprydebug, spryvm/sprycompress, spryvm/sprystring,
spryvm/sprymodules, spryvm/spryreflect, spryvm/spryui, spryvm/spryblock, spryvm/sprynet,
- spryvm/sprysmtp, spryvm/spryjson, spryvm/sprysqlite, spryvm/spryrocksdb,
- spryvm/sprypython
+ spryvm/sprysmtp, spryvm/spryjson, spryvm/sprysqlite, spryvm/spryrocksdb
var spry = newInterpreter()
@@ -34,7 +33,6 @@ spry.addOO()
spry.addMemfile()
spry.addThread()
-spry.addPython()
spry.addDebug()
spry.addCompress()
spry.addReflect()

View file

@ -0,0 +1,21 @@
{ lib, buildNimPackage, fetchFromGitHub, sqlite }:
buildNimPackage rec {
pname = "spryvm";
version = "0.9.3";
src = fetchFromGitHub {
owner = "gokr";
repo = pname;
rev = "36c2b56bb194902d33de7bcf70d3041703e107ab";
hash = "sha256-OxB49ef6qPvSXLsyVl5g2ic/P9MMbF3jRYDWrxNJ0Iw=";
};
propagatedBuildInputs = [ sqlite ];
patches = [ ./nil.patch ];
doCheck = true;
meta = with lib;
src.meta // {
description = "Spry virtual machine";
license = [ licenses.mit ];
maintainers = [ maintainers.ehmry ];
};
}

View file

@ -0,0 +1,21 @@
diff --git a/spryvm/spryui.nim b/spryvm/spryui.nim
index 37f5329..50440e9 100644
--- a/spryvm/spryui.nim
+++ b/spryvm/spryui.nim
@@ -140,14 +140,14 @@ proc addUI*(spry: Interpreter) =
nimMeth("openFile"):
var win = WindowNode(evalArgInfix(spry))
var path = openFile(Window(win.widget))
- if path.isNil:
+ if path == "":
spry.nilVal
else:
newValue($path)
nimMeth("saveFile"):
var win = WindowNode(evalArgInfix(spry))
var path = saveFile(Window(win.widget))
- if path.isNil:
+ if path == "":
spry.nilVal
else:
newValue($path)

View file

@ -0,0 +1,20 @@
{ lib, buildNimPackage, fetchFromGitHub, snappy }:
buildNimPackage rec {
pname = "stew";
version = "0.1.0";
src = fetchFromGitHub {
owner = "status-im";
repo = "nim-${pname}";
rev = "478cc6efdefaabadf0666a3351fb959b78009bcc";
hash = "sha256-txlTF0zNV5kV4KfE744oB3aVLCfWS9BdoKxUmTQTTRY=";
};
doCheck = false;
meta = with lib;
src.meta // {
description =
"Backports, standard library candidates and small utilities that don't yet deserve their own repository";
license = [ lib.licenses.asl20 ];
maintainers = [ maintainers.ehmry ];
};
}

View file

@ -0,0 +1,8 @@
{ fetchFromGitHub }:
fetchFromGitHub {
owner = "guzba";
repo = "supersnappy";
rev = "2.1.1";
sha256 = "03df1qgrbp84swhqy12ansyn951lkaw0kf1arbnki4fkgdnqdamf";
}

View file

@ -0,0 +1,20 @@
{ lib, buildNimPackage, fetchFromGitHub }:
buildNimPackage rec {
pname = "tempfile";
version = "0.1.7";
src = fetchFromGitHub {
owner = "OpenSystemsLab";
repo = "${pname}.nim";
rev = version;
hash = "sha256-08vvHXVxL1mAcpMzosaHd2FupTJrKJP5JaVcgxN4oYE=";
};
doCheck = false; # impure
meta = with lib;
src.meta // {
description = "Temporary files and folders";
license = [ lib.licenses.mit ];
maintainers = [ maintainers.ehmry ];
mainProgram = "tempfile_seeder";
};
}

View file

@ -0,0 +1,24 @@
{ lib, buildNimPackage, fetchFromGitHub, libui, pkg-config }:
buildNimPackage rec {
pname = "ui";
version = "0.9.4";
src = fetchFromGitHub {
owner = "nim-lang";
repo = pname;
rev = "547e1cea8e9fb68c138c422b77af0a3152e50210";
hash = "sha256-rcvC0TO1r2zU7WEYfcsi/qX+nRITwKj7Fkqd4fHgTwU=";
};
propagatedBuildInputs = [ libui ];
propagatedNativeBuildInputs = [ pkg-config ];
postPatch = ''
echo {.passL: r\"$(pkg-config --libs libui)\".} >> ui/rawui.nim
'';
doCheck = true;
meta = with lib;
src.meta // {
description = "Nim bindings to libui";
license = [ licenses.mit ];
maintainers = [ maintainers.ehmry ];
};
}

View file

@ -0,0 +1,8 @@
{ fetchFromGitHub }:
fetchFromGitHub {
owner = "nitely";
repo = "nim-unicodedb";
rev = "v0.9.0";
sha256 = "06j8d0bjbpv1iibqlmrac4qb61ggv17hvh6nv4pbccqk1rlpxhsq";
}

View file

@ -0,0 +1,8 @@
{ fetchFromGitHub }:
fetchFromGitHub {
owner = "nitely";
repo = "nim-unicodeplus";
rev = "v0.8.0";
sha256 = "181wzwivfgplkqn5r4crhnaqgsza7x6fi23i86djb2dxvm7v6qxk";
}

View file

@ -0,0 +1,22 @@
{ lib, buildNimPackage, fetchFromGitHub }:
buildNimPackage rec {
pname = "vmath";
version = "1.1.1";
src = fetchFromGitHub {
owner = "treeform";
repo = pname;
rev = version;
hash = "sha256-/v0lQIOMogTxFRtbssziW4W6VhMDepM6Si8igLgcx30=";
};
doCheck = true;
meta = with lib;
src.meta // {
description = "Math vector library for graphical things";
license = [ licenses.mit ];
maintainers = [ maintainers.ehmry ];
};
}

View file

@ -0,0 +1,24 @@
{ lib, buildNimPackage, fetchFromGitHub, unzip }:
buildNimPackage rec {
pname = "zippy";
version = "0.7.3";
nativeBuildInputs = [ unzip ];
src = fetchFromGitHub {
owner = "guzba";
repo = pname;
rev = version;
hash = "sha256-w64ENRyP3mNTtESSt7CDDxUkjYSfziNVVedkO4HIuJ8=";
};
doCheck = true;
meta = with lib;
src.meta // {
description = "Pure Nim implementation of deflate, zlib, gzip and zip";
license = [ licenses.mit ];
maintainers = [ maintainers.ehmry ];
};
}