2024-04-21 15:54:59 +00:00
|
|
|
{
|
|
|
|
fetchurl,
|
|
|
|
gitUpdater,
|
|
|
|
jre,
|
|
|
|
lib,
|
|
|
|
makeWrapper,
|
|
|
|
stdenvNoCC,
|
|
|
|
testers,
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenvNoCC.mkDerivation (finalAttrs: {
|
2022-12-17 10:02:37 +00:00
|
|
|
pname = "wiremock";
|
2024-06-05 15:53:02 +00:00
|
|
|
version = "3.6.0";
|
2023-11-16 04:20:00 +00:00
|
|
|
|
2022-12-17 10:02:37 +00:00
|
|
|
src = fetchurl {
|
2024-04-21 15:54:59 +00:00
|
|
|
url = "mirror://maven/org/wiremock/wiremock-standalone/${finalAttrs.version}/wiremock-standalone-${finalAttrs.version}.jar";
|
2024-06-05 15:53:02 +00:00
|
|
|
hash = "sha256-tLOiGl5/HuDbhrRyu+xZ6lL408n85MXl63lecGgok9w=";
|
2022-12-17 10:02:37 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
dontUnpack = true;
|
|
|
|
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p "$out"/{share/wiremock,bin}
|
2024-04-21 15:54:59 +00:00
|
|
|
cp ${finalAttrs.src} "$out/share/wiremock/wiremock.jar"
|
2022-12-17 10:02:37 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
makeWrapper ${jre}/bin/java $out/bin/${finalAttrs.meta.mainProgram} \
|
2022-12-17 10:02:37 +00:00
|
|
|
--add-flags "-jar $out/share/wiremock/wiremock.jar"
|
|
|
|
'';
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
passthru = {
|
|
|
|
tests.version = testers.testVersion {
|
|
|
|
command = "${lib.getExe finalAttrs.finalPackage} --version";
|
|
|
|
package = finalAttrs.finalPackage;
|
|
|
|
};
|
|
|
|
updateScript = gitUpdater {
|
|
|
|
url = "https://github.com/wiremock/wiremock.git";
|
|
|
|
ignoredVersions = "(alpha|beta|rc).*";
|
|
|
|
};
|
2023-11-16 04:20:00 +00:00
|
|
|
};
|
|
|
|
|
2022-12-17 10:02:37 +00:00
|
|
|
meta = {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Flexible tool for building mock APIs";
|
2022-12-17 10:02:37 +00:00
|
|
|
homepage = "https://wiremock.org/";
|
2024-04-21 15:54:59 +00:00
|
|
|
changelog = "https://github.com/wiremock/wiremock/releases/tag/${finalAttrs.version}";
|
2023-11-16 04:20:00 +00:00
|
|
|
maintainers = with lib.maintainers; [ bobvanderlinden anthonyroussel ];
|
|
|
|
mainProgram = "wiremock";
|
2022-12-17 10:02:37 +00:00
|
|
|
platforms = jre.meta.platforms;
|
|
|
|
sourceProvenance = with lib.sourceTypes; [ binaryBytecode ];
|
|
|
|
license = lib.licenses.asl20;
|
|
|
|
};
|
2024-04-21 15:54:59 +00:00
|
|
|
})
|