changelog shortlog graph tags branches changeset files revisions annotate raw help

Mercurial > core / skelfile

changeset 678: 2b7d5a8d63ac
parent: ca09f470abb3
child: 5f88b237ce29
author: Richard Westhaver <ellis@rwest.io>
date: Wed, 25 Sep 2024 21:39:39 -0400
permissions: -rwxr-xr-x
description: alien octets fix, workin with org-graph-db
1 ;;; skelfile --- CC/core skelfile -*- mode: skel; -*-
2 :name "core"
3 :author ("Richard Westhaver" . "ellis@rwest.io")
4 :version "0.1.0"
5 :license "MPL"
6 :stash ".stash"
7 :store ".store"
8 :description "The Compiler Company Core"
9 :tags ("core" "lisp" "rust" "emacs" "c")
10 :include ("lisp/lisp.sk" "rust/rust.sk" "emacs/emacs.sk")
11 :vc (:hg "https://vc.compiler.company/core")
12 :bind ((stash ".stash")
13  ;; (cc :env "clang")
14  (emacs-locals :dir-locals
15  (nil . ((indent-tabs-mode . nil)))
16  (rust-mode . ((eglot-workspace-configuration
17  . (:rust-analyzer (:cargo (:buildScripts (:enable t) (:features "all")))))))
18  (nushell-mode . ((nushell-indent-offset . 2)))
19  (nushell-ts-mode . ((nushell-indent-offset . 2)))
20  (sh-mode . (sh-indentation . 2))
21  (makefile-mode . ((indent-tabs-mode . t)))
22  (slint-mode . ((slint-indent-level . 2)))))
23 :components ((:org "readme")
24  (:mod "emacs")
25  (:mod "lisp")
26  (:mod "rust"))
27 :rules
28 ((all (%stash
29  psl.dat parquet.json rgb.txt
30  save-std save-prelude save-user
31  save-infra save-core save-tests
32  build-tree-sitter-alien build-core fasls
33  ;; build-skel build-organ build-homer build-packy build-rdb
34  ;; rust-bin
35  ))
36  (clean ()
37  #$rm -vrf .stash$#
38  #$find emacs -name '*.elc' -type f -delete$#
39  #$find lisp -name '*.fasl' -type f -delete$#
40  #$echo 'cargo clean:' && cd rust && cargo clean$#)
41  (tree-sitter-alien ()
42  (:build () #$cd lisp/ffi/tree-sitter &&
43  clang -g -O2 -Wall -Wno-unused-value -ltree-sitter -shared \
44  alien.c -o ../../../.stash/libtree-sitter-alien.so$#)
45  (:install () #$cp .stash/libtree-sitter-alien.so /usr/local/lib/$#))
46  (psl.dat (%stash)
47  (download "https://publicsuffix.org/list/public_suffix_list.dat"
48  :output (merge-pathnames
49  ".stash/psl.dat"
50  *skel-path*)))
51  (rgb.txt (%stash)
52  (download "https://packy.compiler.company/data/rgb.txt"
53  :output (merge-pathnames
54  ".stash/rgb.txt"
55  *skel-path*)))
56  (x11.lisp (rgb.txt)
57  (color::parse-x11-color-definitions
58  :input ".stash/rgb.txt"
59  :output (merge-pathnames "color/x11.lisp" *skel-path*)))
60  (parquet.thrift (%stash)
61  (download
62  "https://raw.githubusercontent.com/apache/parquet-format/master/src/main/thrift/parquet.thrift"
63  :output (merge-pathnames ".stash/parquet.thrift" *skel-path*))
64  #$thrift --gen json -out .stash .stash/parquet.thrift$#)
65  (parquet.json (%stash)
66  (download "https://packy.compiler.company/data/parquet.json"
67  :output (merge-pathnames ".stash/parquet.json" *skel-path*)))
68  (freedesktop.org.xml (%stash)
69  (download "https://packy.compiler.company/data/freedesktop.org.xml"
70  :output (merge-pathnames ".stash/freedesktop.org.xml" *skel-path*)))
71  (parquet-test-data (%stash) (download "https://packy.compiler.company/data/test/alltypes_plain.parquet"
72  :output (merge-pathnames ".stash/alltypes_plain.parquet" *skel-path*)))
73  ;; lisp
74  (%stash () #$mkdir -pv .stash$#)
75  (rdb (%stash)
76  (:build ()
77  (with-sbcl (:noinform t :quit t)
78  (ql:quickload :bin/rdb)
79  (asdf:make :bin/rdb))
80  #$mv lisp/bin/rdb .stash/rdb$#)
81  (:install () #$install -C -m 755 .stash/rdb /usr/local/bin/rdb$#))
82  (skel (%stash)
83  (:build ()
84  (with-sbcl (:noinform t :quit t)
85  (ql:quickload :bin/skel)
86  (asdf:make :bin/skel))
87  #$mv lisp/bin/skel .stash/skel$#)
88  (:build-gui ()
89  (with-sbcl (:noinform t :quit t)
90  (push :tools *features*)
91  (ql:quickload :bin/skel)
92  (asdf:make :bin/skel))
93  #$mv lisp/bin/skel .stash/skel$#)
94  (:install () #$install -C -m 755 .stash/skel /usr/local/bin/skel$#))
95  (organ (%stash)
96  (:build () (with-sbcl (:noinform t :quit t)
97  (ql:quickload :bin/organ)
98  (asdf:make :bin/organ))
99  #$mv lisp/bin/organ .stash/organ$#))
100  (homer (%stash)
101  (:build () (with-sbcl (:noinform t :quit t)
102  (ql:quickload :bin/homer)
103  (asdf:make :bin/homer))
104  #$mv lisp/bin/homer .stash/homer$#))
105  (packy (%stash)
106  (:build () (with-sbcl (:noinform t :quit t)
107  (ql:quickload :bin/packy)
108  (asdf:make :bin/packy))
109  #$mv lisp/bin/packy .stash/packy$#))
110  (std () (:save () (with-sbcl (:noinform t :quit t)
111  (ql:quickload :std)
112  (in-package :std-user)
113  (compile-lisp :std :save ".stash/std.core"))))
114  (prelude ()
115  (:save () (with-sbcl (:noinform t :quit t)
116  (ql:quickload :prelude)
117  (in-package :std-user)
118  (compile-lisp :prelude :save ".stash/prelude.core")))
119  (:compile () (compile-lisp :prelude :force t :verbose t)))
120  (user ()
121  (:save () (with-sbcl (:noinform t :quit t)
122  (ql:quickload :user)
123  (in-package :user)
124  (compile-lisp :user :save ".stash/user.core")))
125  (:compile () (compile-lisp :user :force t :verbose t)))
126  (infra () (:save () (with-sbcl (:noinform t :quit t)
127  (ql:quickload :user)
128  (in-package :user)
129  (compile-lisp :user :save ".stash/infra.core" :compression 22))))
130  (core ()
131  (:build () (with-sbcl (:noinform t :quit t)
132  (ql:quickload :bin/core)
133  (asdf:make :bin/core))
134  #$mv lisp/bin/core .stash/core$#)
135  (:save () (with-sbcl (:noinform t :quit t)
136  (ql:quickload (list :std :core))
137  (in-package :std-user)
138  (compile-lisp :core :save ".stash/core.core")))
139  (:compile () (compile-lisp :core :force t :verbose t))
140  (:install () #$install -C -m 755 .stash/core /usr/local/bin/core
141  echo "core -> /usr/local/bin/"
142  links="skel homer packy rdb organ"
143  for i in $links; do
144  ln -sf /usr/local/bin/core /usr/local/bin/$i
145  echo "$i -> core -> /usr/local/bin/"
146  done$#))
147  (tests ()
148  (:save () (with-sbcl (:noinform t :quit t)
149  (ql:quickload :core/tests)
150  (in-package :core/tests)
151  (compile-lisp :core/tests :save ".stash/tests.core")))
152  (:compile ()
153  (compile-lisp :core/tests :force t :verbose t)))
154  (bench () (:compile () (compile-lisp :core/bench :force t :verbose t)))
155  (fasls (compile-core #+nil compile-tests compile-bench compile-user compile-prelude))
156  ;; rust
157  (mailman () #$cd rust && cargo build -Z unstable-options --bin mailman --artifact-dir ../.stash/$#)
158  (alik () #$cd rust && cargo build -Z unstable-options --bin alik --artifact-dir ../.stash/$#)
159  (rust-bin (mailman alik))
160  (alik-ui () #$trunk build --config rust/ui/alik/Trunk.toml$#)
161  ;; install
162  (install (install-core)
163  #$d=/usr/local/share/lisp/
164  cd .stash
165  if [ -d $d ];
166  then
167  for f in $(find . -type f -name "*.core")
168  do echo "$(basename $f) -> $d"
169  install -C -m 755 $f $d
170  done fi$#)
171  (emacs () #$make -C emacs$#)
172  ;; TODO 2024-09-15:
173  (core-syms.sxp () (with-open-file (f ".stash/symbols.sxp" :direction :output)))
174  (dist () #$mkdir -pv .stash/tmp/core/bin/ .stash/tmp/core/share/lisp/fasl/ .stash/tmp/core/lib/
175  cd .stash
176  mv *.core tmp/core/share/lisp/
177  mv *.fasl tmp/core/share/lisp/fasl/
178  mv *.so tmp/core/lib/
179  mv $(find -maxdepth 1 -type f ! -name "*.*") tmp/core/bin/
180  cd tmp && tar -I 'zstd' -cf core.tar.zst core/* && mv core.tar.zst ../$#)
181  (dist-clean (clean) #$cd .. && tar -I 'zstd' -cf core/core-source.tar.zst core/* && cd core
182  mkdir -pv .stash
183  mv core-source.tar.zst .stash/$#))