guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH]: Add GCJ


From: Ludovic Courtès
Subject: Re: [PATCH]: Add GCJ
Date: Fri, 23 Jan 2015 22:09:34 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

Ricardo Wurmus <address@hidden> skribis:

> this patch adds the GNU Compiler for Java to the gcc module.  We need
> GCJ to build IcedTea6 / OpenJDK, which in turn could be used to build
> IcedTea7.

Nice!

> GCJ unfortunately has a binary dependency, the Eclipse Compiler for
> Java.  GCJ expects to be given the path of the ecj.jar at compile time.
> ECJ is provided as ecj-bootstrap-4.8.  I don't know if GCJ is built such
> that this ECJ binary is no longer required at the end (but I know that
> IcedTea6 also needs the ECJ jar).  For IcedTea6 we could compile ECJ
> from source with GCJ, but I don't know how to deal with GCJ's dependency
> on ECJ.  Having it depend on a binary is ugly.

Well it’s a bootstrapping issue–same problem as for GHC, MIT/GNU Scheme,
or the whole distro actually.  I wouldn’t be surprised if ecj.jar cannot
be avoided at all.

> GCJ is built with options to create symlinks to function as a primitive
> JDK.  It does not provide wrappers for javap and javac, so these are
> added in an extra phase.  I took the javac perl wrapper from Gentoo, but
> I suppose a script in Guile might be nicer (there is no official
> upstream source for the wrapper script, so we might as well roll our
> own).

Yeah, something nice to have for later.  :-)

> From 56f43a9042853aca79f60808a51d328dfbe420a3 Mon Sep 17 00:00:00 2001
> From: Ricardo Wurmus <address@hidden>
> Date: Tue, 23 Dec 2014 12:31:50 +0100
> Subject: [PATCH] gnu: Add GCJ
>
> * gnu/packages/gcc.scm (gcj-4.8, ecj-bootstrap-4.8): New variable.
> * gnu/packages/javac.in: New file.

You need something like this in gnu-system.am:

  MISC_DISTRO_FILES = gnu/packages/javac.in

and in Makefile.am, change the nobase_dist_guilemodule_DATA line to:

  nobase_dist_guilemodule_DATA =       \
    $(MODULES) $(KCONFIGS) $(EXAMPLES) \
    $(MISC_DISTRO_FILES)

> +    (inputs
> +     (append (package-inputs gcc-4.8)
> +             `(("fastjar"       ,fastjar)
> +               ("perl"          ,perl)
> +               ("javac.in"      ,(search-path %load-path
> +                                              "gnu/packages/javac.in"))
> +               ("ecj-bootstrap" ,ecj-bootstrap-4.8))))

Minor issue: I would avoid comma alignment and use quasiquote +
unquote-splicing rather than ‘append’.

> +(define-public ecj-bootstrap-4.8
> +  (package
> +    (name "ecj-bootstrap")
> +    (version "4.8")
> +    (source (origin
> +              (method url-fetch)
> +              (uri (string-append "ftp://sourceware.org/pub/java/ecj-"; 
> version ".jar"))
> +              (sha256
> +               (base32
> +                "10fpqfbdzff1zcbxzh66xc8xbij9saykcj4xzm19wk9p3n7i5zcq"))))

It’s enough to make it an ‘origin’, and to keep it private:

  (define ecj-bootstrap-4.8
    (origin
      (method ...)
      ...))

Thanks,
Ludo’.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]