2014-01-23 13:43:53 +01:00
|
|
|
{ stdenv, fetchurl }:
|
2008-02-25 15:55:30 +01:00
|
|
|
|
2015-03-09 19:32:00 +01:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "findbugs-3.0.1";
|
2008-02-25 15:55:30 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2015-03-09 19:32:00 +01:00
|
|
|
url = "mirror://sourceforge/findbugs/${name}.tar.gz";
|
|
|
|
sha256 = "06b46fz4nid7qvm36r66zw01fr87y4jyz21ixw27b8hkqah0s3p8";
|
2008-02-25 15:55:30 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
substituteInPlace bin/findbugs --replace /bin/pwd pwd
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
2014-01-23 13:43:53 +01:00
|
|
|
d=$out/libexec/findbugs
|
|
|
|
mkdir -p $d $out/bin $out/nix-support
|
|
|
|
|
|
|
|
cp -prd bin lib plugin doc $d/
|
|
|
|
rm $d/bin/*.bat
|
|
|
|
for i in $d/bin/*; do
|
|
|
|
if [ -f $i ]; then ln -s $i $out/bin/; fi
|
|
|
|
done
|
|
|
|
|
|
|
|
# Get rid of unnecessary JARs.
|
|
|
|
rm $d/lib/ant.jar
|
|
|
|
|
|
|
|
# Make some JARs findable.
|
|
|
|
mkdir -p $out/share/java
|
|
|
|
ln -s $d/lib/{findbugs.jar,findbugs-ant.jar} $out/share/java/
|
|
|
|
|
|
|
|
cat <<EOF > $out/nix-support/setup-hook
|
|
|
|
export FINDBUGS_HOME=$d
|
|
|
|
EOF
|
2008-02-25 15:55:30 +01:00
|
|
|
'';
|
2008-02-26 16:24:33 +01:00
|
|
|
|
2015-03-09 19:32:00 +01:00
|
|
|
meta = with stdenv.lib; {
|
2008-02-26 16:24:33 +01:00
|
|
|
description = "A static analysis tool to find bugs in Java programs automatically";
|
|
|
|
homepage = http://findbugs.sourceforge.net/;
|
2015-03-09 19:32:00 +01:00
|
|
|
maintainers = with maintainers; [ pSub ];
|
2008-02-26 16:24:33 +01:00
|
|
|
};
|
2008-02-25 15:55:30 +01:00
|
|
|
}
|