nixpkgs/pkgs/by-name/jf/jflex/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

40 lines
893 B
Nix

{lib, stdenv, fetchurl, jre} :
stdenv.mkDerivation rec {
pname = "jflex";
version = "1.9.1";
src = fetchurl {
url = "http://jflex.de/release/jflex-${version}.tar.gz";
sha256 = "sha256-4MHp7vkf9t8E1z+l6v8T86ArZ5/uFHTlzK4AciTfbfY=";
};
sourceRoot = "${pname}-${version}";
installPhase = ''
runHook preInstall
mkdir -p $out
cp -a * $out
rm -f $out/bin/jflex.bat
patchShebangs $out
sed -i -e '/^JAVA=java/ s#java#${jre}/bin/java#' $out/bin/jflex
runHook postInstall
'';
doInstallCheck = true;
installCheckPhase = ''
runHook preInstallCheck
$out/bin/jflex --version
runHook postInstallCheck
'';
meta = {
homepage = "https://www.jflex.de/";
description = "Lexical analyzer generator for Java, written in Java";
mainProgram = "jflex";
license = lib.licenses.bsd3;
platforms = lib.platforms.unix;
};
}