From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:54527) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j7Gmu-0000d6-2B for guix-patches@gnu.org; Thu, 27 Feb 2020 05:53:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j7Gms-0003mG-V0 for guix-patches@gnu.org; Thu, 27 Feb 2020 05:53:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:52793) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j7Gms-0003m2-SX for guix-patches@gnu.org; Thu, 27 Feb 2020 05:53:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1j7Gms-0001NC-SC for guix-patches@gnu.org; Thu, 27 Feb 2020 05:53:02 -0500 Subject: [bug#39717] [PATCH 1/3] gnu: delft-icon-theme: Use the copy-build-system. Resent-Message-ID: Message-ID: <755600da3a603ae885693218b14ee538f2d8295a.camel@student.tugraz.at> From: Leo Prikler Date: Thu, 27 Feb 2020 11:52:50 +0100 In-Reply-To: <87mu9472ai.fsf@ambrevar.xyz> References: <20200221163215.11008-1-leo.prikler@student.tugraz.at> <87mu9472ai.fsf@ambrevar.xyz> Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Pierre Neidhardt Cc: 39717@debbugs.gnu.org Am Donnerstag, den 27.02.2020, 11:27 +0100 schrieb Pierre Neidhardt: > Thanks for the patch! > Comments below: > > > (arguments > > - `(#:modules ((guix build utils)) > > - #:builder > > - (begin > > - (use-modules (guix build utils)) > > - (copy-recursively (assoc-ref %build-inputs "source") > > "icons") > > - (substitute* "icons/Delft/index.theme" > > - (("gnome") "Adwaita")) > > - (delete-file "icons/README.md") > > - (delete-file "icons/LICENSE") > > - (delete-file "icons/logo.jpg") > > - (copy-recursively "icons" (string-append %output > > "/share/icons"))))) > > + `(#:install-plan > > + '(,@(append-map (lambda (file) > > + `((,file "share/icons/") > > + (,(string-append file "-Dark") > > "share/icons/") > > + (,(string-append file "-Darker") > > "share/icons/") > > + (,(string-append file "-Darkest") > > "share/icons/"))) > > + '("Delft" "Delft-Amber" "Delft-Aqua" > > "Delft-Blue" > > + "Delft-Gray" "Delft-Green" "Delft-Mint" > > "Delft-Purple" > > + "Delft-Red" "Delft-Teal"))))) > > Interesting use of install-plan, but wouldn't it be to copy > everything > and simply exclude the previous delete files? E.g. (untested): > > #:install-plan > `(("." "./" #:exclude ("README.md" "LICENSE" "logo.jpg"))) It would indeed be nice if it worked that way. However, Delft makes heavy use of symbolic links, of which some are even dead, and that causes install-file to fail. I tried patching copy-build-system, but the result was not usable, probably because symlinks were not resolved correctly. On top of that, I don't think putting that much more work into copy-build-system is a good idea. copy-build-system should be a simple build-system that just copies stuff. Perhaps we can swallow the "file does not exist" errors, but even that seems kinda wrong to me. Anyways, since the original used copy-recursively, the only thing I had to do was to make copy-build-system resort to copy-recursively as well, hence this interesting use of install-plan. Alternatively, one could delete the files in a pre-install phase, but that seems even weirder to me. Regards, Leo