From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id sI9vLccmvV+dYgAA0tVLHw (envelope-from ) for ; Tue, 24 Nov 2020 15:29:11 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id EAxHKccmvV/hUwAAB5/wlQ (envelope-from ) for ; Tue, 24 Nov 2020 15:29:11 +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 640A99402DD for ; Tue, 24 Nov 2020 15:29:11 +0000 (UTC) Received: from localhost ([::1]:36746 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1khaFi-0002Kt-CL for larch@yhetil.org; Tue, 24 Nov 2020 10:29:10 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:60618) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1khaFb-0002Jv-76 for guix-patches@gnu.org; Tue, 24 Nov 2020 10:29:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:49384) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1khaFa-0001tY-Vw for guix-patches@gnu.org; Tue, 24 Nov 2020 10:29:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1khaFa-0005Gg-PP for guix-patches@gnu.org; Tue, 24 Nov 2020 10:29:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#44775] [PATCH] WIP: Add gccemacs Resent-From: John Soo Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 24 Nov 2020 15:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 44775 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: zimoun Cc: 44775@debbugs.gnu.org Received: via spool by 44775-submit@debbugs.gnu.org id=B44775.160623171320194 (code B ref 44775); Tue, 24 Nov 2020 15:29:02 +0000 Received: (at 44775) by debbugs.gnu.org; 24 Nov 2020 15:28:33 +0000 Received: from localhost ([127.0.0.1]:60929 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1khaF7-0005Fd-CI for submit@debbugs.gnu.org; Tue, 24 Nov 2020 10:28:33 -0500 Received: from mail-pl1-f195.google.com ([209.85.214.195]:32838) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1khaF5-0005FQ-D2 for 44775@debbugs.gnu.org; Tue, 24 Nov 2020 10:28:32 -0500 Received: by mail-pl1-f195.google.com with SMTP id t18so10878278plo.0 for <44775@debbugs.gnu.org>; Tue, 24 Nov 2020 07:28:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=asu-edu.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=tedEFFryhatF0HBde3kIcGZorlAf6bxS2NTXkGJYpvE=; b=JKCWc0fIi243MTcPzZ6K0m8024ICvz0hdmM1oYQf+MU7Np9dR6CkZGJNv4lImhjCLu RENQSHW3w0UvPWv1XCktB5j8AxO3nJnB0o3qpMAgu1phW4PZNjNLEZOt+gBTtUHziCrh VPFWkeEB7W0VKKt8HdlikkIqJZqKz9NAuZXWTA+6mSpVcndpDsrMfHGae3XOkl+idoAc MB903xbqdUvmQIwIj7A/ACaeRDuoFkG/D1qjTVEZSfipW1gF0/Q1WZu/3dezDn8nhIOP ujhXhhNFPXML69XqMcjwQGyIifdahoJOzPMYUvV1dKkruQ93eazyIt6ogBGbf28CqU/R t+RQ== 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=tedEFFryhatF0HBde3kIcGZorlAf6bxS2NTXkGJYpvE=; b=nf+nIk0kLVnZi3AoD1NjqmwYHz+Vv4VktY5WAr4hjPEnM5hB812vLrA4LLL7QAvvVl c0wQF5ZadHLlTyfE2ZX5a5ELoxWTFVMroegpmEokgigim2N0TRpbf4Fmv8CbrghaCpU4 nHuVq7CLJecw5Sgs8XN8dZSjYUEST+L966l7XvxohEEcDPUp+g1NDkZVttUyfRoA63o5 RrahnrWiRW6RLqhH6FfV6EGQI74V6SYf2K8CKUQ/bGk5lII5BQdvJzNPOszNJm2EImrf lTXnAUhAVSoypsluS5d65MDmaL8XKGvNHvzISxjOkt7KvAEPuQtNxZvcOSm9kBHcxcmY qQ8Q== X-Gm-Message-State: AOAM530MWlQd+FXIk693pRM+lXsxVMWvL9GhG+a8NvCSDvK8mO5iQEqe LkRjl8gVHHwl9aFdhZBoCXeIsAUCgHekhQ== X-Google-Smtp-Source: ABdhPJwyJ5/tklsio0At5a1aPKSChcKpCmyZhLW0aaQoyf1vIdN8HLyLDyv9NN9dXxSeAjc7XSYcag== X-Received: by 2002:a17:902:a3c9:b029:d9:ec83:1e57 with SMTP id q9-20020a170902a3c9b02900d9ec831e57mr4213195plb.76.1606231705163; Tue, 24 Nov 2020 07:28:25 -0800 (PST) Received: from ecenter ([2600:1700:83b0:8bd0::7a8]) by smtp.gmail.com with ESMTPSA id y9sm3430672pjj.8.2020.11.24.07.28.23 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Nov 2020 07:28:24 -0800 (PST) From: John Soo References: <874kljnk8z.fsf@asu.edu> <86360zvhkw.fsf@gmail.com> Date: Tue, 24 Nov 2020 07:28:23 -0800 In-Reply-To: <86360zvhkw.fsf@gmail.com> (zimoun's message of "Mon, 23 Nov 2020 23:22:55 +0100") Message-ID: <87pn42wz8o.fsf@asu.edu> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" 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: 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-Scanner: ns3122888.ip-94-23-21.eu Authentication-Results: aspmx1.migadu.com; dkim=fail (headers rsa verify failed) header.d=asu-edu.20150623.gappssmtp.com header.s=20150623 header.b=JKCWc0fI; dmarc=fail reason="SPF not aligned (relaxed)" header.from=asu.edu (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Spam-Score: 0.09 X-TUID: chvXG4KoTGml --=-=-= Content-Type: text/plain Hi Guix and zimoun, I fixed a bug in the build process here. Still no big progress on the other bugs. - John --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-gnu-Add-gccemacs.patch >From 03ab270db130b9991fcbfa87b9d1fcc009fba059 Mon Sep 17 00:00:00 2001 From: John Soo Date: Fri, 20 Nov 2020 22:06:52 -0800 Subject: [PATCH] gnu: Add gccemacs. --- gnu/packages/emacs.scm | 109 ++++++++++++++++++ gnu/packages/patches/gccemacs-exec-path.patch | 18 +++ 2 files changed, 127 insertions(+) create mode 100644 gnu/packages/patches/gccemacs-exec-path.patch diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm index 7a5dd9010c..98a9aae69b 100644 --- a/gnu/packages/emacs.scm +++ b/gnu/packages/emacs.scm @@ -53,6 +53,7 @@ #:use-module (gnu packages compression) #:use-module (gnu packages fontutils) #:use-module (gnu packages fribidi) + #:use-module (gnu packages gcc) #:use-module (gnu packages gd) #:use-module (gnu packages gettext) #:use-module (gnu packages glib) @@ -426,6 +427,114 @@ editor (console only)") (delete 'strip-double-wrap))))) (inputs (package-inputs emacs-no-x)))) +;; feature/native-comp +(define-public gccemacs-commit + "6781cd670d1487bbf0364d80de68ca9733342769") + +(define-public gccemacs-version + (git-version "28.0.50" "0" gccemacs-commit)) + +(define-public gccemacs-source + (origin + (method git-fetch) + (uri (git-reference + (url "git://git.sv.gnu.org/emacs.git") + (commit gccemacs-commit))) + (sha256 + (base32 + "13pmrak5jvk5qp4i5iccn0fqa6by8ig8l0n3qqirm67dxrqiz2ya")) + (patches (search-patches "gccemacs-exec-path.patch" + "emacs-fix-scheme-indent-function.patch" + "emacs-ignore-empty-xim-styles.patch" + "emacs-source-date-epoch.patch")) + (modules '((guix build utils))) + (snippet + '(with-directory-excursion "lisp" + ;; Delete the bundled byte-compiled elisp files and generated + ;; autoloads. + (for-each delete-file + (append (find-files "." "\\.elc$") + (find-files "." "loaddefs\\.el$") + (find-files "eshell" "^esh-groups\\.el$"))) + + ;; Make sure Tramp looks for binaries in the right places on + ;; remote Guix System machines, where 'getconf PATH' returns + ;; something bogus. + (substitute* "net/tramp-sh.el" + ;; Patch the line after "(defcustom tramp-remote-path". + (("\\(tramp-default-remote-path") + (format #f "(tramp-default-remote-path ~s ~s ~s ~s " + "~/.guix-profile/bin" "~/.guix-profile/sbin" + "/run/current-system/profile/bin" + "/run/current-system/profile/sbin"))) + + ;; Make sure Man looks for C header files in the right + ;; places. + (substitute* "man.el" + (("\"/usr/local/include\"" line) + (string-join + (list line + "\"~/.guix-profile/include\"" + "\"/var/guix/profiles/system/profile/include\"") + " "))) + #t)))) + +(define add-libgccjit-gcc-lib-to-library-path + '(lambda* (#:key inputs #:allow-other-keys) + (define (prepend-to-env val var) + (let ((current (getenv var))) + (setenv + var (if (and current (not (string-null? current))) + (string-append val ":" current) + val)))) + (let* ((libgccjit (assoc-ref inputs "libgccjit")) + (gcc-dirs (find-files + libgccjit "^gcc$" #:directories? #t)) + (gcc-dirs-paths (string-join gcc-dirs ":"))) + (prepend-to-env gcc-dirs-paths "LIBRARY_PATH") + (prepend-to-env gcc-dirs-paths "LD_LIBRARY_PATH") + (prepend-to-env gcc-dirs-paths "PATH") + #t))) + +(define-public gccemacs + (package + (inherit emacs-next) + (name "gccemacs") + (version gccemacs-version) + (source gccemacs-source) + (synopsis "The extensible, customizeable, self-documenting text +editor (from the native compilation branch)") + (inputs + `(("libgccjit" ,(canonical-package libgccjit)) + ,@(package-inputs emacs-next))) + (arguments + (substitute-keyword-arguments (package-arguments emacs-next) + ((#:phases p) + `(modify-phases ,p + (add-after 'bootstrap 'add-libgccjit-gcc-lib-to-library-path + ,add-libgccjit-gcc-lib-to-library-path))) + ((#:configure-flags flags ''()) + `(cons "--with-nativecomp" ,flags)))))) + +(define-public gccemacs-no-x + (package/inherit emacs-next-no-x + (name "gccemacs-no-x") + (version gccemacs-version) + (source gccemacs-source) + (synopsis "The extensible, customizable, self-documenting text +editor (console only, from the native compilation branch)") + (build-system gnu-build-system) + (inputs + `(("libgccjit" ,(canonical-package libgccjit)) + ,@(package-inputs emacs-next-no-x))) + (arguments + (substitute-keyword-arguments (package-arguments emacs-next-no-x) + ((#:phases p) + `(modify-phases ,p + (add-after 'bootstrap 'add-libgccjit-gcc-lib-to-library-path + ,add-libgccjit-gcc-lib-to-library-path))) + ((#:configure-flags flags ''()) + `(cons "--with-nativecomp" ,flags)))))) (define-public emacs-no-x-toolkit (package/inherit emacs diff --git a/gnu/packages/patches/gccemacs-exec-path.patch b/gnu/packages/patches/gccemacs-exec-path.patch new file mode 100644 index 0000000000..3c75f9465e --- /dev/null +++ b/gnu/packages/patches/gccemacs-exec-path.patch @@ -0,0 +1,18 @@ +Do not capture the build-time value of $PATH in the 'emacs' executable +since this can noticeably increase the size of the closure of Emacs +with things like GCC being referenced. + +diff --git a/lisp/loadup.el.old b/lisp/loadup.el +index 158a4bf..f853a48 100644 +--- a/lisp/loadup.el ++++ b/lisp/loadup.el +@@ -509,7 +509,8 @@ lost after dumping"))) + ((equal dump-mode "dump") "emacs") + ((equal dump-mode "bootstrap") "emacs") + ((equal dump-mode "pbootstrap") "bootstrap-emacs.pdmp") +- (t (error "unrecognized dump mode %s" dump-mode))))) ++ (t (error "unrecognized dump mode %s" dump-mode)))) ++ (exec-path nil)) + (when (and (featurep 'nativecomp) + (equal dump-mode "pdump")) + ;; Don't enable this before bootstrap is completed the as the -- 2.29.2 --=-=-=--