From: Jack Hill <jackhill@jackhill.us>
To: help-guix@gnu.org
Subject: Creating local variation of match-theme
Date: Sun, 8 Dec 2019 11:53:35 -0500 (EST) [thread overview]
Message-ID: <alpine.DEB.2.20.1912081123360.11560@marsh.hcoop.net> (raw)
Hi Guix,
I'd like to create a local variation of the matcha-theme package with one
of the colors changed to suit my taste. Rather than make the change in my
clone of the git repository, which could then become outdated, I thought I
would try to make the change programatically as part of the package
definition. I decided to make my change in a snippet as part of the origin
specification because that seemed to logically fit with what I was trying
to do (build a package with modified source) and because matcha-theme uses
the trivial build system, which I don't believe has the concept of phases,
so it wasn't clear how I would add a phase to make my change during the
build. I came up with the following package definition:
```
(package
(inherit matcha-theme)
(source (origin
(inherit (package-source matcha-theme))
(modules '((guix build utils)))
(snippet
'(begin
(substitute* (find-files "." "\\.css$")
(("abb9b6") "859900"))))))
(synopsis "jackhill's version of the matcha-theme"))
```
Unfortunately, after building my modified source tarball correctly, the
package build fails. I believe this is because matcha-theme's
trivial-build-system recipe expects a source checkout and not a tarball,
and doesn't have the logic to expand the tarball that, e.g., the
gnu-build-system provides.
The build log contains the following:
```
@ build-started /gnu/store/rqx5yqh4ncj02rxzfwvp9jcqv9dk8l1g-matcha-theme-2019-11-02.drv - x86_64-linux /var/log/guix/drvs/rq//x5yqh4ncj02rxzfwvp9jcqv9dk8l1g-matcha-theme-2019-11-02.drv.bz2 28285
Backtrace:
4 (primitive-load "/gnu/store/j01a49zzlrn7fyr2x7ibxyqsph5?")
In ice-9/eval.scm:
191:35 3 (_ #f)
619:8 2 (_ #(#(#(#(#(#<directory (guile-user) 7f?> ?) ?) ?) ?) ?))
In /gnu/store/ygivy1fvr7gbyva4z22b7vzzps1krbq5-module-import/guix/build/utils.scm:
343:27 1 (_ "/gnu/store/ajbvkiw30mmfhj8mpjfyvnxpjl0ycj07-matcha?" ?)
In unknown file:
0 (copy-file "/gnu/store/ajbvkiw30mmfhj8mpjfyvnxpjl0ycj0?" ?)
ERROR: In procedure copy-file:
In procedure copy-file: Is a directory
`/gnu/store/ajbvkiw30mmfhj8mpjfyvnxpjl0ycj07-matcha-theme-2019-11-02.tar.xz' -> `/tmp/guix-build-matcha-theme-2019-11-02.drv-0'
builder for `/gnu/store/rqx5yqh4ncj02rxzfwvp9jcqv9dk8l1g-matcha-theme-2019-11-02.drv' failed with exit code 1
@ build-failed /gnu/store/rqx5yqh4ncj02rxzfwvp9jcqv9dk8l1g-matcha-theme-2019-11-02.drv - 1 builder for `/gnu/store/rqx5yqh4ncj02rxzfwvp9jcqv9dk8l1g-matcha-theme-2019-11-02.drv' failed with exit code 1
```
For reference, matcha-theme's builder is:
```
(arguments
'(#:modules ((guix build utils))
#:builder
(begin
(use-modules (guix build utils))
(let* ((out (assoc-ref %outputs "out"))
(source (assoc-ref %build-inputs "source"))
(bash (assoc-ref %build-inputs "bash"))
(coreutils (assoc-ref %build-inputs "coreutils"))
(themesdir (string-append out "/share/themes")))
(setenv "PATH"
(string-append coreutils "/bin:"
(string-append bash "/bin:")))
(copy-recursively source (getcwd))
(patch-shebang "Install")
(mkdir-p themesdir)
(invoke "./Install" "-d" themesdir)
#t))))
```
This leaves me with two questions:
How should I accomplish what I want to do (change one of the colors in
matcha-theme for local use)?
If I am right about trivial-build-system (that it makes it more difficult
to create modified packages compared to other build systems), should we
try to avoid using it in gnu/packages to ensure people have the easiest
time exercising their software freedom?
Best,
Jack
next reply other threads:[~2019-12-08 16:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-08 16:53 Jack Hill [this message]
2019-12-18 22:01 ` Creating local variation of match-theme Jack Hill
2019-12-18 22:20 ` Marius Bakke
2019-12-19 2:17 ` Jack Hill
2019-12-26 17:11 ` Marius Bakke
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.DEB.2.20.1912081123360.11560@marsh.hcoop.net \
--to=jackhill@jackhill.us \
--cc=help-guix@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).