changelog shortlog graph tags branches changeset files revisions annotate raw help

Mercurial > core / skelfile

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