Skip to content

Instantly share code, notes, and snippets.

View genotrance's full-sized avatar

genotrance genotrance

View GitHub Profile
@genotrance
genotrance / rizz.nim
Last active June 29, 2020 16:35
Nim wrapper for rizz using nimterop
# nim c -d:FLAGS rizz.nim
#
# FLAGS
# -d:rizzGit
# -d:rizzSetVer=v0.4
# -d:rizzStatic
import os
import nimterop/[build, cimport]
@genotrance
genotrance / duktape.nim
Created June 28, 2020 02:21
Nim wrapper for duktape using nimterop
# nim c -d:FLAGS duktape.nim
#
# FLAGS
# -d:duktapeStd | -d:duktapeDL | -d:duktapeConan
# -d:duktapeSetVer=2.5.0
# -d:duktapeStatic
import nimterop/[build, cimport]
static:
@genotrance
genotrance / orx.nim
Created June 24, 2020 13:30
Nim wrapper for orx using nimerop
import nimterop/[build, cimport]
import os, strformat
const
baseDir = currentSourcePath.parentDir() / "orx"
headerDir = baseDir / "code" / "include"
static:
cDebug()
gitPull("https://github.com/orx/orx", baseDir)
@genotrance
genotrance / ncurses.nim
Last active June 24, 2020 04:06
Nim wrapper for libncurses using nimterop
# nim c -d:FLAGS ncurses.nim
#
# FLAGS
# -d:cursesStd | -d:cursesGit | -d:cursesConan | -d:cursesJBB
# -d:cursesStatic
import os
import nimterop/[build, cimport]
@genotrance
genotrance / travis.sh
Last active August 29, 2020 22:14
Travis CI setup for Nim - moved to https://github.com/genotrance/nim-travis
#!/bin/bash
curl https://raw.githubusercontent.com/genotrance/nim-travis/master/travis.sh -LsSf -o travis2.sh
source travis2.sh
@genotrance
genotrance / README.md
Last active January 28, 2020 23:46
Nimble RFCs for Araq

nim.cfg based interop

Nimble requirements

  • Add a new command called nimble usecfg
    • Creates/updates nimbledeps.cfg
    • Adds --path entries for all dependencies
    • Includes --clearNimblePath as well to remove any scanned packages already added
    • Uses @include in nim.cfg to load nimbledeps.cfg if it exists
  • Nimble should detect if project is in usecfg mode
@genotrance
genotrance / README.md
Last active November 12, 2019 18:34
Nimble RFC for lock file support

The following RFC aims to implement lock file support for Nimble. This is being tracked in issue 127 but this proposal is a simpler variation.

Intro:

  • lock mode will be enabled by a flag in nimble.ini
    • Since it is a new feature, this will reduce impact on the existing user base
    • It can be turned on by default in the future when stable enough
  • Lock information will be stored in $prj/nim.cfg
    • Nimble will append autogenerated section if existing
    • Nimble will update when any dep changes occur
    • Nimble will consume when having to install deps
@genotrance
genotrance / README.md
Last active August 19, 2020 17:11
Nimble RFC for project local dependencies

Following is the RFC for providing project local dependencies in Nimble. This is being tracked in issue 131 and discussed in the Nim forum.

Definitions:

  • local deps mode - this RFC to enable project local dependencies where $prj/nimbledeps is used by Nimble on a per project basis
  • user deps mode - current Nimble behavior of using ~/.nimble since dependencies are usable across projects for a specific user
  • global deps mode - tracked in issue 80 where a system-wide folder can be used to store dependencies across users and projects. It is not covered in this RFC.

Motivations:

  • The main value of local deps mode is to provide dependency isolation from other projects. Isolation simply makes development easier and avoids any conflicts caused by mixing dependencies across projects.
  • local deps mode is simply a mode of operation during development and is not e
@genotrance
genotrance / README.md
Last active March 25, 2019 18:18
Nimble lock files

Project setup

  • Create project
  • Setup for per project nimbleDir
    • New field in .nimble
    • Nimble anyway generates command line for nim so no change in nim/nim.cfg

Lock file creation workflow

  • Delete project nimbleDir or uninstall specific package
  • Install deps at preferred levels using nimble
  • nimble install abc@version or abc@#hash
@genotrance
genotrance / compile.sh
Created February 27, 2019 12:42
Nim Holy Build Box
#! /bin/bash
export SRCFILE=nim-$VERSION.tar.xz
export BINFILE=nim-$VERSION-linux_x$ARCH.tar
echo "Building Nim $VERSION for $ARCH"
set -e
# Activate Holy Build Box environment.