2021-10-04 12:37:57 +00:00
|
|
|
{ lib, stdenv, fetchurl, jdk, runtimeShell }:
|
2021-06-28 23:13:55 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "polylith";
|
2021-12-06 16:07:01 +00:00
|
|
|
version = "0.2.13-alpha";
|
2021-06-28 23:13:55 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/polyfy/polylith/releases/download/v${version}/poly-${version}.jar";
|
2021-12-06 16:07:01 +00:00
|
|
|
sha256 = "sha256-iLN92qurc8+D0pt7Hwag+TFGoeFl9DvEeS67sKmmoSI=";
|
2021-06-28 23:13:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
dontUnpack = true;
|
|
|
|
|
2021-10-04 12:37:57 +00:00
|
|
|
passAsFile = [ "polyWrapper" ];
|
|
|
|
polyWrapper = ''
|
2021-06-28 23:13:55 +00:00
|
|
|
#!${runtimeShell}
|
|
|
|
ARGS=""
|
2021-10-04 12:37:57 +00:00
|
|
|
while [ "$1" != "" ] ; do
|
|
|
|
ARGS="$ARGS $1"
|
2021-06-28 23:13:55 +00:00
|
|
|
shift
|
|
|
|
done
|
2021-10-04 12:37:57 +00:00
|
|
|
exec "${jdk}/bin/java" "-jar" "${src}" $ARGS
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cp "$polyWrapperPath" $out/bin/poly
|
2021-06-28 23:13:55 +00:00
|
|
|
chmod a+x $out/bin/poly
|
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
doInstallCheck = true;
|
|
|
|
installCheckPhase = ''
|
|
|
|
runHook preInstallCheck
|
|
|
|
|
|
|
|
$out/bin/poly help | fgrep -q '${version}'
|
|
|
|
|
|
|
|
runHook postInstallCheck
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "A tool used to develop Polylith based architectures in Clojure";
|
|
|
|
homepage = "https://github.com/polyfy/polylith";
|
|
|
|
license = licenses.epl10;
|
2021-10-04 12:37:57 +00:00
|
|
|
maintainers = with maintainers; [ ericdallo jlesquembre ];
|
|
|
|
platforms = jdk.meta.platforms;
|
2021-06-28 23:13:55 +00:00
|
|
|
};
|
|
|
|
}
|