diff options
author | Joshua Kinard <kumba@gentoo.org> | 2003-10-02 17:06:05 +0000 |
---|---|---|
committer | Joshua Kinard <kumba@gentoo.org> | 2003-10-02 17:06:05 +0000 |
commit | 324d7d37e2c683e47784e441644dfed601f38c65 (patch) | |
tree | c944010b5671c2f1f9d7bdf99011941dd302af9e /dev-util/colorgcc | |
parent | New colorgcc revision which includes several enhancement patches; Closes Bugs... (diff) | |
download | historical-324d7d37e2c683e47784e441644dfed601f38c65.tar.gz historical-324d7d37e2c683e47784e441644dfed601f38c65.tar.bz2 historical-324d7d37e2c683e47784e441644dfed601f38c65.zip |
New colorgcc revision which includes several enhancement patches; Closes Bugs #15387 and #29178
Diffstat (limited to 'dev-util/colorgcc')
-rw-r--r-- | dev-util/colorgcc/Manifest | 4 | ||||
-rw-r--r-- | dev-util/colorgcc/colorgcc-1.3.2-r4.ebuild | 60 | ||||
-rw-r--r-- | dev-util/colorgcc/files/colorgcc-1.3.2-gentoo-one.patch | 242 | ||||
-rw-r--r-- | dev-util/colorgcc/files/colorgcc-1.3.2-gentoo-two.patch | 75 | ||||
-rw-r--r-- | dev-util/colorgcc/files/digest-colorgcc-1.3.2-r4 | 1 |
5 files changed, 380 insertions, 2 deletions
diff --git a/dev-util/colorgcc/Manifest b/dev-util/colorgcc/Manifest index ba71c412c93e..d1f9442fd4b0 100644 --- a/dev-util/colorgcc/Manifest +++ b/dev-util/colorgcc/Manifest @@ -1,8 +1,8 @@ -MD5 5d423cb35b2710c8ac5a343fba471b9b ChangeLog 1860 +MD5 fca9089f4f2320908d8992a0d3fff119 ChangeLog 1860 MD5 b993a25054795c4f899a9aac5d12cfe5 colorgcc-1.3.2-r1.ebuild 1356 MD5 46c02d119cddadead63a5e0656ac53a9 colorgcc-1.3.2-r2.ebuild 1563 MD5 af10e812e4d9c15f13c220c5866639ee colorgcc-1.3.2-r3.ebuild 1696 -MD5 0b4a5a7204d5816dfff09bd075e01327 colorgcc-1.3.2-r4.ebuild 1931 +MD5 0720af7a5d0dae36e7626b8dee2e1466 colorgcc-1.3.2-r4.ebuild 1928 MD5 ea48f2072114b79e49fec71b4b2d77c3 files/colorgcc-1.3.2-gcc_config.patch 887 MD5 4243dd3d29a55049f918a1ba04911958 files/digest-colorgcc-1.3.2-r1 139 MD5 4243dd3d29a55049f918a1ba04911958 files/digest-colorgcc-1.3.2-r2 139 diff --git a/dev-util/colorgcc/colorgcc-1.3.2-r4.ebuild b/dev-util/colorgcc/colorgcc-1.3.2-r4.ebuild new file mode 100644 index 000000000000..31af45d4d37d --- /dev/null +++ b/dev-util/colorgcc/colorgcc-1.3.2-r4.ebuild @@ -0,0 +1,60 @@ +# Copyright 1999-2003 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-util/colorgcc/colorgcc-1.3.2-r4.ebuild,v 1.1 2003/10/02 17:06:03 kumba Exp $ + +IUSE="" + +inherit eutils + +S="${WORKDIR}/${P}" +DESCRIPTION="Adds color to gcc output" +HOMEPAGE="http://www.mindspring.com/~jamoyers/software/" +SRC_URI="http://www.mindspring.com/~jamoyers/software/colorgcc/${P}.tar.gz" + +SLOT="0" +LICENSE="GPL-2" +KEYWORDS="~x86 ~sparc ~mips" + +DEPEND="dev-lang/perl" + +src_unpack() { + unpack ${A} + cd ${S} + epatch ${FILESDIR}/${P}-gentoo-one.patch + epatch ${FILESDIR}/${P}-gentoo-two.patch +} + +src_compile() { + echo ">>> Nothing to compile" +} + +src_install() { + exeinto /usr/bin + doexe colorgcc + dodir /etc/colorgcc /usr/lib/colorgcc/bin + insinto /etc/colorgcc + doins colorgccrc + einfo "Scanning for compiler front-ends" + into /usr/lib/colorgcc/bin + for a in gcc cc c++ g++ ${CHOST}-gcc ${CHOST}-c++ ${CHOST}-g++ ; do + if [ -n "$(type -p ${a})" ]; then + dosym /usr/bin/colorgcc /usr/lib/colorgcc/bin/${a} + fi + done + + dodoc COPYING CREDITS ChangeLog INSTALL +} + +pkg_postinst() { + einfo "If you have existing \$HOME/.colorgccrc files that set the location" + einfo "of the compilers, you should remove those lines for maximum" + einfo "flexibility. The colorgcc script now knows how to pass the command" + einfo "on to the next step in the PATH without manual tweaking, making it" + einfo "easier to use with things like ccache and distcc on a conditional" + einfo "basis. You can tweak the /etc/colorgcc/colorgccrc file to change" + einfo "the default settings for everyone (or copy this file as a basis for" + einfo "a custom \$HOME/.colorgccrc file). NOTE also that the symlinks for" + einfo "colorgcc are now in the /usr/lib/colorgcc/bin dir NOT the" + einfo "/usr/bin/wrapper dir. You'll need to change any PATH settings that" + einfo "referred to the old location." +} diff --git a/dev-util/colorgcc/files/colorgcc-1.3.2-gentoo-one.patch b/dev-util/colorgcc/files/colorgcc-1.3.2-gentoo-one.patch new file mode 100644 index 000000000000..68a177ba75c7 --- /dev/null +++ b/dev-util/colorgcc/files/colorgcc-1.3.2-gentoo-one.patch @@ -0,0 +1,242 @@ +--- colorgcc.orig 1999-04-29 10:16:08.000000000 -0700 ++++ colorgcc 2003-04-11 16:38:52.000000000 -0700 +@@ -88,16 +88,16 @@ + # + # 1.0.0 Initial Version + ++use strict; ++ + use Term::ANSIColor; + use IPC::Open3; ++use Cwd 'abs_path'; ++ ++my(%nocolor, %colors, %compilerPaths); + + sub initDefaults + { +- $compilerPaths{"gcc"} = "/usr/local/bin/gcc"; +- $compilerPaths{"g++"} = "/usr/local/bin/g++"; +- $compilerPaths{"cc"} = "/usr/bin/cc"; +- $compilerPaths{"c++"} = "/usr/local/bin/c++"; +- + $nocolor{"dumb"} = "true"; + + $colors{"srcColor"} = color("cyan"); +@@ -125,26 +125,26 @@ + next if (m/^\#.*/); # It's a comment. + next if (!m/(.*):\s*(.*)/); # It's not of the form "foo: bar". + +- $option = $1; +- $value = $2; ++ my $option = $1; ++ my $value = $2; + +- if ($option =~ m/cc|c\+\+|gcc|g\+\+/) +- { +- $compilerPaths{$option} = $value; +- } +- elsif ($option eq "nocolor") ++ if ($option eq "nocolor") + { + # The nocolor option lists terminal types, separated by + # spaces, not to do color on. +- foreach $termtype (split(/\s+/, $value)) ++ foreach my $term (split(' ', $value)) + { +- $nocolor{$termtype} = "true"; ++ $nocolor{$term} = 1; + } + } +- else ++ elsif (defined $colors{$option}) + { + $colors{$option} = color($value); + } ++ else ++ { ++ $compilerPaths{$option} = $value; ++ } + } + close(PREFS); + } +@@ -180,41 +180,80 @@ + initDefaults(); + + # Read the configuration file, if there is one. +-$configFile = $ENV{"HOME"} . "/.colorgccrc"; ++my $configFile = $ENV{"HOME"} . "/.colorgccrc"; + if (-f $configFile) + { + loadPreferences($configFile); + } ++elsif (-f '/etc/colorgcc/colorgccrc') ++{ ++ loadPreferences('/etc/colorgcc/colorgccrc'); ++} + + # Figure out which compiler to invoke based on our program name. + $0 =~ m%.*/(.*)$%; +-$progName = $1 || $0; +- +-$compiler = $compilerPaths{$progName} || $compilerPaths{"gcc"}; +- +-# Get the terminal type. +-$terminal = $ENV{"TERM"} || "dumb"; ++my $progName = $1 || $0; ++my $compiler_pid; + +-# If it's in the list of terminal types not to color, or if +-# we're writing to something that's not a tty, don't do color. +-if (! -t STDOUT || $nocolor{$terminal}) ++# If called as "colorgcc", just filter STDIN to STDOUT. ++if ($progName eq 'colorgcc') + { +- exec $compiler, @ARGV +- or die("Couldn't exec"); ++ open(GCCOUT, "<&STDIN"); + } ++else ++{ ++ # See if the user asked for a specific compiler. ++ my $compiler; ++ if (!defined($compiler = $compilerPaths{$progName})) ++ { ++ # Find our wrapper dir on the PATH and tweak the PATH to remove ++ # everything up-to and including our wrapper dir. ++ if ($0 =~ m#(.*)/#) ++ { ++ # We were called with an explicit path, so trim that off the PATH. ++ my $find = $1; ++ $find = abs_path($1) unless $find =~ m#^/#; ++ $ENV{'PATH'} =~ s#.*(^|:)\Q$find\E(:|$)##; ++ } ++ else ++ { ++ my(@dirs) = split(/:/, $ENV{'PATH'}); ++ while (defined($_ = shift @dirs)) ++ { ++ if (-x "$_/$progName") ++ { ++ $ENV{'PATH'} = join(':', @dirs); ++ last; ++ } ++ } ++ } ++ $compiler = $progName; ++ } + +-# Keep the pid of the compiler process so we can get its return +-# code and use that as our return code. +-$compiler_pid = open3('<&STDIN', \*GCCOUT, \*GCCOUT, $compiler, @ARGV); ++ # Get the terminal type. ++ my $terminal = $ENV{"TERM"} || "dumb"; ++ ++ # If it's in the list of terminal types not to color, or if ++ # we're writing to something that's not a tty, don't do color. ++ if (! -t STDOUT || $nocolor{$terminal}) ++ { ++ exec $compiler, @ARGV ++ or die("Couldn't exec"); ++ } ++ ++ # Keep the pid of the compiler process so we can get its return ++ # code and use that as our return code. ++ $compiler_pid = open3('<&STDIN', \*GCCOUT, \*GCCOUT, $compiler, @ARGV); ++} + + # Colorize the output from the compiler. + while(<GCCOUT>) + { +- if (m/^(.*?):([0-9]+):(.*)$/) # filename:lineno:message ++ if (m#^(.+?\.[^:/ ]+):([0-9]+):(.*)$#) # filename:lineno:message + { +- $field1 = $1 || ""; +- $field2 = $2 || ""; +- $field3 = $3 || ""; ++ my $field1 = $1 || ""; ++ my $field2 = $2 || ""; ++ my $field3 = $3 || ""; + + if ($field3 =~ m/\s+warning:.*/) + { +@@ -232,6 +271,10 @@ + } + print("\n"); + } ++ elsif (m/^:.+`.*'$/) # filename:message: ++ { ++ srcscan($_, $colors{"warningMessageColor"}); ++ } + elsif (m/^(.*?):(.+):$/) # filename:message: + { + # No line number, treat as an "introductory" line of text. +@@ -244,11 +287,9 @@ + } + } + +-# Get the return code of the compiler and exit with that. +-waitpid($compiler_pid, 0); +-exit ($? >> 8); +- +- +- +- +- ++if ($compiler_pid) ++{ ++ # Get the return code of the compiler and exit with that. ++ waitpid($compiler_pid, 0); ++ exit ($? >> 8); ++} +--- colorgccrc.orig 1999-04-29 10:16:08.000000000 -0700 ++++ colorgccrc 2003-02-12 17:38:38.000000000 -0800 +@@ -20,12 +20,14 @@ + # For example, srcColor: bold cyan on_yellow + # + +-# Define the paths to the actual location of the various compilers. ++# Only define the paths to the actual location of the various compilers if ++# you need to do something weird. For normal installs, we'll figure out ++# who to call next automatically. + # (Currently, colorgcc only understands these: g++ gcc c++ cc) +-g++: /usr/local/bin/g++ +-gcc: /usr/local/bin/gcc +-c++: /usr/local/bin/c++ +-cc: /usr/bin/cc ++##g++: /usr/bin/g++ ++##gcc: /usr/bin/gcc ++##c++: /usr/bin/c++ ++##cc: /usr/bin/cc + + # Don't do color if our terminal type ($TERM) is one of these. + # (List all terminal types on one line, seperated by whitespace.) +@@ -43,12 +45,10 @@ + + # Warnings + warningFileNameColor: reset +-warningNumberColor: white ++warningNumberColor: blue + warningMessageColor: yellow + + # Errors + errorFileNameColor: reset +-errorNumberColor: white ++errorNumberColor: blue + errorMessageColor: bold red +- +- +--- INSTALL.orig 1999-04-29 10:16:08.000000000 -0700 ++++ INSTALL 2003-04-07 17:12:25.000000000 -0700 +@@ -27,9 +27,9 @@ + When "g++" is invoked, colorgcc is run instead. colorgcc looks at the + program name to figure out which compiler to use. + +-Copy the sample colorgccrc file to $HOME/.colorgccrc and make sure the +-absolute paths for the compilers are correct for your system. +-See the comments in the sample .colorgccrc for more information. ++Modify the file /etc/colorgcc/colorgccrc if you want to change the default ++values for everyone. For individual customizations, copy this file to ++$HOME/.colorgccrc and change that. + + + Note: diff --git a/dev-util/colorgcc/files/colorgcc-1.3.2-gentoo-two.patch b/dev-util/colorgcc/files/colorgcc-1.3.2-gentoo-two.patch new file mode 100644 index 000000000000..911a31b21bf3 --- /dev/null +++ b/dev-util/colorgcc/files/colorgcc-1.3.2-gentoo-two.patch @@ -0,0 +1,75 @@ +--- colorgcc.r9 2003-09-21 12:14:48.000000000 -0700 ++++ colorgcc 2003-09-21 13:11:22.000000000 -0700 +@@ -95,6 +95,7 @@ + use Cwd 'abs_path'; + + my(%nocolor, %colors, %compilerPaths); ++my($unfinishedQuote, $previousColor); + + sub initDefaults + { +@@ -159,14 +160,37 @@ + + my($line, $normalColor) = @_; + ++ if (defined $normalColor) ++ { ++ $previousColor = $normalColor; ++ } ++ else ++ { ++ $normalColor = $previousColor; ++ } ++ + my($srcon) = color("reset") . $colors{"srcColor"}; + my($srcoff) = color("reset") . $normalColor; + +- $line = $normalColor . $line; ++ $line = ($unfinishedQuote? $srcon : $normalColor) . $line; + +- # This substitute replaces `foo' with `AfooB' where A is the escape ++ # These substitutions replaces `foo' with `AfooB' where A is the escape + # sequence that turns on the the desired source color, and B is the + # escape sequence that returns to $normalColor. ++ ++ # Handle multi-line quotes. ++ if ($unfinishedQuote) { ++ if ($line =~ s/^([^\`]*?)\'/$1$srcoff\'/) ++ { ++ $unfinishedQuote = 0; ++ } ++ } ++ if ($line =~ s/\`([^\']*?)$/\`$srcon$1/) ++ { ++ $unfinishedQuote = 1; ++ } ++ ++ # Single line quoting. + $line =~ s/\`(.*?)\'/\`$srcon$1$srcoff\'/g; + + print($line, color("reset")); +@@ -190,6 +214,10 @@ + loadPreferences('/etc/colorgcc/colorgccrc'); + } + ++# Set our default output color. This presumes that any unrecognized output ++# is an error. ++$previousColor = $colors{"errorMessageColor"}; ++ + # Figure out which compiler to invoke based on our program name. + $0 =~ m%.*/(.*)$%; + my $progName = $1 || $0; +@@ -281,10 +309,9 @@ + # No line number, treat as an "introductory" line of text. + srcscan($_, $colors{"introColor"}); + } +- else # Anything else. ++ else # Anything else. + { +- # Doesn't seem to be a warning or an error. Print normally. +- print(color("reset"), $_); ++ srcscan($_, undef); + } + } + + diff --git a/dev-util/colorgcc/files/digest-colorgcc-1.3.2-r4 b/dev-util/colorgcc/files/digest-colorgcc-1.3.2-r4 new file mode 100644 index 000000000000..3382a8413755 --- /dev/null +++ b/dev-util/colorgcc/files/digest-colorgcc-1.3.2-r4 @@ -0,0 +1 @@ +MD5 7d62f92ab99c8271c79c40a0a470e8f7 colorgcc-1.3.2.tar.gz 11076 |