From patchwork Fri Aug 27 06:52:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Tropin X-Patchwork-Id: 32329 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 00ACC27BBE3; Fri, 27 Aug 2021 07:54:19 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,T_DKIM_INVALID, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 7843927BBE1 for ; Fri, 27 Aug 2021 07:54:19 +0100 (BST) Received: from localhost ([::1]:34428 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mJVko-0002FV-IC for patchwork@mira.cbaines.net; Fri, 27 Aug 2021 02:54:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48580) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mJVja-0000UA-KB for guix-patches@gnu.org; Fri, 27 Aug 2021 02:53:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:39598) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mJVja-000137-B7 for guix-patches@gnu.org; Fri, 27 Aug 2021 02:53:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mJVja-0004mJ-A0 for guix-patches@gnu.org; Fri, 27 Aug 2021 02:53:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#50208] [PATCH 1/5] home-services: Add fontutils. Resent-From: Andrew Tropin Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 27 Aug 2021 06:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50208 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Oleg Pykhalov Cc: 50208@debbugs.gnu.org Received: via spool by 50208-submit@debbugs.gnu.org id=B50208.163004713718312 (code B ref 50208); Fri, 27 Aug 2021 06:53:02 +0000 Received: (at 50208) by debbugs.gnu.org; 27 Aug 2021 06:52:17 +0000 Received: from localhost ([127.0.0.1]:51144 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mJVir-0004lI-Dc for submit@debbugs.gnu.org; Fri, 27 Aug 2021 02:52:17 -0400 Received: from mail-lf1-f53.google.com ([209.85.167.53]:39677) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mJVio-0004l5-CZ for 50208@debbugs.gnu.org; Fri, 27 Aug 2021 02:52:15 -0400 Received: by mail-lf1-f53.google.com with SMTP id m28so12291704lfj.6 for <50208@debbugs.gnu.org>; Thu, 26 Aug 2021 23:52:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trop-in.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=eLyXhxJPmm/YYN4NQ4JRserX+J1vPnUR9sNXJxtgNN0=; b=YBuj/+m+A6fB1rvDENIGjOnqCpZ4caJPtQnB8malo3DJQLEamQvFPjK3jdrUPDM2nv l3xKgefB8M5trrRDuQ9D9x96Cem2FhD64YbteMhpsvHX9G/s7lnMmOhELrUraYSStXyb KBLNPlBCMqsjylsLp4IxJ8RXopfz3+tEa9M65J9YnWz1TcNhefmSdznSLNMszXnE+xQr k02IJxUbtDuQU8OaBNGCoYgMi1FftucElwhlwdfYQlqGMTAUY0So28xlW9102G2SrWRX yxMeRvTlxuT6/iaRWe1ZmkKDOhMFn3wdTtnsbg8mtmGdCW1zmR3OQr9kcGxdAAdrFhq3 07Iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=eLyXhxJPmm/YYN4NQ4JRserX+J1vPnUR9sNXJxtgNN0=; b=UUT4CLtXsEtKHJaSNZCVUGIupaHRNGw6g1N4etH/FL3+v/gHj52yVihIZmJ3ZPlcPN ORp2KM0gL2CB2krgoHfowZ+M3PME/Q4V3J45+xctVp/ejWXlU7dESoAoYrJNOtVU+Swe 4oqYKWaGQ3FG7rToWQbwIzvM1zbZZ6Toepz8UT/Vuem3cnsD0rNMBvdtUYd4NzQjspZ5 HQfC4wp0Wx5WEBi2GhE5L+l3QYTAupIZJD8IQidBC4GRgLylEEgtf1NlJbJS7QGbDliu VKE4Rz1OM2B67mzldGniIUGmSxTYwjjHSsNKFPtI534jskaaP6ssImOAqLQ1w5xdG4gz ArDA== X-Gm-Message-State: AOAM530BZbg60ZcB1p09nkuroisB3g1bXroGgLJXSDaKn1vxC6OO6QgP m0v8+hVNM+5bVcG8p4BEkl4+VbvN73L57A== X-Google-Smtp-Source: ABdhPJy8UbnMnLew2N+wZJoi0fzQL7QRlQiMbpvKtAw1KLjV/O7C+vKrXbbPmjQgK/G3QI9K6sSrkQ== X-Received: by 2002:ac2:51dd:: with SMTP id u29mr5482790lfm.171.1630047128281; Thu, 26 Aug 2021 23:52:08 -0700 (PDT) Received: from localhost (109-252-93-92.nat.spd-mgts.ru. [109.252.93.92]) by smtp.gmail.com with ESMTPSA id k35sm507496lfv.227.2021.08.26.23.52.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Aug 2021 23:52:07 -0700 (PDT) From: Andrew Tropin In-Reply-To: <871r6ffklu.fsf@trop.in> References: <87bl5kbsk8.fsf@trop.in> <87r1eg8obm.fsf@gmail.com> <871r6ffklu.fsf@trop.in> Date: Fri, 27 Aug 2021 09:52:04 +0300 Message-ID: <87y28ne5wr.fsf@trop.in> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/home-services/fontutils.scm (home-fontconfig-service-type): New variable. * gnu/local.mk (GNU_SYSTEM_MODULES): Add home-services/fontutils.scm. --- gnu/home-services/fontutils.scm | 65 +++++++++++++++++++++++++++++++++ gnu/local.mk | 1 + 2 files changed, 66 insertions(+) create mode 100644 gnu/home-services/fontutils.scm diff --git a/gnu/home-services/fontutils.scm b/gnu/home-services/fontutils.scm new file mode 100644 index 0000000000..28bfc3d3f7 --- /dev/null +++ b/gnu/home-services/fontutils.scm @@ -0,0 +1,65 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2021 Andrew Tropin +;;; Copyright © 2021 Xinglu Chen +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu home-services fontutils) + #:use-module (gnu home-services) + #:use-module (gnu packages fontutils) + #:use-module (guix gexp) + + #:export (home-fontconfig-service-type)) + +;;; Commentary: +;;; +;;; Services related to fonts. home-fontconfig service provides +;;; fontconfig configuration, which allows fc-* utilities to find +;;; fonts in Guix Home's profile and regenerates font cache on +;;; activation. +;;; +;;; Code: + +(define (add-fontconfig-config-file he-symlink-path) + `(("config/fontconfig/fonts.conf" + ,(mixed-text-file + "fonts.conf" + " + + + ~/.guix-home/profile/share/fonts +")))) + +(define (regenerate-font-cache-gexp _) + `(("profile/share/fonts" + ,#~(system* #$(file-append fontconfig "/bin/fc-cache") "-fv")))) + +(define home-fontconfig-service-type + (service-type (name 'home-fontconfig) + (extensions + (list (service-extension + home-files-service-type + add-fontconfig-config-file) + (service-extension + home-run-on-change-service-type + regenerate-font-cache-gexp) + (service-extension + home-profile-service-type + (const (list fontconfig))))) + (default-value #f) + (description + "Provides configuration file for fontconfig and make +fc-* utilities aware of font packages installed in Guix Home's profile."))) diff --git a/gnu/local.mk b/gnu/local.mk index 91c3b0da3d..e25ff3db53 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -74,6 +74,7 @@ GNU_SYSTEM_MODULES = \ %D%/ci.scm \ %D%/home-services.scm \ %D%/home-services/symlink-manager.scm \ + %D%/home-services/fontutils.scm \ %D%/image.scm \ %D%/packages.scm \ %D%/packages/abduco.scm \