Skip to content

Instantly share code, notes, and snippets.

View genotrance's full-sized avatar

genotrance genotrance

View GitHub Profile
@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 / 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 / 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 / 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 / nghttp2.nim
Created July 3, 2020 05:34
Nim wrapper for nghttp2 using nimterop
# nim c -d:FLAGS nghttp2.nim
#
# FLAGS
# -d:nghttp2Git | -d:nghttp2DL | -d:nghttp2Conan | -d:nghttp2JBB
# -d:nghttp2SetVer=v0.4
# -d:nghttp2Static
import os
import nimterop/[build, cimport]
@genotrance
genotrance / gtk3.nim
Last active July 3, 2020 21:12
Nim wrapper for gtk+-3.0 using nimterop
import nimterop/cimport
cPlugin:
import strutils
proc onSymbol(sym: var Symbol) {.exportc, dynlib.} =
# Get rid of some problematic symbols
if sym.name.contains("CSET"):
sym.name = ""
else:
@genotrance
genotrance / pkcs7.nim
Created July 12, 2020 18:34
Nim wrapper for pkcs7 using nimterop
# nim c -d:FLAGS pkcs.nim
#
# FLAGS
# -d:pkcs7Std | -d:pkcs7Conan | -d:pkcs7JBB
# -d:pkcs7Static
import strutils
import nimterop/[build, cimport]
@genotrance
genotrance / sciter.nim
Last active July 13, 2020 03:38
Nim wrapper for sciter using nimterop
import nimterop/[cimport]
cIncludeDir(@[
"/usr/include/gtk-3.0",
"/usr/include/glib-2.0",
"/usr/lib/x86_64-linux-gnu/glib-2.0/include",
"/usr/include/pango-1.0",
"/usr/include/cairo",
"/usr/include/gdk-pixbuf-2.0",
"/usr/include/atk-1.0"
@genotrance
genotrance / freetype.nim
Created July 13, 2020 21:18
Nim wrapper for freetype using nimterop
import nimterop/cimport
const
baseDir = "/usr/include/freetype2"
cDefine("FT_UInt32", "unsigned int32")
cIncludeDir(baseDir)
cImport(
filename = "ft.h",
recurse = true,
@genotrance
genotrance / quickjs.nim
Last active July 15, 2020 16:57
Nim wrapper for quickjs using nimterop
# nim c -d:FLAGS quickjs.nim
#
# FLAGS
# -d:quickjsGit
# -d:quickjsSetVer=
# -d:quickjsStatic
import os
import nimterop/[build, cimport]