From patchwork Sun Mar 13 22:16:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "\\(" X-Patchwork-Id: 37784 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 3483E27BBEA; Sun, 13 Mar 2022 22:17:23 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id E48EE27BBE9 for ; Sun, 13 Mar 2022 22:17:22 +0000 (GMT) Received: from localhost ([::1]:50562 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nTWWg-0006kG-1J for patchwork@mira.cbaines.net; Sun, 13 Mar 2022 18:17:22 -0400 Received: from eggs.gnu.org ([209.51.188.92]:39258) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nTWWM-0006id-U5 for guix-patches@gnu.org; Sun, 13 Mar 2022 18:17:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:49609) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nTWWM-0001ru-LQ for guix-patches@gnu.org; Sun, 13 Mar 2022 18:17:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nTWWM-0008Ox-Cc for guix-patches@gnu.org; Sun, 13 Mar 2022 18:17:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#54357] [PATCH 1/4] gnu: kakoune: Clean up, and add a search path that makes it possible to package kak plugins in guix. References: <20220312210940.15397-1-paren@disroot.org> In-Reply-To: <20220312210940.15397-1-paren@disroot.org> Resent-From: "(unmatched-parenthesis" Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 13 Mar 2022 22:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54357 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 54357@debbugs.gnu.org Cc: "\(unmatched-parenthesis" Received: via spool by 54357-submit@debbugs.gnu.org id=B54357.164720978032182 (code B ref 54357); Sun, 13 Mar 2022 22:17:02 +0000 Received: (at 54357) by debbugs.gnu.org; 13 Mar 2022 22:16:20 +0000 Received: from localhost ([127.0.0.1]:43492 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nTWVg-0008Mz-II for submit@debbugs.gnu.org; Sun, 13 Mar 2022 18:16:20 -0400 Received: from knopi.disroot.org ([178.21.23.139]:49472) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nTWVe-0008Mp-CC for 54357@debbugs.gnu.org; Sun, 13 Mar 2022 18:16:19 -0400 Received: from localhost (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 84F89400B4; Sun, 13 Mar 2022 23:16:16 +0100 (CET) X-Virus-Scanned: SPAM Filter at disroot.org Received: from knopi.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Iq33NBdVNldh; Sun, 13 Mar 2022 23:16:15 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1647209775; bh=8rhHHU0T4dMPWgM9kazsRPokLQiZxZUkE8i6q2+nXhs=; h=From:To:Cc:Subject:Date; b=Kndc15rNqsvSVIf+PyHnngvPMwnRO5LurlWpt1kklIspeLkvxYGSbJORqPdDOIQ49 sjE0Z6qLGqSIOnpBP7O9wzBK5Ob8pVf2pOGC2lZj+PLuFEUMyf7C0Hciu/It6Kvlg2 cDi6mNE7j4JtUwKpxWM/ytW0TLrolynl3cwuF22UOk9boHoPBU+wno+8ci7tjIs+Ql o+F6pjWR1StcMjxEUUKJmIPzkQxebocgfEs2quHeMxSDOpJUfC7aqv2VwWYbFDMbWc rmXyw0rhZfNpPl+DbLXhA15mJMD6NxaDavbVqdaSnKobJh+goBh8wRg3ogKZD/iltG pTFz4WocXGBAw== Date: Sun, 13 Mar 2022 22:16:01 +0000 Message-Id: <20220313221604.7686-1-paren@disroot.org> 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" Reply-to: "\(unmatched-parenthesis" X-ACL-Warn: , "\(unmatched-parenthesis via Guix-patches" X-Patchwork-Original-From: "\(unmatched-parenthesis via Guix-patches" via From: "\\(" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/text-editors.scm(kakoune): Clean up package recipe, and add GUIX_KAKOUNE_DIRS search path. Argh! That for loop makes kak source the default kakrc twice! This rebased patch series fixes that. (I also added copy-build-system to use-modules so that we can install kak plugins properly, which was missing from my patch. I didn't notice it while I was doing `git add -p` :)) --- gnu/packages/text-editors.scm | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/gnu/packages/text-editors.scm b/gnu/packages/text-editors.scm index 45cc61765a..96e070807d 100644 --- a/gnu/packages/text-editors.scm +++ b/gnu/packages/text-editors.scm @@ -17,6 +17,7 @@ ;;; Copyright © 2021 Leo Famulari ;;; Copyright © 2021 Pierre Langlois ;;; Copyright © 2021 Calum Irwin +;;; Copyright © 2022 (unmatched parenthesis ;;; ;;; This file is part of GNU Guix. ;;; @@ -41,6 +42,7 @@ (define-module (gnu packages text-editors) #:use-module (guix utils) #:use-module (guix build-system cargo) #:use-module (guix build-system cmake) + #:use-module (guix build-system copy) #:use-module (guix build-system gnu) #:use-module (guix build-system glib-or-gtk) #:use-module (guix build-system python) @@ -187,14 +189,32 @@ (define-public kakoune (substitute* "src/shell_manager.cc" (("if \\(m_shell.empty\\(\\)\\)" line) (string-append "m_shell = \"" (which "sh") - "\";\n " line))) - #t)) + "\";\n " line))))) (delete 'configure) ; no configure script ;; kakoune requires us to be in the src/ directory to build. (add-before 'build 'chdir - (lambda _ (chdir "src") #t))))) + (lambda _ (chdir "src"))) + (add-before 'install 'patch-kakrc + (lambda _ + (chdir "..") + ;; here, we modify the default kakrc to source all the $pkg/share/kak/autoload/*.kak + ;; files automatically. + (substitute* "share/kak/kakrc" + (("if \\[ -d \"\\$\\{kak_config}/autoload\" \\]; then .* fi") + "\ +for dir in $(echo ${GUIX_KAKOUNE_CONFIG_DIRS} | sed 's/:/\\/autoload /g'); do + if [ -d ${dir} ]; then + autoload_directory ${dir} + fi +done"))))))) (native-inputs (list asciidoc pkg-config ruby)) + (native-search-paths + (list (search-path-specification + ;; kakoune only supports one config dir, so we use this instead, so that we can + ;; modify the default kakrc to source all the autoloads. + (variable "GUIX_KAKOUNE_CONFIG_DIRS") + (files '("share/kak/"))))) (synopsis "Vim-inspired code editor") (description "Kakoune is a code editor heavily inspired by Vim, as such most of its