changelog shortlog graph tags branches changeset files revisions annotate raw help

Mercurial > core / skelfile

changeset 651: af486e0a40c9
parent: 74e563ed4537
child: 119532882cb1
author: Richard Westhaver <ellis@rwest.io>
date: Sat, 14 Sep 2024 22:13:06 -0400
permissions: -rwxr-xr-x
description: multi-binaries, working on removing 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 :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-core
22  build-skel build-organ build-homer build-packy
23  fasl rust-bin build-tree-sitter-alien))
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  (compile () #$./x.lisp compile$#)
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 () #$./x.lisp save prelude$#)
105  (:compile () #$./x.lisp make prelude$#))
106  (user ()
107  (:save () #$./x.lisp save user$#)
108  (:compile () #$./x.lisp make user$#))
109  (infra () (:save () #$./x.lisp save infra$#))
110  (core ()
111  (:build () (with-sbcl (:noinform t :quit t)
112  (ql:quickload :bin/core)
113  (asdf:make :bin/core))
114  #$mv lisp/bin/core .stash/core$#)
115  (:save () (with-sbcl (:noinform t :quit t)
116  (ql:quickload (list :std :core))
117  (in-package :std-user)
118  (compile-lisp :core :save ".stash/core.core")))
119  (:compile () (compile-lisp :core :force t :verbose t)))
120  (tests ()
121  (:save () #$./x.lisp save tests$#)
122  (:compile () #$./x.lisp make core/tests$#))
123  (bench () (:compile () #$./x.lisp make core/bench$#))
124  (fasl (compile-core compile-tests compile-bench compile-user compile-prelude))
125  ;; rust
126  (mailman () #$cd rust && cargo build -Z unstable-options --bin mailman --artifact-dir ../.stash/$#)
127  (alik () #$cd rust && cargo build -Z unstable-options --bin alik --artifact-dir ../.stash/$#)
128  (rust-bin (mailman alik))
129  (alik-ui () #$trunk build --config rust/ui/alik/Trunk.toml$#)
130  ;; install
131  (install () #$d=/usr/local/bin
132  cd .stash
133  for f in $(find . -type f ! -name "*.*")
134  do echo "$(basename $f) -> $d"
135  install -C -m 755 $f $d
136  done
137  d=/usr/local/share/lisp
138  if [ -d $d ];
139  then
140  for f in $(find . -type f -name "*.core")
141  do echo "$(basename $f) -> $d"
142  install -C -m 755 $f $d
143  done fi$#)
144  (emacs () #$make -C emacs$#)
145  (core-syms.sxp ()
146  (with-open-file (f "emacs/core-syms.sxp")
147  (write `(defvar lisp-standard-function-names ,(standard-symbol-names #'fboundp)) :stream f)
148  (write `(defvar lisp-standard-value-names ,(standard-symbol-names #'boundp)) :stream f)))
149  (dist () #$cd .stash
150  mkdir -pv core/bin core/share/lisp/fasl core/lib
151  mv *.core core/share/lisp/
152  mv *.fasl core/share/lisp/fasl/
153  mv *.so core/lib/
154  mv $(find -maxdepth 1 -type f ! -name "*.*") core/bin/
155  tar -I 'zstd' -cf core.tar.zst core/*$#)
156  (dist-clean (clean) #$cd .. && tar -I 'zstd' -cf core/core-source.tar.zst core/* && cd core
157  mkdir -pv .stash
158  mv core-source.tar.zst .stash/$#))