2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, fetchurl }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2021-07-21 07:28:18 +00:00
|
|
|
pname = "findbugs";
|
|
|
|
version = "3.0.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2021-07-21 07:28:18 +00:00
|
|
|
url = "mirror://sourceforge/${pname}/${pname}-${version}.tar.gz";
|
2020-04-24 23:36:52 +00:00
|
|
|
sha256 = "06b46fz4nid7qvm36r66zw01fr87y4jyz21ixw27b8hkqah0s3p8";
|
|
|
|
};
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
substituteInPlace bin/findbugs --replace /bin/pwd pwd
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
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
|
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Static analysis tool to find bugs in Java programs automatically";
|
2023-02-02 18:25:31 +00:00
|
|
|
homepage = "https://findbugs.sourceforge.net/";
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = with maintainers; [ pSub ];
|
|
|
|
platforms = with platforms; unix;
|
2022-06-16 17:23:12 +00:00
|
|
|
sourceProvenance = with sourceTypes; [ binaryBytecode ];
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.lgpl3;
|
|
|
|
};
|
|
|
|
}
|