From patchwork Thu Jan 10 18:28:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tim Gesthuizen X-Patchwork-Id: 714 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 5C25716A54; Thu, 10 Jan 2019 18:29:09 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 9A09B169F8 for ; Thu, 10 Jan 2019 18:29:08 +0000 (GMT) Received: from localhost ([127.0.0.1]:45380 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ghf4l-0000EL-US for patchwork@mira.cbaines.net; Thu, 10 Jan 2019 13:29:07 -0500 Received: from eggs.gnu.org ([209.51.188.92]:46239) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ghf4i-0000EG-Iw for guix-patches@gnu.org; Thu, 10 Jan 2019 13:29:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ghf4g-0001SM-4a for guix-patches@gnu.org; Thu, 10 Jan 2019 13:29:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:54892) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ghf4f-0001S4-Sk for guix-patches@gnu.org; Thu, 10 Jan 2019 13:29:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ghf4f-0007of-MF for guix-patches@gnu.org; Thu, 10 Jan 2019 13:29:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#33598] Optimizations for emacs-clang-format and emacs-clang-rename Resent-From: Tim Gesthuizen Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 10 Jan 2019 18:29:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33598 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: Pierre Neidhardt , Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 33598-submit@debbugs.gnu.org id=B33598.154714491230010 (code B ref 33598); Thu, 10 Jan 2019 18:29:01 +0000 Received: (at 33598) by debbugs.gnu.org; 10 Jan 2019 18:28:32 +0000 Received: from localhost ([127.0.0.1]:54173 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ghf4B-0007ny-TT for submit@debbugs.gnu.org; Thu, 10 Jan 2019 13:28:32 -0500 Received: from sonic312-27.consmr.mail.ir2.yahoo.com ([77.238.178.98]:34112) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ghf48-0007ni-NU for 33598@debbugs.gnu.org; Thu, 10 Jan 2019 13:28:30 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.de; s=s2048; t=1547144902; bh=dK8x+9d6T5f89ifHUDvELik7frr2/eqyEVPqBYQz9I4=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From:Subject; b=OnJgLFEdUItzoXFoU4sF95TsNy3NzZneMFDHiu6kMQVLios9S4yLQMj3bSxy+pPeFmzpRy/X0CdgpJXWOMlhJoCcJwUoUNHWBLH3acaYX87Cx5IC1m048I1+t4HdvAr4uC5vxcbSiTj1qDxHKIkhJo3iYFvQWjEPuQVs3wksDizWyyw8slB7YCGlhthA/YBstGbqSnYeyCWT3uxXLztPAiqEJ3rSqvBAcHn4ZshcG4/oHHLFVAI0m7EInmAku8T/iJcpv4ygyJJy51OxN0ajlfExZHovJ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k9V12VboQHTuTqmG744y3VNMSKVE4I8wLq8epC_lRFqvO5cKJ5 DxBpLmC2FM1KHDzPCCOwqLLV1W6y2SyxzIwFJjuJ3onF.y6hTDerD5p705RzlnIJetdAtP66L5RF uk.y9iZZcl_g74gI- Received: from sonic.gate.mail.ne1.yahoo.com by sonic312.consmr.mail.ir2.yahoo.com with HTTP; Thu, 10 Jan 2019 18:28:22 +0000 Received: from p5B221453.dip0.t-ipconnect.de (EHLO [192.168.178.27]) ([91.34.20.83]) by smtp425.mail.ir2.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 5bd3ea88f447d5ba83e91b3a0f58baab; Thu, 10 Jan 2019 18:28:19 +0000 (UTC) References: <871s6l9h54.fsf@gnu.org> <87r2ekea1u.fsf@ambrevar.xyz> <04daca2a-705d-6255-85bd-48132879f5a8@yahoo.de> <87lg4se6wf.fsf@ambrevar.xyz> <8d15b1a4-5f0b-28aa-a3d9-78520431b8ef@yahoo.de> <87imzwe2d3.fsf@ambrevar.xyz> <2df7cbf3-81d5-7d50-35d7-f3b369d1ac0e@yahoo.de> <87ftuth0d7.fsf@ambrevar.xyz> <14de0933-fddc-94d0-d75a-cdf4b49fce1a@yahoo.de> <87wonhipbw.fsf@ambrevar.xyz> <792d34a0-b048-b84f-b7b8-d9d996da2a28@yahoo.de> <878szwinp0.fsf@ambrevar.xyz> <877efgin3x.fsf@ambrevar.xyz> <875zv0imr7.fsf@ambrevar.xyz> <87k1jgce5s.fsf@gnu.org> <878szw6rot.fsf@ambrevar.xyz> <874laj35n6.fsf@gnu.org> <87wonf5yd7.fsf@ambrevar.xyz> <87k1jfzd8x.fsf@gnu.org> <87va2z5us6.fsf@ambrevar.xyz> From: Tim Gesthuizen Openpgp: preference=signencrypt Autocrypt: addr=tim.gesthuizen@yahoo.de; prefer-encrypt=mutual; keydata= mQENBFrE7N0BCAC7s3lBzEf8MPAiqYjlD8Z/9TrwMEy2gLZifF3wTgIFVSOujb5gcceS3I64 qur9lCPJycxzl9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sl8BKAzl16zuoo9q32Fa/L+7S+6RStY5gaBoISlQUXRrdQBuoPO72BRG3xxRpYfHQiHcKsw8 CCqlINcAEQEAAYkBPAQYAQgAJhYhBClIgufvAUShK4uX2tLlj2mu+xnVBQJaxOzdAhsMBQkD wmcAAAoJENLlj2mu+xnV+9QH/1/VcoiqpSJReuMyDAMcYHOrXhKnMLR/rDxTYn4oBNrGDXh+ vMbMJtxHpaNiFrzkd+QOWc0MU15cJRqCx2hSZNfJDaPEoHSwUs++gFSqaIkS/dLQ0LTL/DBp jKsed8FfV8Ubv/M0AoD8cixAmJLnxlt3G1gLBBkAlv0F53bIdAGJMBJZsZ+1HmzFazknGIR0 LgHZ28PK/QWPwE5gRkIzwTD+hrKJjGcBMach2ZbcAvo47rrRYW1ukbN6L1L5mvTSCh2Gitgp ewig0IiavSVkL3uWpPvAqmr9N9zk/qrHk1EgV+hzNriJhUitpMgrgZQfHYRm4LIhsmJm9TOT N3SWwT0= Message-ID: Date: Thu, 10 Jan 2019 19:28:16 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <87va2z5us6.fsf@ambrevar.xyz> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 33598@debbugs.gnu.org Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches Hi, I implemented the changes we discussed so we can finally close this ticket. Patches are attached. Tim. From 939547e6e2c0f5a83eb1290ff1c9ee39415ce3d5 Mon Sep 17 00:00:00 2001 From: Tim Gesthuizen Date: Fri, 4 Jan 2019 22:34:56 +0100 Subject: [PATCH 2/2] gnu: Use package-elisp-from-package for clangs emacs lisp files Use package-elisp-from-package for emacs-clang-format and emacs-clang-rename. Also remove package-from-clang-elisp-file as it is not needed anymore. * gnu/packages/llvm.scm (emacs-clang-format): Use package-elisp-from-package * gnu/packages/llvm.scm (emacs-clang-rename): Use package-elisp-from-package * gnu/packages/llvm.scm (package-from-clang-elisp-file): Remove function --- gnu/packages/llvm.scm | 63 +++++++++++++++++++++---------------------- 1 file changed, 31 insertions(+), 32 deletions(-) diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm index 5518d4d5c..dedad7dc7 100644 --- a/gnu/packages/llvm.scm +++ b/gnu/packages/llvm.scm @@ -39,6 +39,7 @@ #:use-module (gnu packages gcc) #:use-module (gnu packages bootstrap) ;glibc-dynamic-linker #:use-module (gnu packages compression) + #:use-module (gnu packages emacs) #:use-module (gnu packages libffi) #:use-module (gnu packages perl) #:use-module (gnu packages python) @@ -540,22 +541,21 @@ the files SOURCE-FILES from the source in its root directory." (define-public emacs-clang-format (package - (inherit clang) - (name "emacs-clang-format") - (build-system emacs-build-system) - (inputs - `(("clang" ,clang))) - (arguments - `(#:phases - (modify-phases %standard-phases - (add-after 'unpack 'configure - (lambda* (#:key inputs #:allow-other-keys) - (let ((clang (assoc-ref inputs "clang"))) - (copy-file "tools/clang-format/clang-format.el" "clang-format.el") - (emacs-substitute-variables "clang-format.el" - ("clang-format-executable" - (string-append clang "/bin/clang-format")))) - #t))))) + (inherit (package-elisp-from-package + clang + "emacs-clang-format" + '("tools/clang-format/clang-format.el"))) + (inputs `(("clang" ,clang))) + (arguments `(#:phases + (modify-phases %standard-phases + (add-after 'unpack 'configure + (lambda* (#:key inputs #:allow-other-keys) + (chmod "clang-format.el" #o644) + (emacs-substitute-variables "clang-format.el" + ("clang-format-executable" + (string-append (assoc-ref inputs "clang") + "/bin/clang-format"))) + #t))))) (synopsis "Format code using clang-format") (description "This package allows to filter code through @code{clang-format} to fix its formatting. @code{clang-format} is a tool that formats @@ -564,22 +564,21 @@ C/C++/Obj-C code according to a set of style options, see (define-public emacs-clang-rename (package - (inherit clang) - (name "emacs-clang-rename") - (build-system emacs-build-system) - (inputs - `(("clang" ,clang))) - (arguments - `(#:phases - (modify-phases %standard-phases - (add-after 'unpack 'configure - (lambda* (#:key inputs #:allow-other-keys) - (let ((clang (assoc-ref inputs "clang"))) - (copy-file "tools/clang-rename/clang-rename.el" "clang-rename.el") - (emacs-substitute-variables "clang-rename.el" - ("clang-rename-binary" - (string-append clang "/bin/clang-rename")))) - #t))))) + (inherit (package-elisp-from-package + clang + "emacs-clang-rename" + '("tools/clang-rename/clang-rename.el"))) + (inputs `(("clang" ,clang))) + (arguments `(#:phases + (modify-phases %standard-phases + (add-after 'unpack 'configure + (lambda* (#:key inputs #:allow-other-keys) + (chmod "clang-rename.el" #o644) + (emacs-substitute-variables "clang-rename.el" + ("clang-rename-binary" + (string-append (assoc-ref inputs "clang") + "/bin/clang-rename"))) + #t))))) (synopsis "Rename every occurrence of a symbol using clang-rename") (description "This package renames every occurrence of a symbol at point using @code{clang-rename}."))) -- 2.20.1