tomcat: format with nixfmt-rfc-style, remove with lib;

This commit is contained in:
Anthony Roussel 2024-07-14 15:21:35 +02:00
parent 8c1f535d37
commit 4796b6afab
No known key found for this signature in database
GPG Key ID: 9DC4987B1A55E75E

View File

@ -1,50 +1,63 @@
{ stdenvNoCC, lib, fetchurl, nixosTests, testers, jre, gitUpdater }:
{
fetchurl,
gitUpdater,
jre,
lib,
nixosTests,
stdenvNoCC,
testers,
}:
let
common = { version, hash }: stdenvNoCC.mkDerivation (finalAttrs: {
pname = "apache-tomcat";
inherit version;
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;
};
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 =
''
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";
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 = with lib; {
homepage = "https://tomcat.apache.org/";
description = "Implementation of the Java Servlet and JavaServer Pages technologies";
platforms = jre.meta.platforms;
maintainers = with maintainers; [ anthonyroussel ];
license = [ licenses.asl20 ];
sourceProvenance = with sourceTypes; [ binaryBytecode ];
};
});
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 {
in
{
tomcat9 = common {
version = "9.0.91";
hash = "sha256-DFspyh06Mbu4+ratH+7Yo3Au0yXRSDlVCmd0x2yQuFY=";