changelog shortlog graph tags branches changeset files revisions annotate raw help

Mercurial > core / skelfile

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