diff --git a/pkgs/servers/http/apache-modules/mod_jk/default.nix b/pkgs/servers/http/apache-modules/mod_jk/default.nix index 22a50ea8feb6..b1134f7d3f3c 100644 --- a/pkgs/servers/http/apache-modules/mod_jk/default.nix +++ b/pkgs/servers/http/apache-modules/mod_jk/default.nix @@ -1,36 +1,52 @@ -{ lib, stdenv, fetchurl, apacheHttpd, jdk }: +{ + lib, + stdenv, + apacheHttpd, + autoreconfHook, + fetchFromGitHub, + jdk, +}: stdenv.mkDerivation rec { pname = "mod_jk"; - version = "1.2.49"; + version = "1.2.50"; - src = fetchurl { - url = "mirror://apache/tomcat/tomcat-connectors/jk/tomcat-connectors-${version}-src.tar.gz"; - hash = "sha256-Q8sCg8koeOnU7xEGMdvSvra1VxPBJ84EMZCyswh1fpw="; + src = fetchFromGitHub { + owner = "apache"; + repo = "tomcat-connectors"; + rev = "refs/tags/JK_${lib.replaceStrings [ "." ] [ "_" ] version}"; + hash = "sha256-hlwlx7Sb4oeZIzHQYOC3e9xEZK9u6ZG8Q2U/XdKMe3U="; }; + sourceRoot = "${src.name}/native"; + + nativeBuildInputs = [ autoreconfHook ]; + + buildInputs = [ + apacheHttpd + jdk + ]; + configureFlags = [ "--with-apxs=${apacheHttpd.dev}/bin/apxs" "--with-java-home=${jdk}" ]; - setSourceRoot = '' - sourceRoot=$(echo */native) - ''; - installPhase = '' + runHook preInstall + mkdir -p $out/modules cp apache-2.0/mod_jk.so $out/modules + + runHook postInstall ''; - buildInputs = [ apacheHttpd jdk ]; - - meta = with lib; { + meta = { description = "Provides web server plugins to connect web servers with Tomcat"; homepage = "https://tomcat.apache.org/download-connectors.cgi"; changelog = "https://tomcat.apache.org/connectors-doc/miscellaneous/changelog.html"; - license = licenses.asl20; - maintainers = with maintainers; [ anthonyroussel ]; - platforms = platforms.unix; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ anthonyroussel ]; + platforms = lib.platforms.unix; }; }