depot/third_party/nixpkgs/pkgs/servers/http/tomcat/default.nix
Default email f34ce41345 Project import generated by Copybara.
GitOrigin-RevId: b73c2221a46c13557b1b3be9c2070cc42cf01eb3
2024-07-27 08:49:29 +02:00

70 lines
1.7 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.91";
hash = "sha256-DFspyh06Mbu4+ratH+7Yo3Au0yXRSDlVCmd0x2yQuFY=";
};
tomcat10 = common {
version = "10.1.26";
hash = "sha256-9z92dgE3gzszBd+xjtF0+H/qw6t49lKJoINahR18/rI=";
};
}