Use commit of guile-ts supporting TREE_SITTER_GRAMMAR_PATH
This commit is contained in:
parent
57ce73370d
commit
eff0f10911
1 changed files with 154 additions and 149 deletions
303
guix.scm
303
guix.scm
|
@ -8,158 +8,163 @@
|
|||
(guix build-system gnu)
|
||||
(guix download)
|
||||
(guix gexp)
|
||||
(guix transformations)
|
||||
((guix licenses)
|
||||
#:prefix license:)
|
||||
(guix packages)
|
||||
(srfi srfi-1))
|
||||
|
||||
(package
|
||||
(name "sloth")
|
||||
(version "0.1-dev")
|
||||
(source
|
||||
(local-file
|
||||
(dirname (current-filename))
|
||||
#:recursive? #t
|
||||
#:select? (λ (file stat)
|
||||
(not (any (λ (my-string)
|
||||
(string-contains file my-string))
|
||||
(list ".git" ".dir-locals.el" "guix.scm"))))))
|
||||
(build-system gnu-build-system)
|
||||
(arguments
|
||||
(list
|
||||
#:make-flags
|
||||
#~(list "GUILE_AUTO_COMPILE=0")
|
||||
#:phases
|
||||
#~(modify-phases %standard-phases
|
||||
(delete 'strip)
|
||||
(add-before 'configure 'hall-build
|
||||
(λ _ (system* "hall" "build" "-x")))
|
||||
(add-after 'hall-build 'autoreconf
|
||||
(λ _ (system* "autoreconf" "-vif")))
|
||||
(add-after 'install 'hall-wrap-binaries
|
||||
(λ _
|
||||
(use-modules (ice-9 ftw))
|
||||
(define (guile-compiled-dir out version)
|
||||
(string-append out "/lib/guile/"
|
||||
version
|
||||
"/site-ccache"))
|
||||
(define (guile-uncompiled-dir out version)
|
||||
(string-append out
|
||||
"/share/guile/site"
|
||||
(if (string-null? version) ""
|
||||
"/")
|
||||
version))
|
||||
(define (guile-dep-path env modules path)
|
||||
(list env ":" 'prefix
|
||||
(cons modules
|
||||
(map (λ (input)
|
||||
(string-append input path))
|
||||
;; TODO: figure out how to put these in a list shared
|
||||
;; with inputs because DRY
|
||||
(list #$guile-config
|
||||
#$guile-ncurses
|
||||
#$guile-ts)))))
|
||||
(define bin (string-append #$output "/bin/"))
|
||||
(define site (guile-uncompiled-dir #$output ""))
|
||||
(define version (caddr (scandir site)))
|
||||
(wrap-program (string-append bin "sloth")
|
||||
(guile-dep-path
|
||||
"GUILE_LOAD_PATH"
|
||||
(guile-uncompiled-dir #$output version)
|
||||
(guile-uncompiled-dir "" version))
|
||||
(guile-dep-path
|
||||
"GUILE_LOAD_COMPILED_PATH"
|
||||
(guile-compiled-dir #$output version)
|
||||
(guile-compiled-dir "" version))
|
||||
(list "TREE_SITTER_GRAMMAR_PATH" ":" '=
|
||||
(map (λ (input)
|
||||
(string-append input "/lib/tree-sitter"))
|
||||
;; TODO: figure out how to put these in a list shared
|
||||
;; with inputs because DRY
|
||||
(list #$tree-sitter-bash
|
||||
#$tree-sitter-bibtex
|
||||
#$tree-sitter-c
|
||||
#$tree-sitter-c-sharp
|
||||
#$tree-sitter-clojure
|
||||
#$tree-sitter-cmake
|
||||
#$tree-sitter-cpp
|
||||
#$tree-sitter-css
|
||||
#$tree-sitter-dockerfile
|
||||
#$tree-sitter-elixir
|
||||
#$tree-sitter-elm
|
||||
#$tree-sitter-go
|
||||
#$tree-sitter-gomod
|
||||
#$tree-sitter-haskell
|
||||
#$tree-sitter-heex
|
||||
#$tree-sitter-html
|
||||
#$tree-sitter-java
|
||||
#$tree-sitter-javascript
|
||||
#$tree-sitter-json
|
||||
#$tree-sitter-julia
|
||||
#$tree-sitter-lua
|
||||
#$tree-sitter-markdown
|
||||
#$tree-sitter-markdown-gfm
|
||||
#$tree-sitter-meson
|
||||
#$tree-sitter-ocaml
|
||||
#$tree-sitter-org
|
||||
#$tree-sitter-php
|
||||
#$tree-sitter-plantuml
|
||||
#$tree-sitter-python
|
||||
#$tree-sitter-r
|
||||
#$tree-sitter-racket
|
||||
#$tree-sitter-ruby
|
||||
#$tree-sitter-rust
|
||||
#$tree-sitter-scala
|
||||
#$tree-sitter-scheme
|
||||
#$tree-sitter-typescript)))))))))
|
||||
(native-inputs (list autoconf
|
||||
automake
|
||||
guile-hall
|
||||
pkg-config
|
||||
texinfo))
|
||||
(inputs (list guile-3.0
|
||||
guile-config
|
||||
guile-ncurses
|
||||
guile-ts
|
||||
tree-sitter-bash
|
||||
tree-sitter-bibtex
|
||||
tree-sitter-c
|
||||
tree-sitter-c-sharp
|
||||
tree-sitter-clojure
|
||||
tree-sitter-cmake
|
||||
tree-sitter-cpp
|
||||
tree-sitter-css
|
||||
tree-sitter-dockerfile
|
||||
tree-sitter-elixir
|
||||
tree-sitter-elm
|
||||
tree-sitter-go
|
||||
tree-sitter-gomod
|
||||
tree-sitter-haskell
|
||||
tree-sitter-heex
|
||||
tree-sitter-html
|
||||
tree-sitter-java
|
||||
tree-sitter-javascript
|
||||
tree-sitter-json
|
||||
tree-sitter-julia
|
||||
tree-sitter-lua
|
||||
tree-sitter-markdown
|
||||
tree-sitter-markdown-gfm
|
||||
tree-sitter-meson
|
||||
tree-sitter-ocaml
|
||||
tree-sitter-org
|
||||
tree-sitter-php
|
||||
tree-sitter-plantuml
|
||||
tree-sitter-python
|
||||
tree-sitter-r
|
||||
tree-sitter-racket
|
||||
tree-sitter-ruby
|
||||
tree-sitter-rust
|
||||
tree-sitter-scala
|
||||
tree-sitter-scheme
|
||||
tree-sitter-typescript))
|
||||
(synopsis "Text editor based on tree-sitter")
|
||||
(description
|
||||
"TODO")
|
||||
(home-page "https://git.solarpunk.moe/Sloth/sloth")
|
||||
(license license:gpl3+))
|
||||
(define guile-ts-transform
|
||||
(options->transformation
|
||||
'((with-commit . "guile-ts=266453a"))))
|
||||
|
||||
(package
|
||||
(name "sloth")
|
||||
(version "0.1-dev")
|
||||
(source
|
||||
(local-file
|
||||
(dirname (current-filename))
|
||||
#:recursive? #t
|
||||
#:select? (λ (file stat)
|
||||
(not (any (λ (my-string)
|
||||
(string-contains file my-string))
|
||||
(list ".git" ".dir-locals.el" "guix.scm"))))))
|
||||
(build-system gnu-build-system)
|
||||
(arguments
|
||||
(list
|
||||
#:make-flags
|
||||
#~(list "GUILE_AUTO_COMPILE=0")
|
||||
#:phases
|
||||
#~(modify-phases %standard-phases
|
||||
(delete 'strip)
|
||||
(add-before 'configure 'hall-build
|
||||
(λ _ (system* "hall" "build" "-x")))
|
||||
(add-after 'hall-build 'autoreconf
|
||||
(λ _ (system* "autoreconf" "-vif")))
|
||||
(add-after 'install 'hall-wrap-binaries
|
||||
(λ _
|
||||
(use-modules (ice-9 ftw))
|
||||
(define (guile-compiled-dir out version)
|
||||
(string-append out "/lib/guile/"
|
||||
version
|
||||
"/site-ccache"))
|
||||
(define (guile-uncompiled-dir out version)
|
||||
(string-append out
|
||||
"/share/guile/site"
|
||||
(if (string-null? version) ""
|
||||
"/")
|
||||
version))
|
||||
(define (guile-dep-path env modules path)
|
||||
(list env ":" 'prefix
|
||||
(cons modules
|
||||
(map (λ (input)
|
||||
(string-append input path))
|
||||
;; TODO: figure out how to put these in a list shared
|
||||
;; with inputs because DRY
|
||||
(list #$guile-config
|
||||
#$guile-ncurses
|
||||
#$(guile-ts-transform guile-ts))))))
|
||||
(define bin (string-append #$output "/bin/"))
|
||||
(define site (guile-uncompiled-dir #$output ""))
|
||||
(define version (caddr (scandir site)))
|
||||
(wrap-program (string-append bin "sloth")
|
||||
(guile-dep-path
|
||||
"GUILE_LOAD_PATH"
|
||||
(guile-uncompiled-dir #$output version)
|
||||
(guile-uncompiled-dir "" version))
|
||||
(guile-dep-path
|
||||
"GUILE_LOAD_COMPILED_PATH"
|
||||
(guile-compiled-dir #$output version)
|
||||
(guile-compiled-dir "" version))
|
||||
(list "TREE_SITTER_GRAMMAR_PATH" ":" '=
|
||||
(map (λ (input)
|
||||
(string-append input "/lib/tree-sitter"))
|
||||
;; TODO: figure out how to put these in a list shared
|
||||
;; with inputs because DRY
|
||||
(list #$tree-sitter-bash
|
||||
#$tree-sitter-bibtex
|
||||
#$tree-sitter-c
|
||||
#$tree-sitter-c-sharp
|
||||
#$tree-sitter-clojure
|
||||
#$tree-sitter-cmake
|
||||
#$tree-sitter-cpp
|
||||
#$tree-sitter-css
|
||||
#$tree-sitter-dockerfile
|
||||
#$tree-sitter-elixir
|
||||
#$tree-sitter-elm
|
||||
#$tree-sitter-go
|
||||
#$tree-sitter-gomod
|
||||
#$tree-sitter-haskell
|
||||
#$tree-sitter-heex
|
||||
#$tree-sitter-html
|
||||
#$tree-sitter-java
|
||||
#$tree-sitter-javascript
|
||||
#$tree-sitter-json
|
||||
#$tree-sitter-julia
|
||||
#$tree-sitter-lua
|
||||
#$tree-sitter-markdown
|
||||
#$tree-sitter-markdown-gfm
|
||||
#$tree-sitter-meson
|
||||
#$tree-sitter-ocaml
|
||||
#$tree-sitter-org
|
||||
#$tree-sitter-php
|
||||
#$tree-sitter-plantuml
|
||||
#$tree-sitter-python
|
||||
#$tree-sitter-r
|
||||
#$tree-sitter-racket
|
||||
#$tree-sitter-ruby
|
||||
#$tree-sitter-rust
|
||||
#$tree-sitter-scala
|
||||
#$tree-sitter-scheme
|
||||
#$tree-sitter-typescript)))))))))
|
||||
(native-inputs (list autoconf
|
||||
automake
|
||||
guile-hall
|
||||
pkg-config
|
||||
texinfo))
|
||||
(inputs (list guile-3.0
|
||||
guile-config
|
||||
guile-ncurses
|
||||
(guile-ts-transform guile-ts)
|
||||
tree-sitter-bash
|
||||
tree-sitter-bibtex
|
||||
tree-sitter-c
|
||||
tree-sitter-c-sharp
|
||||
tree-sitter-clojure
|
||||
tree-sitter-cmake
|
||||
tree-sitter-cpp
|
||||
tree-sitter-css
|
||||
tree-sitter-dockerfile
|
||||
tree-sitter-elixir
|
||||
tree-sitter-elm
|
||||
tree-sitter-go
|
||||
tree-sitter-gomod
|
||||
tree-sitter-haskell
|
||||
tree-sitter-heex
|
||||
tree-sitter-html
|
||||
tree-sitter-java
|
||||
tree-sitter-javascript
|
||||
tree-sitter-json
|
||||
tree-sitter-julia
|
||||
tree-sitter-lua
|
||||
tree-sitter-markdown
|
||||
tree-sitter-markdown-gfm
|
||||
tree-sitter-meson
|
||||
tree-sitter-ocaml
|
||||
tree-sitter-org
|
||||
tree-sitter-php
|
||||
tree-sitter-plantuml
|
||||
tree-sitter-python
|
||||
tree-sitter-r
|
||||
tree-sitter-racket
|
||||
tree-sitter-ruby
|
||||
tree-sitter-rust
|
||||
tree-sitter-scala
|
||||
tree-sitter-scheme
|
||||
tree-sitter-typescript))
|
||||
(synopsis "Text editor based on tree-sitter")
|
||||
(description
|
||||
"TODO")
|
||||
(home-page "https://git.solarpunk.moe/Sloth/sloth")
|
||||
(license license:gpl3+))
|
||||
|
||||
|
|
Loading…
Reference in a new issue