From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:bcc0::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id akiAA3LzYmAdOwEAgWs5BA (envelope-from ) for ; Tue, 30 Mar 2021 11:46:26 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id 8LftN3HzYmBvGAAAB5/wlQ (envelope-from ) for ; Tue, 30 Mar 2021 09:46:25 +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 602F41840B for ; Tue, 30 Mar 2021 11:46:25 +0200 (CEST) Received: from localhost ([::1]:44518 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lRAx5-0000aK-B2 for larch@yhetil.org; Tue, 30 Mar 2021 05:46:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37708) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lRAwn-0000ZY-T0 for bug-guix@gnu.org; Tue, 30 Mar 2021 05:46:07 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:38889) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lRAwk-0002ho-Cj for bug-guix@gnu.org; Tue, 30 Mar 2021 05:46:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lRAwk-0006GH-BS for bug-guix@gnu.org; Tue, 30 Mar 2021 05:46:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#45316: [WIP PATCH 2/3] build-system: emacs: Use subdirectories again. Resent-From: Leo Prikler Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Tue, 30 Mar 2021 09:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45316 X-GNU-PR-Package: guix X-GNU-PR-Keywords: patch To: 45316@debbugs.gnu.org Received: via spool by 45316-submit@debbugs.gnu.org id=B45316.161709753624019 (code B ref 45316); Tue, 30 Mar 2021 09:46:02 +0000 Received: (at 45316) by debbugs.gnu.org; 30 Mar 2021 09:45:36 +0000 Received: from localhost ([127.0.0.1]:50432 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lRAwJ-0006FA-G8 for submit@debbugs.gnu.org; Tue, 30 Mar 2021 05:45:36 -0400 Received: from mailrelay.tugraz.at ([129.27.2.202]:5623) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lRAwH-0006Eu-PN for 45316@debbugs.gnu.org; Tue, 30 Mar 2021 05:45:34 -0400 Received: from localhost.localdomain (194-96-13-79.adsl.highway.telekom.at [194.96.13.79]) by mailrelay.tugraz.at (Postfix) with ESMTPSA id 4F8l1R43MXz3yZ0; Tue, 30 Mar 2021 11:45:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tugraz.at; s=mailrelay; t=1617097531; bh=cL2W3QeU3SIZw3UTFtbJOlKLuWpSZ5pkeEQbt3vREMc=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=ViC/+MdXPCT6Te+CJJ2FS6U+/pAzNJRdxb7z3HPHxWmjmHHd/f7QNwDSCgUbagisT ODu1RmsbsZglyAySpLJbfIZKHjQVldukgX/93zpFAsS03p2XJ5k0izxyHVtaTiKJal HnN4TOLZ2C+VMeSS/mfbtDqgX4ar+ARuR3+sfyQ0= From: Leo Prikler Date: Tue, 30 Mar 2021 11:45:13 +0200 Message-Id: <20210330094514.4819-2-leo.prikler@student.tugraz.at> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20210330094514.4819-1-leo.prikler@student.tugraz.at> References: <20210330094514.4819-1-leo.prikler@student.tugraz.at> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TUG-Backscatter-control: bt4lQm5Tva3SBgCuw0EnZw X-Spam-Scanner: SpamAssassin 3.003001 X-Spam-Score-relay: -1.9 X-Scanned-By: MIMEDefang 2.74 on 129.27.10.116 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: maxim.cournoyer@gmail.com Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1617097585; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=cL2W3QeU3SIZw3UTFtbJOlKLuWpSZ5pkeEQbt3vREMc=; b=Pj04FhwCNZjqSx6FeDoyt/DSH0fPkyWGIhJgvoDCcA14WqMzljZYrPjUKs/W14flBT97zx WvQA8q4aXce+hrSqId7UqSCsQi/+//vzhdwkE7hcm/gib3rAevzAI9i5UznKj4ARr9Bp6Z XBrmwi89ZU0F8L3pF85sEXcQ5hpSBDnjunz/Ok9pPoa9pJNX15l304Qi+yZnILAbwK0axt ACzP/C3R/EGCUtoVXVa7r/086Vhe4q1KLfFwwDNCvzVu8AgX0EvcHEke+UI2o9PqmrPRgt eAcec0hnu6UYcKa/KMgm/5wuyLvT0kyo4gzt/sJSZ064WEN8lcd79S7s180R/w== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1617097585; a=rsa-sha256; cv=none; b=pwR0mrwnKmmUbe56UZRg3//o72ojUoPmi4ovB4FG0IJfFTS1EWbmPh94hXV7nt2Fn66F5p +iquHsMse0OHejEREJpf0GotT9S4uZoz11URbYIjfHGlHFf0LplUNkkUr16yKFI9ClUb2G tWr8J0v4KW5TXgcaw++YXlKFGtbhNwtgg9k2Yf+iqpaLv9r2RY1VIJaXXSLA9umVmXJ67r 4HXOuppFsgTjY7qbl5KzEh5sV3qMBYKLfu90qjHq2sa/pDT9aJ4hnAD73J1lPy6zw1Lz5n HAbFvdDRyxy8GksN80fyQCQhEJ5LVpl/EDj8eYs9pdUV5+bZGz6NI9VCdZyHbg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=tugraz.at header.s=mailrelay header.b="ViC/+MdX"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=student.tugraz.at (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-Migadu-Spam-Score: 3.68 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=tugraz.at header.s=mailrelay header.b="ViC/+MdX"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=student.tugraz.at (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-Migadu-Queue-Id: 602F41840B X-Spam-Score: 3.68 X-Migadu-Scanner: scn0.migadu.com X-TUID: 663Xzm5yMTBm With this, Emacs libraries are installed in the ELPA_NAME-VERSION subdirectory of site-lisp and potential subdirectories should no longer collide. * guix/build/emacs-build-system.scm (build, patch-el-files, make-autoloads): Use ELPA name and version to construct subdirectories of %install-dir. (install): Install in subdirectory. Also create a subdirs.el, so that emacs-build-system can find the library without needing to hack EMACSLOADPATH. --- guix/build/emacs-build-system.scm | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/guix/build/emacs-build-system.scm b/guix/build/emacs-build-system.scm index 26ea59bc25..adc4861f02 100644 --- a/guix/build/emacs-build-system.scm +++ b/guix/build/emacs-build-system.scm @@ -96,10 +96,11 @@ environment variable\n" source-directory))) "Compile .el files." (let* ((emacs (string-append (assoc-ref inputs "emacs") "/bin/emacs")) (out (assoc-ref outputs "out")) - (site-lisp (string-append out %install-dir))) + (elpa-name-ver (store-directory->elpa-name-version out)) + (el-dir (string-append out %install-dir "/" elpa-name-ver))) (setenv "SHELL" "sh") (parameterize ((%emacs emacs)) - (emacs-byte-compile-directory site-lisp)))) + (emacs-byte-compile-directory el-dir)))) (define* (patch-el-files #:key outputs #:allow-other-keys) "Substitute the absolute \"/bin/\" directory with the right location in the @@ -116,7 +117,8 @@ store in '.el' files." #:binary #t)) (let* ((out (assoc-ref outputs "out")) - (site-lisp (string-append out %install-dir)) + (elpa-name-ver (store-directory->elpa-name-version out)) + (el-dir (string-append out %install-dir "/" elpa-name-ver)) ;; (ice-9 regex) uses libc's regexp routines, which cannot deal with ;; strings containing NULs. Filter out such files. TODO: Remove ;; this workaround when is fixed. @@ -130,7 +132,7 @@ store in '.el' files." (error "patch-el-files: unable to locate " cmd-name)) (string-append "\"" cmd "\""))))) - (with-directory-excursion site-lisp + (with-directory-excursion el-dir ;; Some old '.el' files (e.g., tex-buf.el in AUCTeX) are still ;; ISO-8859-1-encoded. (unless (false-if-exception (substitute-program-names)) @@ -182,16 +184,22 @@ parallel. PARALLEL-TESTS? is ignored when using a non-make TEST-COMMAND." (let* ((out (assoc-ref outputs "out")) (site-lisp (string-append out %install-dir)) + (elpa-name-ver (store-directory->elpa-name-version out)) + (el-dir (string-append site-lisp "/" elpa-name-ver)) (files-to-install (find-files source install-file?))) (cond ((not (null? files-to-install)) (for-each (lambda (file) (let* ((stripped-file (string-drop file (string-length source))) - (target-file (string-append site-lisp stripped-file))) + (target-file (string-append el-dir stripped-file))) (format #t "`~a' -> `~a'~%" file target-file) (install-file file (dirname target-file)))) files-to-install) + (call-with-output-file (string-append site-lisp "/subdirs.el") + (lambda (port) + (write `(normal-top-level-add-to-load-path (list ,el-dir)) port) + (newline port))) #t) (else (format #t "error: No files found to install.\n") @@ -219,11 +227,11 @@ parallel. PARALLEL-TESTS? is ignored when using a non-make TEST-COMMAND." "Generate the autoloads file." (let* ((emacs (string-append (assoc-ref inputs "emacs") "/bin/emacs")) (out (assoc-ref outputs "out")) - (site-lisp (string-append out %install-dir)) (elpa-name-ver (store-directory->elpa-name-version out)) - (elpa-name (package-name->name+version elpa-name-ver))) + (elpa-name (package-name->name+version elpa-name-ver)) + (el-dir (string-append out %install-dir "/" elpa-name-ver))) (parameterize ((%emacs emacs)) - (emacs-generate-autoloads elpa-name site-lisp)))) + (emacs-generate-autoloads elpa-name el-dir)))) (define* (enable-autoloads-compilation #:key outputs #:allow-other-keys) "Remove the NO-BYTE-COMPILATION local variable embedded in the generated -- 2.31.0