Update to work with vanilla nimgen

This commit is contained in:
Joey Yakimowich-Payne 2018-07-13 12:13:59 +09:00
commit 9b773ae4f3
2 changed files with 131 additions and 26 deletions

View file

@ -8,7 +8,7 @@ license = "The Unlicense"
srcDir = "src"
# Deps
requires "nim >= 0.18.1", "https://github.com/jyapayne/nimgenEx#head"
requires "nim >= 0.18.1", "https://github.com/genotrance/nimgen#head"
requires "https://github.com/jyapayne/switch-build#head"
task setup, "Download and generate bindings":

View file

@ -23,24 +23,14 @@ filter=lock
"${output}/config.nims"
[n.wildcard]
wildcard = "console.h"
wildcard.1 = "console.h"
rename = "$replace(console=con)"
[n.prepare]
git = "https://github.com/switchbrew/libnx"
execute = """
cd ${output}
make
"""
[n.post]
reset=true
[n.after]
wildcard = ".nim"
search = "_Bool"
replace = "bool"
wildcard.2 = "*.h"
search.u8 = "u8"
replace.u8 = "uint8"
@ -53,18 +43,17 @@ replace.u32 = "uint32"
search.u64 = "u64"
replace.u64 = "uint64"
search.lib = " src/libnx/wrapper"
replace.lib = " libnx/wrapper"
wildcard.3 = "*.nim"
search.timport = "../types"
replace.timport = "libnx/wrapper/types"
search.bool = "_Bool"
replace.bool = "bool"
search.lib = "src/libnx/wrapper"
replace.lib = "libnx/wrapper"
search.kimport = "../kernel/"
replace.kimport = "libnx/wrapper/"
search.servimport = "../services/"
replace.servimport = "libnx/wrapper/"
search.resimport = "../result"
replace.resimport = "libnx/wrapper/result"
@ -77,6 +66,18 @@ replace.lock = "LOCK"
search.cdecl = "stdcall"
replace.cdecl = "cdecl"
[console.h]
[n.prepare]
git = "https://github.com/switchbrew/libnx"
execute = """
cd ${output}
make
"""
[n.post]
reset=true
[src/libnx/wrapper/nim.cfg]
create = """
--path:"../"
@ -171,11 +172,8 @@ template BIT*(n): auto = (1.uint shl n)
"""
[svc.nim]
search.import = "type\n"
prepend.import = """
import libnx/wrapper/types
"""
search.timport = "../types"
replace.timport = "libnx/wrapper/types"
search.permx = "Perm_X = BIT(2), ## /< Execute permission."
replace.permx = "Perm_Rw = Perm_R.int or Perm_W.int, ## /< Read/write permissions."
@ -235,6 +233,10 @@ import libnx/wrapper/types
"""
[hid.nim]
search.servimport = "../services/"
replace.servimport = "libnx/wrapper/"
search.timport = "../types"
replace.timport = "libnx/wrapper/types"
search.o = """ KEY_JOYCON_RIGHT = BIT(0), KEY_JOYCON_DOWN = BIT(1), KEY_JOYCON_UP = BIT(2), KEY_JOYCON_LEFT = BIT(
3),"""
replace.o = ""
@ -345,3 +347,106 @@ template CONSOLE_CROSSED_OUT*: int = BIT(8).int
search.threedmoo = "debugDevice_3DMOO"
replace.threedmoo = "debugDevice_3DMOO*"
[apm.nim]
key = blank
[applet.nim]
key = blank
[audio.nim]
key = blank
[binder.nim]
key = blank
[cache.nim]
key = blank
[condvar.nim]
key = blank
[csrng.nim]
key = blank
[detect.nim]
key = blank
[env.nim]
key = blank
[fatal.nim]
key = blank
[fsldr.nim]
key = blank
[fspr.nim]
key = blank
[gfx.nim]
search.timport = "../types"
replace.timport = "libnx/wrapper/types"
[ioctl.nim]
key = blank
[irs.nim]
key = blank
[jit.nim]
key = blank
[ldr.nim]
key = blank
[lr.nim]
key = blank
[mutex.nim]
key = blank
[nro.nim]
key = blank
[ns.nim]
key = blank
[nv.nim]
key = blank
[nvgfx.nim]
key = blank
[nvioctl.nim]
key = blank
[pl.nim]
key = blank
[pm.nim]
key = blank
[random.nim]
key = blank
[result.nim]
key = blank
[romfs_dev.nim]
search.timport = "../types"
replace.timport = "libnx/wrapper/types"
search.servimport = "../services/"
replace.servimport = "libnx/wrapper/"
[rwlock.nim]
key = blank
[semaphore.nim]
key = blank
[sm.nim]
key = blank
[smm.nim]
key = blank
[socket.nim]
key = blank
[spl.nim]
key = blank
[switch.nim]
key = blank
[thread.nim]
key = blank
[time.nim]
key = blank
[tls.nim]
key = blank
[tmem.nim]
key = blank
[usb.nim]
key = blank
[usb_comms.nim]
key = blank
[utf.nim]
key = blank
[vi.nim]
key = blank
[virtmem.nim]
key = blank