| Write the build in babashka, and pin the babashka 34832a8 nandi 18d ago | 1 | #!/bin/sh |
| 2 | #_( |
| 3 | exec "$(dirname "$0")/bb" "$0" "$@" |
| 4 | ) |
| 5 | |
| 6 | ;; Both native libraries: libvidya (the tree ABI glimmer-vidya binds) and |
| 7 | ;; libjoltmoq (the AV media plane). One workspace, one target directory. |
| 8 | ;; |
| 9 | ;; A sibling jolt-native checkout wins, so anyone working on the two repos |
| 10 | ;; together builds what they are editing; everyone else gets a clone of the |
| 11 | ;; gitlab repo under .jolt-native, pinned to the commit deps.edn takes |
| 12 | ;; glimmer-vidya from — one place to bump, rather than a second sha here. |
| 13 | (require '[babashka.classpath :as cp]) |
| 14 | (cp/add-classpath (str (babashka.fs/parent *file*))) |
| 15 | (require '[frq.paths :as paths] |
| 16 | '[babashka.fs :as fs] |
| 17 | '[babashka.process :as p]) |
| 18 | |
| 19 | (def root (str (fs/canonicalize (fs/path (fs/parent *file*) "..")))) |
| 20 | (def url "https://gitlab.com/nandithebull/jolt-native.git") |
| 21 | (def sha (paths/dep-sha root "https://gitlab.com/nandithebull/jolt-native")) |
| 22 | (def jolt-native (paths/jolt-native root)) |
| 23 | |
| 24 | ;; Already here whenever the sibling checkout exists, since that is what |
| 25 | ;; jolt-native then points at. |
| 26 | (when-not (fs/directory? jolt-native) |
| 27 | (p/shell "git" "clone" url jolt-native) |
| 28 | (p/shell {:dir jolt-native} "git" "checkout" "--detach" sha)) |
| 29 | |
| 30 | (p/shell {:dir jolt-native} "just" "build") |