4 Ebuild Transformers
4.1 GitHost
(require ebuild/transformers/githost) | |
package: ebuild-transformers |
struct
(struct githost (domain repository) #:extra-constructor-name make-githost) domain : string? repository : string?
> (githost "gitlab.com" "asd/asd") (githost "gitlab.com" "asd/asd")
procedure
(url->githost ur) → githost?
ur : url?
> (url->githost (string->url "https://gitlab.com/asd/asd")) (githost "gitlab.com" "asd/asd")
procedure
(string->githost str) → githost?
str : string?
> (string->githost "https://gitlab.com/asd/asd.git") (githost "gitlab.com" "asd/asd")
procedure
(githost->string gh) → string?
gh : githost?
> (githost->string (githost "gitlab.com" "asd/asd")) "https://gitlab.com/asd/asd"
procedure
(githost->url gh) → url?
gh : githost?
> (githost->url (githost "gitlab.com" "asd/asd"))
(url
"https"
#f
"gitlab.com"
#f
#t
(list (path/param "asd" '()) (path/param "asd" '()))
'()
#f)
4.2 SRC_URI Transformers
(require ebuild/transformers/src-uri) | |
package: ebuild-transformers |
procedure
(url->src-uri ur pn) → src-uri
ur : path-string? pn : string?
If pn is supplied also a PN (package name) detection is carried out.
> (define racket-url "https://mirror.racket-lang.org/installers/8.1/racket-8.1-src-builtpkgs.tgz") > (define racket-src-uri (url->src-uri racket-url "racket")) > racket-src-uri
(src-uri
#f
"https://mirror.${PN}-lang.org/installers/8.1/${PN}-8.1-src-builtpkgs.tgz"
#f)
> (src-uri->string racket-src-uri) "https://mirror.${PN}-lang.org/installers/8.1/${PN}-8.1-src-builtpkgs.tgz"
4.3 CFlag Transformers
(require ebuild/transformers/cflag) | |
package: ebuild-transformers |
> (string->cflag "X? ( x11-libs/libX11 ) qt5? ( dev-qt/qtsvg dev-qt/qtwidgets )")
(list
(cflag "X?" '("x11-libs/libX11"))
(cflag "qt5?" '("dev-qt/qtsvg" "dev-qt/qtwidgets")))
4.4 Metadata Transformers
(require ebuild/transformers/metadata) | |
package: ebuild-transformers |
4.4.1 longdescription transformation
procedure
(xexpr->longdescriptions xexpr) → (listof longdescription?)
xexpr : xexpr?
> (xexpr->longdescriptions '(pkgmetadata (longdescription ((lang "en")) "Description") (longdescription ((lang "pl")) "Opis"))) (list (longdescription "en" "Description") (longdescription "pl" "Opis"))
4.4.2 maintainer transformation
procedure
(xexpr->maintainers xexpr) → (listof maintainer?)
xexpr : xexpr?
> (xexpr->maintainers '(pkgmetadata (maintainer ((type "person")) (email "asd@asd.asd") (name "A.S.D.")))) (list (maintainer 'person #f "asd@asd.asd" "A.S.D." #f))
4.4.3 slots transformation
procedure
(xexpr->slots xexpr) → (listof slots?)
xexpr : xexpr?
> (xexpr->slots '(pkgmetadata (slots (slot ((name "1.9")) "Provides libmypkg19.so.0")))) (list (slots #f (list (slot "1.9" "Provides libmypkg19.so.0")) #f))
4.4.4 stabilize-allarches transformation
procedure
(xexpr->stabilize-allarches xexpr) → boolean?
xexpr : xexpr?
> (xexpr->stabilize-allarches '(pkgmetadata (stabilize-allarches ()))) #t
4.4.5 upstream transformation
procedure
(xexpr->upstream xexpr) → upstream?
xexpr : xexpr?
> (xexpr->upstream '(pkgmetadata (upstream (remote-id ((type "gitlab")) "asd/asd") (remote-id ((type "github")) "asd-org/asd"))))
(upstream
'()
#f
#f
#f
(list (remote-id 'gitlab "asd/asd") (remote-id 'github "asd-org/asd")))
4.4.6 use transformation
procedure
(xexpr->uses xexpr) → (listof use?)
xexpr : xexpr?
> (xexpr->uses '(pkgmetadata (use (flag ((name "racket")) "Build using dev-scheme/racket")))) (list (use #f (list (uflag "racket" "Build using dev-scheme/racket"))))
4.4.7 metadata transformation
procedure
(xexpr->metadata xexpr) → metadata%
xexpr : xexpr?
> (xexpr->metadata '(pkgmetadata))
(document
(prolog
'(#(struct:p-i
#(struct:location 0 0 0)
#(struct:location 0 0 0)
xml
"version=\"1.0\" encoding=\"UTF-8\""))
(document-type
'pkgmetadata
(external-dtd/system "https://www.gentoo.org/dtd/metadata.dtd")
#f)
'())
(element 'racket 'racket 'pkgmetadata '() '())
'())
procedure
(read-metadata [port]) → metadata%
port : input-port? = current-input-port
> {define str "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE pkgmetadata SYSTEM \"https://www.gentoo.org/dtd/metadata.dtd\">\n<pkgmetadata>\n</pkgmetadata>"} > (display (read-metadata (open-input-string str)))
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
</pkgmetadata>
procedure
(read-metadata-file pth) → metadata%
pth : path-string?
4.5 UnCache
(require ebuild/transformers/uncache) | |
package: ebuild-transformers |
procedure
port : input-port?
Certain to be missed are any additional shell script functions because cached ebuild files contain only special ebuild variables.
procedure
(uncache-file pth) → ebuild%
pth : path-string?