sloth/guix.scm

89 lines
2.8 KiB
Scheme

(use-modules
(guix packages)
((guix licenses) #:prefix license:)
(guix download)
(guix gexp)
(guix build-system gnu)
(gnu packages)
(gnu packages autotools)
(gnu packages guile)
(gnu packages guile-xyz)
(gnu packages pkg-config)
(gnu packages texinfo)
(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 (compiled-dir out version)
(string-append out "/lib/guile/"
version
"/site-ccache"))
(define (uncompiled-dir out version)
(string-append out
"/share/guile/site"
(if (string-null? version) ""
"/")
version))
(define (dep-path env modules path)
(list env ":"
'prefix
(cons modules
(map (λ (input)
(string-append input path))
(list #$guile-config
#$guile-ncurses
#$guile-ts)))))
(define bin (string-append #$output "/bin/"))
(define site (uncompiled-dir #$output ""))
(define version (caddr (scandir site)))
(wrap-program (string-append bin "sloth")
(dep-path
"GUILE_LOAD_PATH"
(uncompiled-dir #$output version)
(uncompiled-dir "" version))
(dep-path
"GUILE_LOAD_COMPILED_PATH"
(compiled-dir #$output version)
(compiled-dir "" version))))))))
(native-inputs (list autoconf
automake
guile-hall
pkg-config
texinfo))
(inputs (list guile-3.0))
(propagated-inputs (list guile-config
guile-ncurses
guile-ts))
(synopsis "Text editor based on tree-sitter")
(description
"TODO")
(home-page "https://git.solarpunk.moe/Sloth/sloth")
(license license:gpl3+))