base16-schemes: unstable-2024-06-21 -> unstable-2024-11-12 (#356361)
[NixPkgs.git] / pkgs / tools / package-management / disnix / DisnixWebService / default.nix
blobe486f0b1300e82cd2c6e8a8c2dbdd9ccbbbc9fd0
1 { lib, stdenv, fetchFromGitHub, fetchpatch, ant, jdk, xmlstarlet, axis2, dbus_java }:
3 stdenv.mkDerivation (finalAttrs: {
4   pname = "DisnixWebService";
5   version = "0.10.1";
7   src = fetchFromGitHub {
8     owner = "svanderburg";
9     repo = "DisnixWebService";
10     rev = "DisnixWebService-${finalAttrs.version}";
11     hash = "sha256-zcYr2Ytx4pevSthTQLpnQ330wDxN9dWsZA20jbO6PxQ=";
12   };
14   patches = [
15     # Correct the DisnixWebService build for compatibility with Axis2 1.8.1
16     # See https://github.com/svanderburg/DisnixWebService/pull/2
17     (fetchpatch {
18       url = "https://github.com/svanderburg/DisnixWebService/commit/cee99c6af744b5dda16728a70ebd2800f61871a0.patch";
19       hash = "sha256-4rSEN8AwivUXUCIUYFBRIoE19jVDv+Vpgakmy8fR06A=";
20     })
21   ];
23   nativeBuildInputs = [
24     ant
25     jdk
26     xmlstarlet
27   ];
29   env = {
30     PREFIX = "\${env.out}";
31     AXIS2_LIB = "${axis2}/lib";
32     AXIS2_WEBAPP = "${axis2}/webapps/axis2";
33     DBUS_JAVA_LIB = "${dbus_java}/share/java";
34   };
36   prePatch = ''
37     # add modificationtime="0" to the <jar> and <war> tasks to achieve reproducibility
38     xmlstarlet ed -L -a "//jar|//war" -t attr -n "modificationtime" -v "0" build.xml
40     sed -i -e "s|#JAVA_HOME=|JAVA_HOME=${jdk}|" \
41        -e "s|#AXIS2_LIB=|AXIS2_LIB=${axis2}/lib|" \
42         scripts/disnix-soap-client
43   '';
45   buildPhase = ''
46     runHook preBuild
47     ant
48     runHook postBuild
49   '';
51   installPhase = ''
52     runHook preInstall
53     ant install
54     runHook postInstall
55   '';
57   meta = {
58     description = "SOAP interface and client for Disnix";
59     mainProgram = "disnix-soap-client";
60     homepage = "https://github.com/svanderburg/DisnixWebService";
61     changelog = "https://github.com/svanderburg/DisnixWebService/blob/${finalAttrs.src.rev}/NEWS.txt";
62     license = lib.licenses.mit;
63     maintainers = [ lib.maintainers.sander ];
64     platforms = lib.platforms.linux;
65   };