guix-commits
[Top][All Lists]
Advanced

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

02/02: gnu: gcj: Move javac.in from a file in the distribution to an ori


From: Andreas Enge
Subject: 02/02: gnu: gcj: Move javac.in from a file in the distribution to an origin.
Date: Sat, 07 Mar 2015 11:12:08 +0000

andreas pushed a commit to branch master
in repository guix.

commit ed2b1c4f5583ebe850bedc0b275b03bdab7c9a84
Author: Andreas Enge <address@hidden>
Date:   Fri Mar 6 22:45:47 2015 +0100

    gnu: gcj: Move javac.in from a file in the distribution to an origin.
    
    * gnu/packages/javac.in: Delete file.
    * gnu-system.am (MISC_DISTRO_FILES): Delete.
    * gnu/packages/gcc.scm (javac.in): New variable.
      (gcj-4.8): Use it as an input.
---
 gnu-system.am         |    2 -
 gnu/packages/gcc.scm  |   12 ++++++++-
 gnu/packages/javac.in |   61 -------------------------------------------------
 3 files changed, 10 insertions(+), 65 deletions(-)

diff --git a/gnu-system.am b/gnu-system.am
index 9ac7f6c..5d981cb 100644
--- a/gnu-system.am
+++ b/gnu-system.am
@@ -558,8 +558,6 @@ dist_patch_DATA =                                           
\
   gnu/packages/patches/xmodmap-asprintf.patch                  \
   gnu/packages/patches/zathura-plugindir-environment-variable.patch
 
-MISC_DISTRO_FILES = gnu/packages/javac.in
-
 bootstrapdir = $(guilemoduledir)/gnu/packages/bootstrap
 bootstrap_x86_64_linuxdir = $(bootstrapdir)/x86_64-linux
 bootstrap_i686_linuxdir = $(bootstrapdir)/i686-linux
diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm
index ce37cb9..1acc4d5 100644
--- a/gnu/packages/gcc.scm
+++ b/gnu/packages/gcc.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2012, 2013, 2014 Ludovic Courtès <address@hidden>
 ;;; Copyright © 2014, 2015 Mark H Weaver <address@hidden>
 ;;; Copyright © 2014 Ricardo Wurmus <address@hidden>
+;;; Copyright © 2015 Andreas Enge <address@hidden>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -339,14 +340,21 @@ Go.  It also includes runtime support libraries for these 
languages.")
               ;; a cyclic dependency.  <http://debbugs.gnu.org/18101>
               #:separate-lib-output? #f))
 
+(define javac.in
+  (origin
+    (method url-fetch)
+    (uri (string-append "http://sources.gentoo.org/cgi-bin/viewvc.cgi/";
+                        "gentoo-x86/dev-java/gcj-jdk/files/javac.in"))
+    (sha256 (base32
+              "1c3dk4z5yfj6ic2fn3lyxs27n6pmn2wy9k0r1s17lnkf1bzkrciv"))))
+
 (define-public gcj-4.8
   (package (inherit gcc-4.8)
     (name "gcj")
     (inputs
      `(("fastjar" ,fastjar)
        ("perl" ,perl)
-       ("javac.in" ,(search-path %load-path
-                                 "gnu/packages/javac.in"))
+       ("javac.in" ,javac.in)
        ("ecj-bootstrap" ,ecj-bootstrap-4.8)
        ,@(package-inputs gcc-4.8)))
     ;; Suppress the separate "lib" output, because otherwise the
diff --git a/gnu/packages/javac.in b/gnu/packages/javac.in
deleted file mode 100644
index adb4dc1..0000000
--- a/gnu/packages/javac.in
+++ /dev/null
@@ -1,61 +0,0 @@
-#!/usr/bin/perl -w
-
-# Taken from Gentoo:
-# 
http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/dev-java/gcj-jdk/files/javac.in
-
-use strict;
-use constant NO_DUP_ARGS => qw(-source -target -d -encoding);
-use constant STRIP_ARGS => qw(-Werror -implicit:none -J-Xbootclasspath/p:);
-
-my $ECJ_WARNINGS="-nowarn";
-
-my ( @bcoption, @source15, @target15, @cp );
-push @bcoption, '-bootclasspath', '@RT_JAR@:@TOOLS_JAR@'
-    unless grep {$_ eq '-bootclasspath'} @ARGV;
-push @source15, '-source', '1.5'
-    unless grep {$_ eq '-source'} @ARGV;
-push @target15, '-target', '1.5'
-    unless grep {$_ eq '-target'} @ARGV;  
-push @cp, '-cp', '.'
-    unless grep {$_ =~ '\-c(p|lasspath)'} @ARGV or $ENV{CLASSPATH};
-my @ecj_parms = ($ECJ_WARNINGS, @bcoption, @source15, @target15, @cp);
-
-# Work around ecj's inability to handle duplicate command-line
-# options and unknown javac options.
-sub gen_ecj_opts
-{
-    my @new_args = @{$_[0]};
-
-    for my $opt (NO_DUP_ARGS) 
-    {
-       my @indices = reverse grep {$new_args[$_] eq $opt} 0..$#new_args;
-       if (@indices > 1) {
-           shift @indices;    # keep last instance only
-           splice @new_args, $_, 2 for @indices;
-       }
-    }
-
-    for my $opt (STRIP_ARGS) 
-    {
-       my @indices = reverse grep {$new_args[$_] eq $opt} 0..$#new_args;
-       splice @new_args, $_, 1 for @indices;
-    }
-
-    return address@hidden;
-}
-
-sub split_vm_args
-{
-    my @new_args = @{$_[0]};
-
-    my @vm_args = map { substr $_, 2 } grep $_ =~ /^-J/, @new_args;
-    my @javac_args = grep $_ !~ /^-J/, @new_args;
-
-    return (address@hidden, address@hidden);
-}
-
-my ($vm_args, $javac_args) = split_vm_args (gen_ecj_opts( address@hidden ));
-my @CLASSPATH = ('@ECJ_JAR@');
-push @CLASSPATH, split /:/, $ENV{"CLASSPATH"} if exists $ENV{"CLASSPATH"};
-$ENV{"CLASSPATH"} = join ':', @CLASSPATH;
-exec '@JAVA@', @$vm_args, 'org.eclipse.jdt.internal.compiler.batch.Main', 
@ecj_parms, @$javac_args;



reply via email to

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