unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: "LaFreniere, Joseph" <joseph@lafreniere.xyz>
To: 40045@debbugs.gnu.org
Subject: [bug#40045] [PATCH] gnu: Add libgccjit.
Date: Thu, 12 Mar 2020 16:56:33 -0500	[thread overview]
Message-ID: <87tv2tnsoe.fsf@lafreniere.xyz> (raw)

[-- Attachment #1: Type: text/plain, Size: 385 bytes --]

Patch file is attached.  I have no experience building or 
packaging GCC, so any feedback is appreciated.  That being said, I 
_believe_ this recipe follows the build instructions at 
https://gcc.gnu.org/onlinedocs/jit/internals/index.html#packaging-notes 
correctly.

This is toward the eventual goal of packaging gccemacs 
(https://akrl.sdf.org/gccemacs.html).

--
Joseph LaFreniere

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-Add-libgccjit.patch --]
[-- Type: text/x-patch, Size: 2025 bytes --]

From 8b08b302f6bf601f5c95513a56b7b0b54b0dc95c Mon Sep 17 00:00:00 2001
From: Joseph LaFreniere <joseph@lafreniere.xyz>
Date: Wed, 11 Mar 2020 21:48:59 -0500
Subject: [PATCH] gnu: Add libgccjit.

* gnu/packages/gcc.scm (libgccjit): New variable.
---
 gnu/packages/gcc.scm | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm
index ead50bb1dc..03fdeb02e1 100644
--- a/gnu/packages/gcc.scm
+++ b/gnu/packages/gcc.scm
@@ -690,6 +690,34 @@ as the 'native-search-paths' field."
   ;; report two gfortran@5 that are in fact identical.
   gfortran-7)
 
+(define-public libgccjit
+  (package
+    (inherit gcc-9)
+    (name "libgccjit")
+    (outputs (delete "lib" (package-outputs gcc)))
+    (properties (alist-delete 'hidden? (package-properties gcc)))
+    (arguments
+     (substitute-keyword-arguments `(#:modules ((guix build gnu-build-system)
+                                                (guix build utils)
+                                                (ice-9 regex)
+                                                (srfi srfi-1)
+                                                (srfi srfi-26))
+                                     ,@(package-arguments gcc))
+       ((#:configure-flags flags)
+        `(append `("--enable-host-shared"
+                   ,(string-append "--enable-languages=jit"))
+                 (remove (cut string-match "--enable-languages.*" <>)
+                         ,flags)))
+       ((#:phases phases)
+        `(modify-phases ,phases
+           (add-after 'install 'remove-broken-or-conflicting-files
+             (lambda* (#:key outputs #:allow-other-keys)
+               (for-each delete-file
+                         (find-files (string-append (assoc-ref outputs "out") "/bin")
+                                     ".*(c\\+\\+|cpp|g\\+\\+|gcov|gcc|gcc-.*)"))
+               #t))))))))
+
+
 (define-public gccgo-4.9
   (custom-gcc gcc-4.9 "gccgo" '("go")
               %generic-search-paths
-- 
2.25.1


             reply	other threads:[~2020-03-12 21:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-12 21:56 LaFreniere, Joseph [this message]
2020-03-16 13:07 ` [bug#40045] [PATCH] gnu: Add libgccjit Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87tv2tnsoe.fsf@lafreniere.xyz \
    --to=joseph@lafreniere.xyz \
    --cc=40045@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).