changelog shortlog graph tags branches changeset files revisions annotate raw help

Mercurial > core / skelfile

changeset 688: 517c65b51e6b
parent: 5f88b237ce29
child: 38e9c3be2392
author: Richard Westhaver <ellis@rwest.io>
date: Tue, 01 Oct 2024 21:52:17 -0400
permissions: -rwxr-xr-x
description: clap tests
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  (skc (%stash)
96  (:build ()
97  (with-sbcl (:noinform t :quit t)
98  (ql:quickload :bin/skc)
99  (asdf:make :bin/skc))
100  #$mv lisp/bin/skc .stash/skc$#))
101  (organ (%stash)
102  (:build () (with-sbcl (:noinform t :quit t)
103  (ql:quickload :bin/organ)
104  (asdf:make :bin/organ))
105  #$mv lisp/bin/organ .stash/organ$#))
106  (homer (%stash)
107  (:build () (with-sbcl (:noinform t :quit t)
108  (ql:quickload :bin/homer)
109  (asdf:make :bin/homer))
110  #$mv lisp/bin/homer .stash/homer$#))
111  (packy (%stash)
112  (:build () (with-sbcl (:noinform t :quit t)
113  (ql:quickload :bin/packy)
114  (asdf:make :bin/packy))
115  #$mv lisp/bin/packy .stash/packy$#))
116  (std () (:save () (with-sbcl (:noinform t :quit t)
117  (ql:quickload :std)
118  (in-package :std-user)
119  (compile-lisp :std :save ".stash/std.core"))))
120  (prelude ()
121  (:save () (with-sbcl (:noinform t :quit t)
122  (ql:quickload :prelude)
123  (in-package :std-user)
124  (compile-lisp :prelude :save ".stash/prelude.core")))
125  (:compile () (compile-lisp :prelude :force t :verbose t)))
126  (user ()
127  (:save () (with-sbcl (:noinform t :quit t)
128  (ql:quickload :user)
129  (in-package :user)
130  (compile-lisp :user :save ".stash/user.core")))
131  (:compile () (compile-lisp :user :force t :verbose t)))
132  (infra () (:save () (with-sbcl (:noinform t :quit t)
133  (ql:quickload :user)
134  (in-package :user)
135  (compile-lisp :user :save ".stash/infra.core" :compression 22))))
136  (core ()
137  (:build () (with-sbcl (:noinform t :quit t)
138  (ql:quickload :bin/core)
139  (asdf:make :bin/core))
140  #$mv lisp/bin/core .stash/core$#)
141  (:save () (with-sbcl (:noinform t :quit t)
142  (ql:quickload (list :std :core))
143  (in-package :std-user)
144  (compile-lisp :core :save ".stash/core.core")))
145  (:compile () (compile-lisp :core :force t :verbose t))
146  (:install () #$install -C -m 755 .stash/core /usr/local/bin/core
147  echo "core -> /usr/local/bin/"
148  links="skel homer packy rdb organ"
149  for i in $links; do
150  ln -sf /usr/local/bin/core /usr/local/bin/$i
151  echo "$i -> core -> /usr/local/bin/"
152  done$#))
153  (tests ()
154  (:save () (with-sbcl (:noinform t :quit t)
155  (ql:quickload :core/tests)
156  (in-package :core/tests)
157  (compile-lisp :core/tests :save ".stash/tests.core")))
158  (:compile ()
159  (compile-lisp :core/tests :force t :verbose t)))
160  (bench () (:compile () (compile-lisp :core/bench :force t :verbose t)))
161  (fasls (compile-core #+nil compile-tests compile-bench compile-user compile-prelude))
162  ;; rust
163  (mailman () #$cd rust && cargo build -Z unstable-options --bin mailman --artifact-dir ../.stash/$#)
164  (alik () #$cd rust && cargo build -Z unstable-options --bin alik --artifact-dir ../.stash/$#)
165  (rust-bin (mailman alik))
166  (alik-ui () #$trunk build --config rust/ui/alik/Trunk.toml$#)
167  ;; install
168  (install (install-core)
169  #$d=/usr/local/share/lisp/
170  cd .stash
171  if [ -d $d ];
172  then
173  for f in $(find . -type f -name "*.core")
174  do echo "$(basename $f) -> $d"
175  install -C -m 755 $f $d
176  done fi$#)
177  (emacs () #$make -C emacs$#)
178  ;; TODO 2024-09-15:
179  (core-syms.sxp () (with-open-file (f ".stash/symbols.sxp" :direction :output)))
180  (dist () #$mkdir -pv .stash/tmp/core/bin/ .stash/tmp/core/share/lisp/fasl/ .stash/tmp/core/lib/
181  cd .stash
182  mv *.core tmp/core/share/lisp/
183  mv *.fasl tmp/core/share/lisp/fasl/
184  mv *.so tmp/core/lib/
185  mv $(find -maxdepth 1 -type f ! -name "*.*") tmp/core/bin/
186  cd tmp && tar -I 'zstd' -cf core.tar.zst core/* && mv core.tar.zst ../$#)
187  (dist-clean (clean) #$cd .. && tar -I 'zstd' -cf core/core-source.tar.zst core/* && cd core
188  mkdir -pv .stash
189  mv core-source.tar.zst .stash/$#))