dadc7eb329
Whenever we create scripts that are installed to $out, we must use runtimeShell in order to get the shell that can be executed on the machine we create the package for. This is relevant for cross-compiling. The only use case for stdenv.shell are scripts that are executed as part of the build system. Usages in checkPhase are borderline however to decrease the likelyhood of people copying the wrong examples, I decided to use runtimeShell as well.
36 lines
944 B
Nix
36 lines
944 B
Nix
{ stdenv, fetchFromGitHub, ant, jdk, runtimeShell }:
|
|
|
|
stdenv.mkDerivation rec {
|
|
name = "jdepend-${version}";
|
|
version = "2.9.1";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "clarkware";
|
|
repo = "jdepend";
|
|
rev = version;
|
|
sha256 = "1sxkgj4k4dhg8vb772pvisyzb8x0gwvlfqqir30ma4zvz3rfz60p";
|
|
};
|
|
|
|
nativeBuildInputs = [ ant jdk ];
|
|
buildPhase = "ant jar";
|
|
|
|
installPhase = ''
|
|
mkdir -p $out/bin $out/share
|
|
install dist/${name}.jar $out/share
|
|
|
|
cat > "$out/bin/jdepend" <<EOF
|
|
#!${runtimeShell}
|
|
exec ${jdk.jre}/bin/java -classpath "$out/share/*" "\$@"
|
|
EOF
|
|
chmod a+x $out/bin/jdepend
|
|
'';
|
|
|
|
meta = with stdenv.lib; {
|
|
description = "Traverses Java class file directories and generates design quality metrics for each Java package";
|
|
homepage = http://www.clarkware.com/software/JDepend.html;
|
|
license = licenses.bsd3;
|
|
platforms = platforms.linux;
|
|
maintainers = with maintainers; [ pSub ];
|
|
};
|
|
}
|