From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id kCy3LPfzdV9MegAA0tVLHw (envelope-from ) for ; Thu, 01 Oct 2020 15:21:27 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id YPCGKPfzdV9sCQAA1q6Kng (envelope-from ) for ; Thu, 01 Oct 2020 15:21:27 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 75B65940223 for ; Thu, 1 Oct 2020 15:21:26 +0000 (UTC) Received: from localhost ([::1]:42090 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kO0Oa-0005wV-Su for larch@yhetil.org; Thu, 01 Oct 2020 11:21:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48526) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kO08l-0001o3-LM for bug-guix@gnu.org; Thu, 01 Oct 2020 11:05:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:54608) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kO08l-0005gv-4t for bug-guix@gnu.org; Thu, 01 Oct 2020 11:05:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kO08k-0004Z1-La for bug-guix@gnu.org; Thu, 01 Oct 2020 11:05:02 -0400 Subject: bug#43277: [PATCH] gnu: emacs-next: Fix load path and version Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-To: bug-guix@gnu.org Resent-Date: Thu, 01 Oct 2020 15:05:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 43277 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Pierre Langlois Mail-Followup-To: 43277@debbugs.gnu.org, maxim.cournoyer@gmail.com, mjbecze@riseup.net Received: via spool by 43277-done@debbugs.gnu.org id=D43277.160156465917474 (code D ref 43277); Thu, 01 Oct 2020 15:05:02 +0000 Received: (at 43277-done) by debbugs.gnu.org; 1 Oct 2020 15:04:19 +0000 Received: from localhost ([127.0.0.1]:37919 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kO082-0004Xm-VO for submit@debbugs.gnu.org; Thu, 01 Oct 2020 11:04:19 -0400 Received: from mail-qk1-f196.google.com ([209.85.222.196]:39313) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kO07z-0004XX-Iv for 43277-done@debbugs.gnu.org; Thu, 01 Oct 2020 11:04:18 -0400 Received: by mail-qk1-f196.google.com with SMTP id w12so5631245qki.6 for <43277-done@debbugs.gnu.org>; Thu, 01 Oct 2020 08:04:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=fCftwwNJ0liTL44JUHtwMG14QATg9I+TrlpL9i45dtY=; b=GcD5TJ4LbYII/WU1kHd6vqI52UC2z6eafE/7V77/ItvXBlNgtq6z8ZnlHedKhZ4PIL mFYYupTYYGwwDk8Zc2cw48Yir5bcdqO13kzOmKG1/WTxBXplNAQaomO4CefMobF6nLp9 jKKae+1wbSqsM4ELphHnm6p+DjAOHI7l93DfZYw4g4iGGrEUcigbpRXECY/qIP76pMbe mMm1TMRrovXdzpgOK2vwkxMN5nQAAihzcKf66nf2s+jIh8J6/lnpbhxG0mUtdzee5II0 5vHiKd+zATfG4RSe7ixPK6VzPIBArB2uxRB0uxnT8bYqMPx9hyBQK4MXdTpMTs41WUD4 jBtw== 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:references:date:in-reply-to :message-id:user-agent:mime-version; bh=fCftwwNJ0liTL44JUHtwMG14QATg9I+TrlpL9i45dtY=; b=Lx1JS+l3t/H2n8ruxv1vtOvy8xt0DSKQszusz4N3PAeZYNlJdiL9Tjzh0x+VEVaI89 aQ352klfTOmoVxD4DzauCSd8LNCzo9z5istNWKNX/Kofpaxlvo4TBSAXgfQiLxF7favR xtYNEIoXNVY4fKuEx6fRJyzpc8FyYiScRBSEmLfCh6Q9uRll0oOZLgMniuTmZfi7AuZ5 sUgo8ODf9aprnXJcFOCQvE3MsHtzcARUkz1ClwWb6gO1LSVK9CpgeX9S6pziLA1YtjZe M/Zs60DnL92IkXDu41PE2vlUJEzUH2a+u5+zFvve6WWOxUHqNqKBGdiOC+U5zMqhUqY0 KTog== X-Gm-Message-State: AOAM530mwVPKNpooZMCTDUdgRT4gCbELJ/QhwxpQC/fbm/VSdndlCxBI BWT5wxNpWv7JPW4QMDSe3Oc= X-Google-Smtp-Source: ABdhPJx5s87DHXrvPKLouFcjVEKs8sf0eufZXZqIAtqQjsjffr98wE6kmyHgpP3pMXkc8x15gTXm1A== X-Received: by 2002:a37:b57:: with SMTP id 84mr7736759qkl.433.1601564649465; Thu, 01 Oct 2020 08:04:09 -0700 (PDT) Received: from hurd (dsl-10-135-18.b2b2c.ca. [72.10.135.18]) by smtp.gmail.com with ESMTPSA id g23sm7433278qta.42.2020.10.01.08.04.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Oct 2020 08:04:08 -0700 (PDT) From: Maxim Cournoyer References: <87pn6dslqh.fsf@gmx.com> Date: Thu, 01 Oct 2020 11:05:46 -0400 In-Reply-To: <87pn6dslqh.fsf@gmx.com> (Pierre Langlois's message of "Tue, 22 Sep 2020 19:35:34 +0100") Message-ID: <87sgaynfzp.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -1.0 (-) X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Morgan.J.Smith@outlook.com, 43277-done@debbugs.gnu.org Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=fail (rsa verify failed) header.d=gmail.com header.s=20161025 header.b=GcD5TJ4L; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Spam-Score: 0.09 X-TUID: kOb8NMq/rkV3 Hello! [...] >> gnu/packages/emacs.scm | 37 ++++++++++++++++--------------------- >> 1 file changed, 16 insertions(+), 21 deletions(-) >> >> diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm >> index 03c28ee7a7..b3d099257d 100644 >> --- a/gnu/packages/emacs.scm >> +++ b/gnu/packages/emacs.scm >> @@ -196,11 +196,12 @@ >> (lambda* (#:key outputs #:allow-other-keys) >> ;; Directly copy emacs-X.Y to emacs, so that it is not wrapped >> ;; twice. This also fixes a minor issue, where WMs would not be >> - ;; able to track emacs back to emacs.desktop. >> + ;; able to track emacs back to emacs.desktop. It's done using >> + ;; this-package so emacs-next can reuse it >> (with-directory-excursion (assoc-ref outputs "out") >> (copy-file (string-append >> "bin/emacs-" >> - ,(version-major+minor (package-version emacs))) >> + ,(car (string-split (package-version this-package) #\-))) > > I agree in general it's good to reuse code, however in this particular > case it's probably better to keep the phases duplicated. For example, > in the future one could update the emacs-next package to not require a > revision number anymore, and it's likely they'd forget to update the > emacs package since it'll still work. It's unlikely the emacs-next package would be pegged against a stable version, but in the event it would, the above code would still work. [...] >> `(("autoconf" ,autoconf) >> - ,@(package-native-inputs emacs)))))) >> + ,@(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/" (car (string-split version #\-)) "/lisp")))) > > nit: This line seems to be a bit long. Reformatted, and edited the commit message to match our standards. I made minor, cosmetic changes like below: modified gnu/packages/emacs.scm @@ -196,12 +196,16 @@ (lambda* (#:key outputs #:allow-other-keys) ;; Directly copy emacs-X.Y to emacs, so that it is not wrapped ;; twice. This also fixes a minor issue, where WMs would not be - ;; able to track emacs back to emacs.desktop. It's done using - ;; this-package so emacs-next can reuse it + ;; able to track emacs back to emacs.desktop. The version is + ;; accessed using using THIS-PACKAGE so it "just works" for + ;; inherited Emacs packages of different versions. (with-directory-excursion (assoc-ref outputs "out") (copy-file (string-append "bin/emacs-" - ,(car (string-split (package-version this-package) #\-))) + ,(let ((this-version (package-version this-package))) + (or (false-if-exception + (version-major+minor+point this-version)) + (version-major+minor this-version)))) "bin/emacs") #t))) (add-before 'reset-gzip-timestamps 'make-compressed-files-writable @@ -304,7 +308,9 @@ languages.") (variable "EMACSLOADPATH") ;; The versioned entry is for the Emacs' builtin libraries. (files (list "share/emacs/site-lisp" - (string-append "share/emacs/" (car (string-split version #\-)) "/lisp")))) + (string-append "share/emacs/" + (version-major+minor+point version) + "/lisp")))) (search-path-specification (variable "INFOPATH") (files '("share/info")))))))) Verified it produced a correct EMACSLOADPATH and ran using: --8<---------------cut here---------------start------------->8--- $ guix environment --pure --ad-hoc emacs-next [...] [env]$ echo $EMACSLOADPATH /gnu/store/6s7p3yi969pm2xmkdd45dljbnwy5107g-profile/share/emacs/site-lisp:/gnu/store/6s7p3yi969pm2xmkdd45dljbnwy5107g-profile/share/emacs/28.0.50/ [env]$ emacs --version GNU Emacs 28.0.50 --8<---------------cut here---------------end--------------->8--- And pushed to master as commit 0f88fea0eaa. Thanks everyone! Closing, Maxim