You are not logged in.

#1 2005-10-04 17:19:16

GogglesGuy
Member
From: Rocket City
Registered: 2005-03-29
Posts: 610
Website

[Request] colorgcc

I'm suprised there is no package for this. Or at least I couln't find it.

Offline

#2 2005-10-04 17:24:56

Moo-Crumpus
Member
From: Hessen / Germany
Registered: 2003-12-01
Posts: 1,487

Re: [Request] colorgcc

make one smile


Frumpus addict
[mu'.krum.pus], [frum.pus]

Offline

#3 2005-10-04 19:43:52

pressh
Developer/TU
From: Netherlands
Registered: 2005-08-14
Posts: 1,719

Re: [Request] colorgcc

do I miss the point? why should one use it?

Offline

#4 2005-10-04 20:28:33

mpie
Member
From: 404 Not found
Registered: 2005-03-06
Posts: 649

Re: [Request] colorgcc

GogglesGuy wrote:

I'm suprised there is no package for this. Or at least I couln't find it.

Erm from what I can see this hasn't been updated for a while?

any particular reason you need colourgcc as not sure how compatibly it would be with recent versions

Offline

#5 2005-10-05 06:53:39

Snowman
Developer/Forum Fellow
From: Montreal, Canada
Registered: 2004-08-20
Posts: 5,212

Re: [Request] colorgcc

It looks that it was working with the latest gcc3.  I'll give it a try but it won't be before this week-end or much later.

Offline

#6 2005-10-06 18:37:25

GogglesGuy
Member
From: Rocket City
Registered: 2005-03-29
Posts: 610
Website

Re: [Request] colorgcc

pressh wrote:

do I miss the point? why should one use it?

I was kind of used to have the compiler output in color. You know, warnings in yellow, errors in red. Very easy to spot those things.

Offline

#7 2005-10-06 21:19:19

pressh
Developer/TU
From: Netherlands
Registered: 2005-08-14
Posts: 1,719

Re: [Request] colorgcc

GogglesGuy wrote:

I was kind of used to have the compiler output in color. You know, warnings in yellow, errors in red. Very easy to spot those things.

Okay, I'll see if I can make a working PKGBUILD for you

Offline

#8 2005-10-06 22:37:41

pressh
Developer/TU
From: Netherlands
Registered: 2005-08-14
Posts: 1,719

Re: [Request] colorgcc

It was not that much of a problem, works fine with gcc4, didn't try other compilers.
Didn't quite knew what to do with those echo messages, well, at least it should now be clear what to do.

# Contributor: pressh <pressh@gmail.com>

pkgname=colorgcc
pkgver=1.3.2
pkgrel=1
pkgdesc="A Perl wrapper to colorize the output of compilers with warning / error messages matching the gcc output format. Customizable through a ~/.colorgccrc file."
url="http://www.mindspring.com/~jamoyers/software/"
license="gpl"
source=(http://www.mindspring.com/~jamoyers/software/colorgcc/colorgcc-1.3.2.tar.gz)
depends=()
md5sums=()
conflicts=()

build() {
  mkdir $startdir/pkg/usr/ $startdir/pkg/usr/share $startdir/pkg/usr/share/$pkgname
  mv -f $startdir/src/$pkgname-$pkgver/colorgcc* $startdir/pkg/usr/share/$pkgname/
  mkdir $startdir/pkg/bin
  ln -s /usr/share/$pkgname/colorgcc $startdir/pkg/bin/gcc
  ln -s /usr/share/$pkgname/colorgcc $startdir/pkg/bin/g++
  ln -s /usr/share/$pkgname/colorgcc $startdir/pkg/bin/cc
  ln -s /usr/share/$pkgname/colorgcc $startdir/pkg/bin/c++

  echo
  echo "The following should be done after you installed this package through pacman:"
  echo "copy /usr/share/colorgcc/colorgccrc to $HOME/.colorgccrc"
  echo "make sure that if you use the compiler as root, this should be your roots home directory"
  echo "You will at least have to edit the path variables for the compilers in this file"
  echo  

}
 

[edit]
This PKGBUILD assumes that /bin is located in your path variable (/etc/profile) BEFORE /usr/bin, as this is standard in Arch

Offline

#9 2005-10-07 19:03:01

Snowman
Developer/Forum Fellow
From: Montreal, Canada
Registered: 2004-08-20
Posts: 5,212

Re: [Request] colorgcc

pressh  was quicker than me wink 
Here's a few comments about the PKGBUILD:
- the echo statements should be in an .install file.
- colorgcc  should go in /usr/bin and colorgccrc in /etc
- missing depends (perl)
- default colorgccrc could be patched to use AL paths instead of having the user change them. I assume that most users uses the official package or at least installs the gcc binaries to the same location.

I'll make these changes (plus some cosmetic changes) and post the corrected PKGBUILD & .install file.

Offline

#10 2005-10-07 19:24:01

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: [Request] colorgcc

Snowman wrote:

pressh  was quicker than me wink 
Here's a few comments about the PKGBUILD:

I think there's a reason for a few of these - the reason it cannot go into the real directory is that the files are named the same thing - I think the symlinks are being set in /bin because thatg comes *first* in most $PATH variables...

that way, running "gcc" will run the wrapper version.

The way around it, of course, is to install to /opt or something and create a profile.d script which does:
export PATH=/opt/colored/:$PATH

and not:
export PATH=$PATH:/opt/colored/

Offline

#11 2005-10-07 21:42:21

Snowman
Developer/Forum Fellow
From: Montreal, Canada
Registered: 2004-08-20
Posts: 5,212

Re: [Request] colorgcc

phrakture wrote:
Snowman wrote:

pressh  was quicker than me wink 
Here's a few comments about the PKGBUILD:

I think there's a reason for a few of these - the reason it cannot go into the real directory is that the files are named the same thing - I think the symlinks are being set in /bin because thatg comes *first* in most $PATH variables...

that way, running "gcc" will run the wrapper version.

The way around it, of course, is to install to /opt or something and create a profile.d script which does:
export PATH=/opt/colored/:$PATH

and not:
export PATH=$PATH:/opt/colored/

It is the wrapper colorgcc that should go in /usr/bin.  The links can go in /bin or in another location as you explained.  Here's my PKGBUILD below.  I'll put it in AUR unless pressh or someone else is interested in maintaining it in AUR.

pkgname=colorgcc
pkgver=1.3.2
pkgrel=1
pkgdesc="A Perl wrapper to colorize the output of compilers with warning / error messages matching the gcc output format."
url="http://www.mindspring.com/~jamoyers/software/"
license="GPL"
depends=('perl')
install=colorgcc.install
source=(http://www.mindspring.com/~jamoyers/software/colorgcc/$pkgname-$pkgver.tar.gz)
md5sums=('7d62f92ab99c8271c79c40a0a470e8f7')

build() {
  cd $startdir/src/$pkgname-$pkgver
  sed -i 's|/usr/local/bin|/usr/bin|' colorgccrc
  install -D -m644 colorgccrc $startdir/pkg/etc/colorgccrc
  install -D -m755 colorgcc $startdir/pkg/usr/bin/colorgcc

  install -d $startdir/pkg/bin
  ln -s /usr/bin/colorgcc $startdir/pkg/bin/gcc
  ln -s /usr/bin/colorgcc $startdir/pkg/bin/g++
  ln -s /usr/bin/colorgcc $startdir/pkg/bin/cc
  ln -s /usr/bin/colorgcc $startdir/pkg/bin/c++
}

colorgcc.install:

post_install() {
  cat << EOF
==> The following should be done after you installed this package through pacman:
==> copy /etc/colorgccrc to $HOME/.colorgccrc
==> Make sure that if you use the compiler as root, this should also be your roots home directory.
EOF
}

post_upgrade() {
  post_install $1
}

op=$1
shift
$op $*

Offline

#12 2005-10-08 12:26:34

pressh
Developer/TU
From: Netherlands
Registered: 2005-08-14
Posts: 1,719

Re: [Request] colorgcc

Snowman wrote:

Here's my PKGBUILD below. I'll put it in AUR unless pressh or someone else is interested in maintaining it in AUR.

It's your baby wink (Don't think collorgcc get's much upgraded though)

Offline

#13 2005-10-10 02:53:07

GogglesGuy
Member
From: Rocket City
Registered: 2005-03-29
Posts: 610
Website

Re: [Request] colorgcc

Thanks! I will try it tomorrow at work smile

Offline

#14 2005-10-10 07:23:12

Snowman
Developer/Forum Fellow
From: Montreal, Canada
Registered: 2004-08-20
Posts: 5,212

Re: [Request] colorgcc

Offline

Board footer

Powered by FluxBB