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 21:17:40 -0500 (EST) Message-ID: References: <874kxxcm3z.fsf@devup.no> Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset=US-ASCII Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:35495) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihlNo-00015h-7c for help-guix@gnu.org; Wed, 18 Dec 2019 21:17:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihlNn-0007D6-46 for help-guix@gnu.org; Wed, 18 Dec 2019 21:17:44 -0500 Received: from minsky.hcoop.net ([104.248.1.95]:45052) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ihlNm-0007C6-Li for help-guix@gnu.org; Wed, 18 Dec 2019 21:17:42 -0500 In-Reply-To: <874kxxcm3z.fsf@devup.no> 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: Marius Bakke Cc: help-guix@gnu.org Thanks Marius! On Wed, 18 Dec 2019, Marius Bakke wrote: > It's not pretty, but you could create a package that takes "match-theme" > as an input and makes the necessary adjustments. > > See the 'mariadb/fixed-install-db' variant added in > 9077cf68ec57c0303ef7746e203c3fe5ed041add for an example. I tried this approach first, and find the results acceptable for this purpose. This technique seems most applicable when what needs to modified is a text file. I ended up with this package definition: ``` (package (inherit matcha-theme) (native-inputs '()) (inputs `(("matcha-theme" ,matcha-theme))) (outputs '("out")) (build-system trivial-build-system) (arguments `(#:modules ((guix build utils)) #:builder (begin (use-modules ((guix build utils))) (let ((upstream-theme (assoc-ref %build-inputs "matcha-theme")) (out (assoc-ref %outputs "out"))) (copy-recursively upstream-theme out) (substitute* (find-files out "\\.css$") (("abb9b6") "859900")))))) (synopsis "jackhill's version of the matcha-theme")) ``` > Another "cleaner" approach could be to use 'computed-file' to create a > patched source tarball, and pass that as the source in your local > variant. I have not yet tried this. I should because, as you point out, this is "cleaner", and would work in situations where what needs to be modified in compiled into an opaque object in the output. However, without trying this, I don't see how it would work better than using a snippet in the origin definition. Or perhaps you meant to created the patched source tarball from the output of the upstream matcha-theme package? Either way, I think I'm still left with the question of how can we make modifying packages easier without the need to resort to kludges. Best, Jack