changelog shortlog graph tags branches changeset files revisions annotate raw help

Mercurial > core / skelfile

changeset 641: 48bcbca019e6
parent: 8a5921bf004e
child: 3e6a17fb5712
author: Richard Westhaver <ellis@rwest.io>
date: Sun, 08 Sep 2024 20:11:35 -0400
permissions: -rwxr-xr-x
description: org-project-info dblock update
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" :output ".stash/psl.dat"))
35  (rgb.txt (%stash)
36  (download "https://packy.compiler.company/data/rgb.txt" :output ".stash/rgb.txt"))
37  (x11.lisp (rgb.txt)
38  (color::parse-x11-color-definitions :input ".stash/rgb.txt" :output "color/x11.lisp"))
39  (parquet.thrift (%stash)
40  (download
41  "https://raw.githubusercontent.com/apache/parquet-format/master/src/main/thrift/parquet.thrift"
42  :output ".stash/parquet.thrift")
43  #$thrift --gen json -out .stash .stash/parquet.thrift$#)
44  (parquet.json (%stash)
45  (download "https://packy.compiler.company/data/parquet.json"
46  :output ".stash/parquet.json"))
47  (freedesktop.org.xml (%stash)
48  (download "https://packy.compiler.company/data/freedesktop.org.xml"
49  :output ".stash/freedesktop.org.xml"))
50  (parquet-test-data (%stash) (download "https://packy.compiler.company/data/test/alltypes_plain.parquet"
51  :output ".stash/alltypes_plain.parquet"))
52  ;; lisp
53  (%stash () #$mkdir -pv .stash$#)
54  (rdb (%stash)
55  (:build ()
56  (with-sbcl (:noinform t :quit t)
57  (ql:quickload :bin/rdb)
58  (asdf:make :bin/rdb))
59  #$mv lisp/bin/rdb .stash/rdb$#)
60  (:install () #$install -C -m 755 .stash/rdb /usr/local/bin/rdb$#))
61  (skel (%stash)
62  (:build ()
63  (with-sbcl (:noinform t :quit t)
64  (ql:quickload :bin/skel)
65  (asdf:make :bin/skel))
66  #$mv lisp/bin/skel .stash/skel$#)
67  (:build-gui ()
68  (with-sbcl (:noinform t :quit t)
69  (push :tools *features*)
70  (ql:quickload :bin/skel)
71  (asdf:make :bin/skel))
72  #$mv lisp/bin/skel .stash/skel$#)
73  (:install () #$install -C -m 755 .stash/skel /usr/local/bin/skel$#))
74  (organ (%stash)
75  (:build () (with-sbcl (:noinform t :quit t)
76  (ql:quickload :bin/organ)
77  (asdf:make :bin/organ))
78  #$mv lisp/bin/organ .stash/organ$#))
79  (homer (%stash)
80  (:build () (with-sbcl (:noinform t :quit t)
81  (ql:quickload :bin/homer)
82  (asdf:make :bin/homer))
83  #$mv lisp/bin/homer .stash/homer$#))
84  (packy (%stash)
85  (:build () (with-sbcl (:noinform t :quit t)
86  (ql:quickload :bin/packy)
87  (asdf:make :bin/packy))
88  #$mv lisp/bin/packy .stash/packy$#))
89  (compile () #$./x.lisp compile$#)
90  (std () (:save () #$./x.lisp save std$#))
91  (prelude ()
92  (:save () #$./x.lisp save prelude$#)
93  (:compile () #$./x.lisp make prelude$#))
94  (user ()
95  (:save () #$./x.lisp save user$#)
96  (:compile () #$./x.lisp make user$#))
97  (infra () (:save () #$./x.lisp save infra$#))
98  (core ()
99  (:save () #$./x.lisp save core$#)
100  (:compile () #$./x.lisp make core$#))
101  (tests ()
102  (:save () #$./x.lisp save tests$#)
103  (:compile () #$./x.lisp make core/tests$#))
104  (bench () (:compile () #$./x.lisp make core/bench$#))
105  (fasl (compile-core compile-tests compile-bench compile-user compile-prelude))
106  ;; rust
107  (mailman () #$cd rust && cargo build -Z unstable-options --bin mailman --artifact-dir ../.stash/$#)
108  (alik () #$cd rust && cargo build -Z unstable-options --bin alik --artifact-dir ../.stash/$#)
109  (rust-bin (mailman alik))
110  (alik-ui () #$trunk build --config rust/ui/alik/Trunk.toml$#)
111  ;; install
112  (install () #$d=/usr/local/bin
113  cd .stash
114  for f in $(find . -type f ! -name "*.*")
115  do echo "$(basename $f) -> $d"
116  install -C -m 755 $f $d
117  done
118  d=/usr/local/share/lisp
119  if [ -d $d ];
120  then
121  for f in $(find . -type f -name "*.core")
122  do echo "$(basename $f) -> $d"
123  install -C -m 755 $f $d
124  done fi$#)
125  (emacs () #$make -C emacs$#)
126  (core-syms.sxp ()
127  (with-open-file (f "emacs/core-syms.sxp")
128  (write `(defvar lisp-standard-function-names ,(standard-symbol-names #'fboundp)) :stream f)
129  (write `(defvar lisp-standard-value-names ,(standard-symbol-names #'boundp)) :stream f)))
130  (dist () #$cd .stash
131  mkdir -pv core/bin core/share/lisp/fasl core/lib
132  mv *.core core/share/lisp/
133  mv *.fasl core/share/lisp/fasl/
134  mv *.so core/lib/
135  mv $(find -maxdepth 1 -type f ! -name "*.*") core/bin/
136  tar -I 'zstd' -cf core.tar.zst core/*$#)
137  (dist-clean (clean) #$cd .. && tar -I 'zstd' -cf core/core-source.tar.zst core/* && cd core
138  mkdir -pv .stash
139  mv core-source.tar.zst .stash/$#))