changelog shortlog graph tags branches changeset files revisions annotate raw help

Mercurial > core / skelfile

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