nixpkgs/pkgs/by-name/di/ditaa/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

37 lines
936 B
Nix

{ lib, stdenv, fetchurl, jre }:
stdenv.mkDerivation rec {
pname = "ditaa";
version = "0.11.0";
src = fetchurl {
url = "https://github.com/stathissideris/ditaa/releases/download/v${version}/ditaa-${version}-standalone.jar";
sha256 = "1acnl7khz8aasg230nbsx9dyf8716scgb5l3679cb2bdzxisl64l";
};
dontUnpack = true;
installPhase = ''
mkdir -p $out/bin $out/lib
cp ${src} "$out/lib/ditaa.jar"
cat > "$out/bin/ditaa" << EOF
#!${stdenv.shell}
exec ${jre}/bin/java -jar "$out/lib/ditaa.jar" "\$@"
EOF
chmod a+x "$out/bin/ditaa"
'';
meta = with lib; {
description = "Convert ascii art diagrams into proper bitmap graphics";
homepage = "https://github.com/stathissideris/ditaa";
sourceProvenance = with sourceTypes; [ binaryBytecode ];
license = licenses.lgpl3;
platforms = platforms.unix;
maintainers = [ maintainers.bjornfor ];
mainProgram = "ditaa";
};
}