From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 24 10:28:33 2020 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 To: zimoun Subject: Re: [bug#44775] [PATCH] WIP: Add gccemacs 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-Debbugs-Envelope-To: 44775 Cc: 44775@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= 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 --=-=-=--