Whitespace
This commit is contained in:
parent
6cbbb506e7
commit
e6422062f0
90
guix.scm
90
guix.scm
|
@ -1,49 +1,49 @@
|
|||
(use-modules (gnu packages)
|
||||
(gnu packages autotools)
|
||||
(gnu packages guile)
|
||||
(gnu packages guile-xyz)
|
||||
(gnu packages pkg-config)
|
||||
(gnu packages texinfo)
|
||||
(guix build-system gnu)
|
||||
(guix download)
|
||||
(guix gexp)
|
||||
((guix licenses) #:prefix license:)
|
||||
(guix packages)
|
||||
(srfi srfi-1))
|
||||
(gnu packages autotools)
|
||||
(gnu packages guile)
|
||||
(gnu packages guile-xyz)
|
||||
(gnu packages pkg-config)
|
||||
(gnu packages texinfo)
|
||||
(guix build-system gnu)
|
||||
(guix download)
|
||||
(guix gexp)
|
||||
((guix licenses) #:prefix license:)
|
||||
(guix packages)
|
||||
(srfi srfi-1))
|
||||
|
||||
(package
|
||||
(name "guile-termenv")
|
||||
(version "0.1")
|
||||
(source
|
||||
(local-file
|
||||
(dirname (current-filename))
|
||||
#:recursive? #t
|
||||
#:select? (lambda (file stat)
|
||||
(not (any (lambda (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
|
||||
(add-before 'bootstrap 'hall
|
||||
(lambda _
|
||||
(system* "hall" "build" "-x")))
|
||||
(replace 'bootstrap
|
||||
(lambda _
|
||||
(system* "autoreconf" "-vif"))))))
|
||||
(native-inputs (list autoconf
|
||||
automake
|
||||
guile-hall
|
||||
pkg-config
|
||||
texinfo))
|
||||
(inputs (list guile-3.0))
|
||||
(synopsis "Guile port of termenv")
|
||||
(description
|
||||
"A library to provide easy control of terminals from Guile using terminal control codes.")
|
||||
(home-page "https://git.solarpunk.moe/vv/guile-termenv")
|
||||
(license license:gpl3+))
|
||||
(name "guile-termenv")
|
||||
(version "0.1")
|
||||
(source
|
||||
(local-file
|
||||
(dirname (current-filename))
|
||||
#:recursive? #t
|
||||
#:select? (lambda (file stat)
|
||||
(not (any (lambda (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
|
||||
(add-before 'bootstrap 'hall
|
||||
(lambda _
|
||||
(system* "hall" "build" "-x")))
|
||||
(replace 'bootstrap
|
||||
(lambda _
|
||||
(system* "autoreconf" "-vif"))))))
|
||||
(native-inputs (list autoconf
|
||||
automake
|
||||
guile-hall
|
||||
pkg-config
|
||||
texinfo))
|
||||
(inputs (list guile-3.0))
|
||||
(synopsis "Guile port of termenv")
|
||||
(description
|
||||
"A library to provide easy control of terminals from Guile using terminal control codes.")
|
||||
(home-page "https://git.solarpunk.moe/vv/guile-termenv")
|
||||
(license license:gpl3+))
|
||||
|
||||
|
|
22
hall.scm
22
hall.scm
|
@ -18,27 +18,27 @@
|
|||
(licensing #f)))
|
||||
(files (libraries
|
||||
((directory "termenv"
|
||||
((scheme-file "style")
|
||||
(scheme-file "unix")
|
||||
(scheme-file "hyperlink")
|
||||
(scheme-file "screen")
|
||||
(scheme-file "color")
|
||||
(scheme-file "hconfig")))
|
||||
((scheme-file "style")
|
||||
(scheme-file "unix")
|
||||
(scheme-file "hyperlink")
|
||||
(scheme-file "screen")
|
||||
(scheme-file "color")
|
||||
(scheme-file "hconfig")))
|
||||
(scheme-file "termenv")))
|
||||
(tests ((directory "tests"
|
||||
((scheme-file "test-screen")
|
||||
(scheme-file "test-style")))))
|
||||
((scheme-file "test-screen")
|
||||
(scheme-file "test-style")))))
|
||||
(documentation
|
||||
((org-file "README")
|
||||
(symlink "README" "README.org")
|
||||
(text-file "HACKING")
|
||||
(text-file "COPYING")
|
||||
(directory "doc"
|
||||
((texi-file "guile-termenv")))))
|
||||
((texi-file "guile-termenv")))))
|
||||
(programs ())
|
||||
(infrastructure
|
||||
((scheme-file "guix")
|
||||
(text-file ".gitignore")
|
||||
(scheme-file "hall")
|
||||
(directory "tests"
|
||||
((scheme-file "utils")))))))
|
||||
(directory "tests"
|
||||
((scheme-file "utils")))))))
|
||||
|
|
|
@ -309,30 +309,30 @@
|
|||
(define trimmed
|
||||
(cond
|
||||
((and (or (= strlen 4)
|
||||
(= strlen 7))
|
||||
(char=? (string-ref hex 0) #\#))
|
||||
(= strlen 7))
|
||||
(char=? (string-ref hex 0) #\#))
|
||||
(substring/copy hex 1))
|
||||
((and (or (= strlen 5)
|
||||
(= strlen 8))
|
||||
(char=? (string-ref hex 1) #\x))
|
||||
(= strlen 8))
|
||||
(char=? (string-ref hex 1) #\x))
|
||||
(substring/copy hex 2))
|
||||
((or (= strlen 3)
|
||||
(= strlen 6))
|
||||
(= strlen 6))
|
||||
hex)
|
||||
(else (error "Invalid hex string: incorrect length"))))
|
||||
(define width (if (= (string-length trimmed) 3) 1 2))
|
||||
|
||||
(define r (locale-string->integer
|
||||
(substring/copy trimmed 0 width) 16))
|
||||
(substring/copy trimmed 0 width) 16))
|
||||
(define g (locale-string->integer
|
||||
(substring/copy trimmed width (* 2 width)) 16))
|
||||
(substring/copy trimmed width (* 2 width)) 16))
|
||||
(define b (locale-string->integer
|
||||
(substring/copy trimmed (* 2 width) (* 3 width)) 16))
|
||||
(substring/copy trimmed (* 2 width) (* 3 width)) 16))
|
||||
|
||||
(when (= width 1)
|
||||
(let ((double-hex
|
||||
(lambda (v)
|
||||
(+ (* v #XF) v))))
|
||||
(lambda (v)
|
||||
(+ (* v #XF) v))))
|
||||
(set! r (double-hex r))
|
||||
(set! g (double-hex g))
|
||||
(set! b (double-hex b))))
|
||||
|
|
|
@ -4,14 +4,14 @@
|
|||
(srfi srfi-26)
|
||||
#:export
|
||||
(%version
|
||||
%author
|
||||
%license
|
||||
%copyright
|
||||
%gettext-domain
|
||||
G_
|
||||
N_
|
||||
init-nls
|
||||
init-locale))
|
||||
%author
|
||||
%license
|
||||
%copyright
|
||||
%gettext-domain
|
||||
G_
|
||||
N_
|
||||
init-nls
|
||||
init-locale))
|
||||
|
||||
(define %version "0.1")
|
||||
|
||||
|
|
Loading…
Reference in New Issue