findbugs: Clean up packaging

Most stuff is now hidden under $out/libexec/findbugs, with only a few
JARs exported via $out/share/java.  Also, the setup hook sets
FINDBUGS_HOME.
This commit is contained in:
Eelco Dolstra 2014-01-23 13:43:53 +01:00
parent e0000f8ad1
commit 230a00f644

View file

@ -1,4 +1,4 @@
{stdenv, fetchurl}:
{ stdenv, fetchurl }:
stdenv.mkDerivation {
name = "findbugs-2.0.3";
@ -13,9 +13,25 @@ stdenv.mkDerivation {
'';
installPhase = ''
mkdir -p $out
cp -prd bin lib plugin doc $out/
rm $out/bin/*.bat
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
'';
meta = {