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";
|
2022-10-21 18:38:19 +00:00
|
|
|
version = "0.2.15-alpha";
|
2021-06-28 23:13:55 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/polyfy/polylith/releases/download/v${version}/poly-${version}.jar";
|
2022-10-21 18:38:19 +00:00
|
|
|
sha256 = "sha256-RAFxOwQykERpW+KEjTQDJN+XRv3JudREyBOk99A/qV8=";
|
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";
|
2022-06-16 17:23:12 +00:00
|
|
|
sourceProvenance = with sourceTypes; [ binaryBytecode ];
|
2021-06-28 23:13:55 +00:00
|
|
|
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
|
|
|
};
|
|
|
|
}
|