From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id CNSzJP8jB2N/RAEAbAwnHQ (envelope-from ) for ; Thu, 25 Aug 2022 09:25:51 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id KHCnJP8jB2OVNwEAauVa8A (envelope-from ) for ; Thu, 25 Aug 2022 09:25:51 +0200 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 2B099C6E3 for ; Thu, 25 Aug 2022 09:25:51 +0200 (CEST) Received: from localhost ([::1]:50418 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oR7FO-0004WL-9f for larch@yhetil.org; Thu, 25 Aug 2022 03:25:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37972) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oR7Ef-0004Tj-68 for guix-patches@gnu.org; Thu, 25 Aug 2022 03:25:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:59013) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oR7Ee-0006Lx-Tp for guix-patches@gnu.org; Thu, 25 Aug 2022 03:25:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oR7Ee-0000Bc-MB for guix-patches@gnu.org; Thu, 25 Aug 2022 03:25:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#57086] [PATCH v3 6/7] build-system: emacs: Use native compilation. References: <4c232648145659a2c3edca6d32725d8120cc14d3.camel@gmail.com> In-Reply-To: <4c232648145659a2c3edca6d32725d8120cc14d3.camel@gmail.com> Resent-From: Liliana Marie Prikler Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 25 Aug 2022 07:25:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57086 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 57086@debbugs.gnu.org Received: via spool by 57086-submit@debbugs.gnu.org id=B57086.1661412292634 (code B ref 57086); Thu, 25 Aug 2022 07:25:04 +0000 Received: (at 57086) by debbugs.gnu.org; 25 Aug 2022 07:24:52 +0000 Received: from localhost ([127.0.0.1]:48753 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oR7ER-0000A3-Gm for submit@debbugs.gnu.org; Thu, 25 Aug 2022 03:24:51 -0400 Received: from mail-ej1-f65.google.com ([209.85.218.65]:33508) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oR7EE-00008X-TZ for 57086@debbugs.gnu.org; Thu, 25 Aug 2022 03:24:39 -0400 Received: by mail-ej1-f65.google.com with SMTP id j21so32409281ejs.0 for <57086@debbugs.gnu.org>; Thu, 25 Aug 2022 00:24:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:content-transfer-encoding:to:mime-version:subject:date :from:from:to:cc; bh=HpPA2V2IzUFxOvnq1RBTRbwYjxdIqTnfj0S4Fb1DCLc=; b=QGMgpxxqEYjDklh0BDK9hWI5pUl2EX94oxo41fXQxZZbfojw0YnFoHiyv1DZXghq/x gslcLgsBEJ35pYnIzW58dSx0n1ecWVZBefJPRKfBneBdWTF0UyNzOiM7RMvvgv0UIZ+r iy3XoBzuu7KR3FoEnbXRDqt05uWsOn8YMZJkv8jfdnqe23dFvdN37tDHFWV+rfHmDMfc 12feXxdTypjgj5CjAQ2IYkxywj8BCrJpIkg3J747uPEJ6Vc1aapQmgN//OhatbGWgQYw UWWyrnrjpY4ba7ivYYRcT6/2iq7dKut4A6MmV3AUyDk7PX3dW5Ts7VxZoGW9mKxTYLZd 1qMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=message-id:content-transfer-encoding:to:mime-version:subject:date :from:x-gm-message-state:from:to:cc; bh=HpPA2V2IzUFxOvnq1RBTRbwYjxdIqTnfj0S4Fb1DCLc=; b=qPPcwLB5VzkNKAuGNWZr+pEiPrZjgQk92sX7EF1lpIo3zps3rrSJmpnfCfv+As7q/i vUwFKoe2SCzogzkp+2VvS5LlzGQO4rTh4S5LrPyGYkI+v2gCV8jN4DjWjn1Mf9JBwFRx G+0KiPBr+2JgwN0z6B8xvuEBTcLLdVkcgOUKMxU+1qpEMHUrYOzyKdu0tpBC/8U1Rkpx iFq+J2UMMY9N9HV5uKPrP5WaMF+lF5GkKGrwn7SxRrMt9FeqkuqwZ+0uuHgdfvHSfE3d 1QJMpxXlJnD78KE+w4FBWoWYfgp6qbkbHwK+MwFo0Hy3ZcuJop7UjgCfsLPO1Ke41EuQ jdUA== X-Gm-Message-State: ACgBeo0vIbkmad0jYyWV1uy1JibpDCAz6AhxGgodstpdKCD8oAiyi+eM Yj6KnqMnwkUnxtSYxhXC1OdDDlkfz5M= X-Google-Smtp-Source: AA6agR7f5o0AMqqrggBREAAb9Ji6JXsE3vtsqW0zVSxuXV8aYW95wU+zmtIFpCuyNk9wlULP8E1ubQ== X-Received: by 2002:a17:907:168b:b0:73d:85cf:2be0 with SMTP id hc11-20020a170907168b00b0073d85cf2be0mr1574378ejc.303.1661412273314; Thu, 25 Aug 2022 00:24:33 -0700 (PDT) Received: from nijino.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id g2-20020a170906538200b0073d62cc3270sm2019690ejo.118.2022.08.25.00.24.31 for <57086@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Aug 2022 00:24:31 -0700 (PDT) From: Liliana Marie Prikler Date: Tue, 9 Aug 2022 20:32:37 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-ID: 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+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1661412351; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: 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=HpPA2V2IzUFxOvnq1RBTRbwYjxdIqTnfj0S4Fb1DCLc=; b=V0JWnO3jzfzm/TirWZHsMlIBEHq9nInFpUxMCq1pgRjHrogSx1rbscZqQywx5wk/24HUok ywFCQds657ufRLjrFKfrbBdh2COGGLEUI0UH96+sEPYO7uXUGa6vehWlmb0R1gv4h/9iHi aQjjyqQg8+Ghyov+V+3nRUF7uB2aHtQiSBwsyKPT9GBpEtQSPgyYiM4Mpor+96/l+464Z1 gQdFC+YvaTRBJtCSCzenRr7Enc5PHRiP3EF4BrkSIDMiVaa7kJcjxUjQtvqfy5xXNOVNJ5 oRKv658ttfdQ0HrbFc44IvAXnwRZi5Wyn9Iukc6iRqUD0XSqTlWlgBTXBjLZpA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1661412351; a=rsa-sha256; cv=none; b=oKQmR4QOgeV5OO0kMXZqTJsjPR/pLZW4GWWjHGbibexpqvrhbTB7R6fhrqgmnIp59+Fe5G impjiMbnqAEXsBM5PoSZElWS2660pNakevNF8Gnsif2CDDscXN6LOB2jsuLX/JejpXrQUN 5crYfMp3dl5dJlHWUgqXP5W4BDVGeb51ivYe+ko+lQgiMEIXmQhJJklJcs0P1gs1r0a/1N m/Ai6m/11pXSmUnKk4QGCyDlwglyKUF/B3ks+T3jQvNFKNmwduS3mXfcpuhtnRqBtiRg6f 6pQrz7ekibrWWEHULDq8azOWa0sWQtQvrEf0xoloFqdWlNAJqx+K0BCqFPrjJA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=QGMgpxxq; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 7.19 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=QGMgpxxq; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 2B099C6E3 X-Spam-Score: 7.19 X-Migadu-Scanner: scn1.migadu.com X-TUID: Ysi8et1wVm+V * guix/build/emacs-build-system.scm (add-install-to-native-load-path): New variable. (build): Replace ‘emacs-byte-compile-directory’ with ‘emacs-compile-directory’. Delete already compiled files in the working directory prior to compilation. (%standard-phases): Add ‘add-install-to-native-load-path’ after ‘expand-load-path’. --- guix/build/emacs-build-system.scm | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/guix/build/emacs-build-system.scm b/guix/build/emacs-build-system.scm index 6a6918bfdd..3808b60445 100644 --- a/guix/build/emacs-build-system.scm +++ b/guix/build/emacs-build-system.scm @@ -108,13 +108,29 @@ (define* (expand-load-path #:key (prepend-source? #t) #:allow-other-keys) (format #t "expanded load paths for ~{~a~^, ~}\n" (map basename diff)))))) +(define* (add-install-to-native-load-path #:key outputs #:allow-other-keys) + "Append the native-site-lisp of OUTPUT to EMACSNATIVELOADPATH." + (let ((native-load-path (or (false-if-exception + (string-split (getenv "EMACSNATIVELOADPATH") #\:)) + '())) + (install-directory (string-append (assoc-ref outputs "out") + "/lib/emacs/native-site-lisp"))) + (setenv "EMACSNATIVELOADPATH" + ;; Emacs pushes these directories in reverse order, so the + ;; last one will be the first. + (string-join `(,@native-load-path ,install-directory) + ":")))) + (define* (build #:key outputs inputs #:allow-other-keys) "Compile .el files." + ;; Ensure that already compiled files in the working directory don't shadow + ;; the build. Might happen, because check runs first. + (for-each delete-file (find-files "." "\\.el[cn]$")) (let* ((emacs (search-input-file inputs "/bin/emacs")) (out (assoc-ref outputs "out"))) (setenv "SHELL" "sh") (parameterize ((%emacs emacs)) - (emacs-byte-compile-directory (elpa-directory out))))) + (emacs-compile-directory (elpa-directory out))))) (define* (patch-el-files #:key outputs #:allow-other-keys) "Substitute the absolute \"/bin/\" directory with the right location in the @@ -343,6 +359,8 @@ (define %standard-phases (modify-phases gnu:%standard-phases (replace 'unpack unpack) (add-after 'unpack 'expand-load-path expand-load-path) + (add-after 'expand-load-path 'add-install-to-native-load-path + add-install-to-native-load-path) (delete 'bootstrap) (delete 'configure) (delete 'build) -- 2.37.2