From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jack Hill Subject: Re: Creating local variation of match-theme Date: Wed, 18 Dec 2019 17:01:11 -0500 (EST) Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:40784) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihhNb-0006A3-Vz for help-guix@gnu.org; Wed, 18 Dec 2019 17:01:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihhNZ-0006hF-RB for help-guix@gnu.org; Wed, 18 Dec 2019 17:01:15 -0500 Received: from minsky.hcoop.net ([104.248.1.95]:43522) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ihhNZ-0006g1-Nt for help-guix@gnu.org; Wed, 18 Dec 2019 17:01:13 -0500 Received: from marsh.hcoop.net ([45.55.52.66]) by minsky.hcoop.net with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1ihhNY-0000me-GO for help-guix@gnu.org; Wed, 18 Dec 2019 17:01:12 -0500 In-Reply-To: List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+gcggh-help-guix=m.gmane.org@gnu.org Sender: "Help-Guix" To: help-guix@gnu.org Hi, It's been a few days, so I was wondering if anyone had thoughts on the following: Best, Jack On Sun, 8 Dec 2019, Jack Hill wrote: > 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 (_ #(#(#(#(#(# ?) ?) ?) ?) ?)) > 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 > >