diff --git a/pkgs/servers/http/tomcat/axis2/builder.sh b/pkgs/servers/http/tomcat/axis2/builder.sh deleted file mode 100644 index de8e225456b4..000000000000 --- a/pkgs/servers/http/tomcat/axis2/builder.sh +++ /dev/null @@ -1,16 +0,0 @@ -if [ -e "$NIX_ATTRS_SH_FILE" ]; then . "$NIX_ATTRS_SH_FILE"; elif [ -f .attrs.sh ]; then . .attrs.sh; fi -source $stdenv/setup - -unzip $src -cd axis2-* -mkdir -p $out -cp -av * $out -cd webapp -ant -cd .. -mkdir -p $out/webapps -cp dist/axis2.war $out/webapps -cd $out/webapps -mkdir axis2 -cd axis2 -unzip ../axis2.war diff --git a/pkgs/servers/http/tomcat/axis2/default.nix b/pkgs/servers/http/tomcat/axis2/default.nix index f31841e28a03..771a38376fa9 100644 --- a/pkgs/servers/http/tomcat/axis2/default.nix +++ b/pkgs/servers/http/tomcat/axis2/default.nix @@ -1,25 +1,56 @@ -{ lib, stdenvNoCC, fetchurl, apacheAnt, jdk, unzip }: +{ + lib, + stdenvNoCC, + fetchurl, + ant, + jdk, + stripJavaArchivesHook, + unzip, + nixosTests, +}: -stdenvNoCC.mkDerivation rec { +stdenvNoCC.mkDerivation (finalAttrs: { pname = "axis2"; version = "1.8.2"; src = fetchurl { - url = "mirror://apache/axis/axis2/java/core/${version}/${pname}-${version}-bin.zip"; + url = "mirror://apache/axis/axis2/java/core/${finalAttrs.version}/axis2-${finalAttrs.version}-bin.zip"; hash = "sha256-oilPVFFpl3F61nVDxcYx/bc81FopS5fzoIdXzeP8brk="; }; - nativeBuildInputs = [ unzip ]; - buildInputs = [ apacheAnt jdk ]; - builder = ./builder.sh; + nativeBuildInputs = [ + ant + jdk + stripJavaArchivesHook + unzip + ]; + + buildPhase = '' + runHook preBuild + ant -f webapp + runHook postBuild + ''; + + installPhase = '' + runHook preInstall + + install -Dm644 dist/axis2.war -t $out/webapps + unzip $out/webapps/axis2.war -d $out/webapps/axis2 + + runHook postInstall + ''; + + passthru.tests = { + inherit (nixosTests) tomcat; + }; meta = { description = "Web Services / SOAP / WSDL engine, the successor to the widely used Apache Axis SOAP stack"; homepage = "https://axis.apache.org/axis2/java/core/"; - changelog = "https://axis.apache.org/axis2/java/core/release-notes/${version}.html"; + changelog = "https://axis.apache.org/axis2/java/core/release-notes/${finalAttrs.version}.html"; maintainers = [ lib.maintainers.anthonyroussel ]; platforms = lib.platforms.unix; sourceProvenance = with lib.sourceTypes; [ binaryBytecode ]; license = lib.licenses.asl20; }; -} +})