From patchwork Sat Apr 17 17:06:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Leo Prikler X-Patchwork-Id: 28609 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 36E6427BC6C; Sat, 17 Apr 2021 18:08:44 +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_H4,RCVD_IN_MSPIKE_WL,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 3F70127BC77 for ; Sat, 17 Apr 2021 18:08:41 +0100 (BST) Received: from localhost ([::1]:55560 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lXoQy-0000VB-B5 for patchwork@mira.cbaines.net; Sat, 17 Apr 2021 13:08:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33672) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lXoQO-0008Dw-67 for guix-patches@gnu.org; Sat, 17 Apr 2021 13:08:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:32809) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lXoQM-0000DF-U0 for guix-patches@gnu.org; Sat, 17 Apr 2021 13:08:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lXoQM-0005aY-Nd for guix-patches@gnu.org; Sat, 17 Apr 2021 13:08:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#47661] [PATCH v2 02/33] gnu: emacs: Wrap EMACSLOADPATH. Resent-From: Leo Prikler Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 17 Apr 2021 17:08:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47661 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 47661@debbugs.gnu.org Received: via spool by 47661-submit@debbugs.gnu.org id=B47661.161867923621129 (code B ref 47661); Sat, 17 Apr 2021 17:08:02 +0000 Received: (at 47661) by debbugs.gnu.org; 17 Apr 2021 17:07:16 +0000 Received: from localhost ([127.0.0.1]:44288 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lXoPb-0005Ui-Ux for submit@debbugs.gnu.org; Sat, 17 Apr 2021 13:07:16 -0400 Received: from mailrelay.tugraz.at ([129.27.2.202]:45503) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lXoPX-0005UF-RJ for 47661@debbugs.gnu.org; Sat, 17 Apr 2021 13:07:12 -0400 Received: from localhost.localdomain (194-96-9-9.adsl.highway.telekom.at [194.96.9.9]) by mailrelay.tugraz.at (Postfix) with ESMTPSA id 4FMzyj2HgPz1LBRw for <47661@debbugs.gnu.org>; Sat, 17 Apr 2021 19:07:09 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 mailrelay.tugraz.at 4FMzyj2HgPz1LBRw DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tugraz.at; s=mailrelay; t=1618679229; bh=rohbZmPPKSSwuzeiqghl2Zl84+0Rb3cswo+vBJqdj/8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=eoIHDfOE40AEqN+Azu4MhmHrvxoWbl5sCMSJpJu9vBjUbrdLhUGgbtdMGXTjHP53u y+PMxLIyh98BnSzuB37B+4rbauwTYRlHP03hRGN5zOhOI1uMHmoQSoWXe+JrBK41/j ncN+3xR36gbwgbgKz8R2rh08/lySo/tzeVkPxXkc= From: Leo Prikler Date: Sat, 17 Apr 2021 19:06:17 +0200 Message-Id: <20210417170648.3810-2-leo.prikler@student.tugraz.at> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210417170648.3810-1-leo.prikler@student.tugraz.at> References: <20210417170648.3810-1-leo.prikler@student.tugraz.at> MIME-Version: 1.0 X-TUG-Backscatter-control: bt4lQm5Tva3SBgCuw0EnZw X-Scanned-By: MIMEDefang 2.74 on 129.27.10.117 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 With this, the search path specification of EMACSLOADPATH does no longer depend on the version of Emacs, which should make upgrading major versions less painful. See also: - - * gnu/packages/emacs.scm (emacs)[#:phases]: Add ‘wrap-load-path’. [native-search-path]: Do not search for builtin libraries. (emacs-next)[native-search-path]: Inherit from emacs. --- gnu/packages/emacs.scm | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm index 7447cfe33a..e1b01ac22b 100644 --- a/gnu/packages/emacs.scm +++ b/gnu/packages/emacs.scm @@ -201,6 +201,24 @@ (car (find-files "bin" "^emacs-([0-9]+\\.)+[0-9]+$")) "bin/emacs") #t))) + (add-after 'strip-double-wrap 'wrap-load-path + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (lisp-dirs (find-files (string-append out "/share/emacs") + "^lisp$" + #:directories? #t))) + (for-each + (lambda (prog) + (wrap-program prog + `("EMACSLOADPATH" suffix ,lisp-dirs))) + (find-files (string-append out "/bin") + ;; Matches versioned and unversioned emacs binaries. + ;; We don't patch emacsclient, because it takes its + ;; environment variables from emacs. + ;; Likewise, we don't need to patch helper binaries + ;; like etags, ctags or ebrowse. + "^emacs(-[0-9]+(\\.[0-9]+)*)?$")) + #t))) (add-before 'reset-gzip-timestamps 'make-compressed-files-writable ;; The 'reset-gzip-timestamps phase will throw a permission error ;; if gzip files aren't writable then. This phase is needed when @@ -255,9 +273,7 @@ (native-search-paths (list (search-path-specification (variable "EMACSLOADPATH") - ;; The versioned entry is for the Emacs' builtin libraries. - (files (list "share/emacs/site-lisp" - (string-append "share/emacs/" version "/lisp")))) + (files '("share/emacs/site-lisp"))) (search-path-specification (variable "INFOPATH") (files '("share/info"))))) @@ -294,18 +310,7 @@ languages.") "0igjm9kwiswn2dpiy2k9xikbdfc7njs07ry48fqz70anljj8y7y3")))) (native-inputs `(("autoconf" ,autoconf) - ,@(package-native-inputs emacs))) - (native-search-paths - (list (search-path-specification - (variable "EMACSLOADPATH") - ;; The versioned entry is for the Emacs' builtin libraries. - (files (list "share/emacs/site-lisp" - (string-append "share/emacs/" - (version-major+minor+point version) - "/lisp")))) - (search-path-specification - (variable "INFOPATH") - (files '("share/info")))))))) + ,@(package-native-inputs emacs)))))) (define-public emacs-next-pgtk (let ((commit "ae18c8ec4f0ef37c8c9cda473770ff47e41291e2")