Update, reindent infrastructure files

* guix.scm: Define guile-ts-next to use newer commit "correctly"
* manifest.scm: Define guile-hall-next to use newer commit "correctly"
This commit is contained in:
Juliana Rat 2023-11-05 18:45:51 -05:00
parent 5ab58f9248
commit b27cfd7bc3
2 changed files with 204 additions and 244 deletions

342
guix.scm
View file

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

View file

@ -5,86 +5,36 @@
;; Usage: guix shell -[CNW]m manifest.scm ;; Usage: guix shell -[CNW]m manifest.scm
(use-modules (gnu packages autotools) (use-modules (gnu packages autotools)
(gnu packages base) (gnu packages base)
(gnu packages guile) (gnu packages guile)
(gnu packages guile-xyz) (gnu packages guile-xyz)
(gnu packages pkg-config) (gnu packages pkg-config)
(gnu packages readline) (gnu packages readline)
(gnu packages texinfo) (gnu packages texinfo)
(gnu packages version-control) (gnu packages version-control)
(guix build-system gnu) (guix build-system gnu)
(guix git-download) (guix git-download)
((guix licenses) ((guix licenses)
#:prefix license:) #:prefix license:)
(guix packages)) (guix packages))
(define guile-hall-next (define guile-hall-next
(package (let ((commit "9ca0c3e"))
(name "guile-hall") (package
(version "0.4.1-next") (inherit guile-hall)
(source (source
(origin (origin
(method git-fetch) (method git-fetch)
(uri (git-reference (uri (git-reference
(url "https://gitlab.com/a-sassmannshausen/guile-hall") (url "https://gitlab.com/a-sassmannshausen/guile-hall")
(commit "9ca0c3e"))) (commit commit)))
(file-name (git-file-name name version)) (file-name (git-file-name (package-name guile-hall) commit))
(sha256 (sha256
(base32 "0fi7isi5wq6awssk08zj4scifrb9g1g1027id5j87awb29q22jlj")))) (base32 "0fi7isi5wq6awssk08zj4scifrb9g1g1027id5j87awb29q22jlj")))))))
(build-system gnu-build-system)
(arguments
(list #:phases
#~(modify-phases %standard-phases
(add-after 'install 'hall-wrap-binaries
(lambda _
(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 (lambda (input)
(string-append input path))
(list #$guile-config)))))
(define bin (string-append #$output "/bin/"))
(define site (uncompiled-dir #$output ""))
(define version (caddr (scandir site)))
(wrap-program (string-append bin "hall")
(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
pkg-config
texinfo))
(inputs (list guile-3.0))
(propagated-inputs (list guile-config))
(synopsis "Guile project tooling")
(description
"Hall is a command-line application and a set of Guile libraries that
allow you to quickly create and publish Guile projects. It allows you to
transparently support the GNU build system, manage a project hierarchy &
provides tight coupling to Guix.")
(home-page "https://gitlab.com/a-sassmannshausen/guile-hall")
(license license:gpl3+)))
(packages->manifest (packages->manifest
(list coreutils (list coreutils
git git
guile-3.0 guile-3.0
guile-hall-next guile-hall-next
guile-readline)) guile-readline))