nixpkgs/pkgs/servers/http/tomcat/default.nix
2024-11-23 18:04:28 +01:00

77 lines
1.8 KiB
Nix

{
fetchurl,
gitUpdater,
jre,
lib,
nixosTests,
stdenvNoCC,
testers,
}:
let
common =
{ version, hash }:
stdenvNoCC.mkDerivation (finalAttrs: {
pname = "apache-tomcat";
inherit version;
src = fetchurl {
url = "mirror://apache/tomcat/tomcat-${lib.versions.major version}/v${version}/bin/apache-tomcat-${version}.tar.gz";
inherit hash;
};
outputs = [
"out"
"webapps"
];
installPhase = ''
mkdir $out
mv * $out
mkdir -p $webapps/webapps
mv $out/webapps $webapps/
'';
passthru = {
updateScript = gitUpdater {
url = "https://github.com/apache/tomcat.git";
allowedVersions = "^${lib.versions.major version}\\.";
ignoredVersions = "-M.*";
};
tests = {
inherit (nixosTests) tomcat;
version = testers.testVersion {
package = finalAttrs.finalPackage;
command = "JAVA_HOME=${jre} ${finalAttrs.finalPackage}/bin/version.sh";
};
};
};
meta = {
homepage = "https://tomcat.apache.org/";
description = "Implementation of the Java Servlet and JavaServer Pages technologies";
platforms = jre.meta.platforms;
maintainers = with lib.maintainers; [ anthonyroussel ];
license = lib.licenses.asl20;
sourceProvenance = with lib.sourceTypes; [ binaryBytecode ];
};
});
in
{
tomcat9 = common {
version = "9.0.97";
hash = "sha256-tV3K9poCQ38ORtlgxaQT6P7SaRUswgrWV2XTGiM6Dec=";
};
tomcat10 = common {
version = "10.1.33";
hash = "sha256-Oysh1hzVh7X4ONoYQ3Y/6qXoZP4Fl1oQHa3gki3lCJU=";
};
tomcat11 = common {
version = "11.0.0";
hash = "sha256-0MoxmvNJg49ZAJqcXtNwnwI0QgEFnbwm3OQxPulpzSA=";
};
}