nandi/jolt-nativepublic Fork 0
8288c3827d533beb6379d43924a144d98e30d7d5
Commits
Clone
git clone https://git.rickub.com/nandi/jolt-native.git
git clone ssh://git@rickub.com/nandi/jolt-native.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

wayland-bar-compositor: a wlroots compositor in jolt, for panels on X11 1d16366 · on 8288c3827d533beb6379d43924a144d98e30d7d5 · nandi · 8d ago
build · 27 lines · 1.0 KBText Blame HistoryRaw
 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
#!/usr/bin/env jolt
;; Generate offsets.edn: the wlroots struct layout facts wayland-bar-compositor
;; reads at startup. Rerun after a wlroots update.

(require '[babashka.process :as p]
         '[babashka.fs :as fs]
         '[clojure.string :as str])

(def here (str (fs/parent (fs/canonicalize *file*))))
(def out (str here "/build-out"))
(fs/create-dirs out)

(defn run [& cmd]
  (apply p/shell {:out :inherit :err :inherit} cmd))

;; wlroots' public layer-shell header includes a protocol header it doesn't install.
(run "wayland-scanner" "server-header"
     (str here "/protocol/wlr-layer-shell-unstable-v1.xml")
     (str out "/wlr-layer-shell-unstable-v1-protocol.h"))

(def cflags (-> (p/sh "pkg-config" "--cflags" "wlroots-0.20" "wayland-server" "pixman-1" "xkbcommon") :out str/trim))

(apply run (concat ["cc" "-o" (str out "/gen-offsets") (str here "/gen-offsets.c") (str "-I" out)]
                   (str/split cflags #"\s+")))

(spit (str here "/offsets.edn") (:out (p/sh (str out "/gen-offsets"))))
(println "wrote" (str here "/offsets.edn"))