-
Notifications
You must be signed in to change notification settings - Fork 0
/
naylib64.nimble
61 lines (52 loc) · 1.86 KB
/
naylib64.nimble
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# Package
version = "0.2"
author = "Christopher DeBoy"
description = "Raylib64 Nim wrapper for N64"
license = "Unlicense"
srcDir = "src"
# Deps
requires "nim >= 2.0.0"
#requires "eminim == 2.8.2"
# https://github.com/raysan5/raylib/wiki/Working-on-GNU-Linux
#[import std/distros
if detectOs(Ubuntu):
foreignDep "libasound2-dev libx11-dev libxrandr-dev libxi-dev libgl1-mesa-dev libglu1-mesa-dev libxcursor-dev libxinerama-dev"
foreignDep "libxkbcommon-dev libwayland-bin"
elif detectOs(Fedora):
foreignDep "alsa-lib-devel mesa-libGL-devel libX11-devel libXrandr-devel libXi-devel libXcursor-devel libXinerama-devel libatomic"
foreignDep "libxkbcommon-devel wayland-devel"
elif detectOs(ArchLinux) or detectOs(Manjaro):
foreignDep "alsa-lib mesa libx11 libxrandr libxi libxcursor libxinerama"
foreignDep "libxkbcommon wayland"
]#
# Tasks
import std/[os, strutils, parseutils]
#[
proc editRaylibDirConst(dir: string) =
withDir(dir):
var file = readFile("raylib.nim")
let first = find(file, "raylibDir")
let skipped = skipUntil(file, '\n', start = first)
let str = "\"" & (dir / "raylib") & "\""
file[first..first+skipped-1] = "raylibDir = Path" & str
writeFile("raylib.nim", file)
]#
task localInstall, "Install on your local workspace": discard
#echo "To complete the installation, run:\n"
#echoForeignDeps()
# Works with atlas
#editRaylibDirConst(thisDir() / "src")
after install:
when defined(atlas):
localInstallTask()
else: discard
#echo "To complete the installation, run:\n"
#echoForeignDeps()
# Fails with atlas
#editRaylibDirConst(thisDir())
task test, "Runs the test suite":
localInstallTask()
exec "nim c -d:release tests/basic_window.nim"
when defined(linux):
exec "nim c -d:release -d:wayland tests/basic_window.nim"
exec "nim c -d:release -d:emscripten tests/basic_window_web.nim"