changelog shortlog graph tags branches changeset files revisions annotate raw help

Mercurial > core / skelfile

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