nixpkgs/pkgs/by-name/js/jsvc/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

42 lines
1.1 KiB
Nix

{ lib, stdenv, fetchurl, commonsDaemon, jdk, makeWrapper, jre }:
stdenv.mkDerivation rec {
pname = "jsvc";
version = "1.4.0";
src = fetchurl {
url = "https://downloads.apache.org//commons/daemon/source/commons-daemon-${version}-src.tar.gz";
sha256 = "sha256-AFnx6AqmOfAsfh/4ALV9xiA2pbP0sX1h5dPj/9JCj+4=";
};
buildInputs = [ commonsDaemon ];
nativeBuildInputs = [ jdk makeWrapper ];
preConfigure = ''
cd ./src/native/unix/
sh ./support/buildconf.sh
'';
preBuild = ''
export JAVA_HOME=${jre}
'';
installPhase = ''
runHook preInstall
mkdir -p $out/bin
cp jsvc $out/bin/jsvc
chmod +x $out/bin/jsvc
wrapProgram $out/bin/jsvc --set JAVA_HOME "${jre}"
runHook postInstall
'';
meta = {
homepage = "https://commons.apache.org/proper/commons-daemon";
description = "Part of the Apache Commons Daemon software, a set of utilities and Java support classes for running Java applications as server processes";
maintainers = with lib.maintainers; [ rsynnest ];
license = lib.licenses.asl20;
platforms = with lib.platforms; unix;
mainProgram = "jsvc";
};
}