2024-01-02 11:29:13 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
2020-04-24 23:36:52 +00:00
|
|
|
, jdk
|
2024-01-02 11:29:13 +00:00
|
|
|
, ant
|
|
|
|
, cunit
|
|
|
|
, ncurses
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "java-service-wrapper";
|
2024-09-19 14:19:46 +00:00
|
|
|
version = "3.5.59";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://wrapper.tanukisoftware.com/download/${version}/wrapper_${version}_src.tar.gz";
|
2024-09-19 14:19:46 +00:00
|
|
|
hash = "sha256-O0fn+s3RIIriVw6sMB2nSKAGtVF0Tz6Ns4Jb9OpcbgY=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
strictDeps = true;
|
|
|
|
|
|
|
|
buildInputs = [ cunit ncurses ];
|
|
|
|
|
|
|
|
nativeBuildInputs = [ ant jdk ];
|
|
|
|
|
|
|
|
postConfigure = ''
|
|
|
|
substituteInPlace default.properties \
|
|
|
|
--replace "javac.target.version=1.4" "javac.target.version=8"
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPhase = ''
|
2022-03-05 16:20:37 +00:00
|
|
|
runHook preBuild
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
export JAVA_HOME=${jdk}/lib/openjdk/
|
2020-04-24 23:36:52 +00:00
|
|
|
export JAVA_TOOL_OPTIONS=-Djava.home=$JAVA_HOME
|
|
|
|
export CLASSPATH=${jdk}/lib/openjdk/lib/tools.jar
|
|
|
|
|
2024-09-26 11:04:55 +00:00
|
|
|
ant -f build.xml -Dbits=${if stdenv.hostPlatform.isi686 then "32" else "64"}
|
2022-03-05 16:20:37 +00:00
|
|
|
|
|
|
|
runHook postBuild
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
2022-03-05 16:20:37 +00:00
|
|
|
runHook preInstall
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
mkdir -p $out/{bin,lib}
|
|
|
|
cp bin/wrapper $out/bin/wrapper
|
|
|
|
cp lib/wrapper.jar $out/lib/wrapper.jar
|
|
|
|
cp lib/libwrapper.so $out/lib/libwrapper.so
|
2022-03-05 16:20:37 +00:00
|
|
|
|
|
|
|
runHook postInstall
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Enables a Java Application to be run as a Windows Service or Unix Daemon";
|
|
|
|
homepage = "https://wrapper.tanukisoftware.com/";
|
2022-03-05 16:20:37 +00:00
|
|
|
changelog = "https://wrapper.tanukisoftware.com/doc/english/release-notes.html#${version}";
|
|
|
|
license = licenses.gpl2Only;
|
2024-01-13 08:15:51 +00:00
|
|
|
platforms = [ "x86_64-linux" "i686-linux" "aarch64-linux" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = [ maintainers.suhr ];
|
2024-01-02 11:29:13 +00:00
|
|
|
mainProgram = "wrapper";
|
2024-02-29 20:09:43 +00:00
|
|
|
# Broken for Musl at 2024-01-17. Errors as:
|
|
|
|
# logger.c:81:12: fatal error: gnu/libc-version.h: No such file or directory
|
|
|
|
# Tracking issue: https://github.com/NixOS/nixpkgs/issues/281557
|
|
|
|
broken = stdenv.hostPlatform.isMusl;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|