elasticmq-server-bin: use finalAttrs pattern
This commit is contained in:
parent
c4181f9af1
commit
302442c0f5
@ -1,41 +1,41 @@
|
||||
{ lib, stdenv, fetchurl, jdk, jre, makeWrapper, runCommand, python3Packages, writeText }:
|
||||
{ lib, stdenv, fetchurl, jdk, jre, makeBinaryWrapper, runCommand, python3Packages, writeText }:
|
||||
|
||||
let
|
||||
elasticmq-server = stdenv.mkDerivation rec {
|
||||
pname = "elasticmq-server";
|
||||
version = "1.4.2";
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "elasticmq-server";
|
||||
version = "1.4.2";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://s3-eu-west-1.amazonaws.com/softwaremill-public/${pname}-${version}.jar";
|
||||
sha256 = "sha256-71GlX8zwiC5tZm2LGSUdOa4ZDZUQQJ9zTY8viu2MQLk=";
|
||||
};
|
||||
|
||||
# don't do anything?
|
||||
unpackPhase = "${jdk}/bin/jar xf $src favicon.png";
|
||||
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin $out/share/elasticmq-server
|
||||
|
||||
cp $src $out/share/elasticmq-server/elasticmq-server.jar
|
||||
|
||||
# TODO: how to add extraArgs? current workaround is to use JAVA_TOOL_OPTIONS environment to specify properties
|
||||
makeWrapper ${jre}/bin/java $out/bin/elasticmq-server \
|
||||
--add-flags "-jar $out/share/elasticmq-server/elasticmq-server.jar"
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://github.com/softwaremill/elasticmq";
|
||||
description = "Message queueing system with Java, Scala and Amazon SQS-compatible interfaces";
|
||||
sourceProvenance = with sourceTypes; [ binaryBytecode ];
|
||||
license = licenses.asl20;
|
||||
platforms = platforms.unix;
|
||||
maintainers = with maintainers; [ peterromfeldhk ];
|
||||
};
|
||||
src = fetchurl {
|
||||
url = "https://s3-eu-west-1.amazonaws.com/softwaremill-public/${finalAttrs.pname}-${finalAttrs.version}.jar";
|
||||
sha256 = "sha256-71GlX8zwiC5tZm2LGSUdOa4ZDZUQQJ9zTY8viu2MQLk=";
|
||||
};
|
||||
in elasticmq-server.overrideAttrs (_: {
|
||||
|
||||
# don't do anything?
|
||||
unpackPhase = "${jdk}/bin/jar xf $src favicon.png";
|
||||
|
||||
nativeBuildInputs = [ makeBinaryWrapper ];
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin $out/share/elasticmq-server
|
||||
|
||||
cp $src $out/share/elasticmq-server/elasticmq-server.jar
|
||||
|
||||
# TODO: how to add extraArgs? current workaround is to use JAVA_TOOL_OPTIONS environment to specify properties
|
||||
makeWrapper ${jre}/bin/java $out/bin/elasticmq-server \
|
||||
--add-flags "-jar $out/share/elasticmq-server/elasticmq-server.jar"
|
||||
'';
|
||||
|
||||
passthru.tests.elasticmqTest = import ./elasticmq-test.nix {
|
||||
inherit elasticmq-server runCommand python3Packages writeText;
|
||||
inherit runCommand python3Packages writeText;
|
||||
elasticmq-server = finalAttrs.finalPackage;
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
description = "Message queueing system with Java, Scala and Amazon SQS-compatible interfaces";
|
||||
homepage = "https://github.com/softwaremill/elasticmq";
|
||||
changelog = "https://github.com/softwaremill/elasticmq/releases/tag/v${finalAttrs.version}";
|
||||
sourceProvenance = with sourceTypes; [ binaryBytecode ];
|
||||
license = licenses.asl20;
|
||||
platforms = platforms.unix;
|
||||
maintainers = with maintainers; [ peterromfeldhk ];
|
||||
};
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user