diff options
author | Weijia Wang <9713184+wegank@users.noreply.github.com> | 2024-04-03 14:07:12 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-03 14:07:12 +0200 |
commit | b0079ff567903b8db769bff952d63d0971965e33 (patch) | |
tree | f96d7c413b538e7a4ab22e1322fcebfac6e2ad90 | |
parent | 1dd8ea67a355410378f85eb3b0cd2ee3710d212a (diff) | |
parent | 114975c18c7b9e3de05dc90d4798d6667eb07154 (diff) |
Merge pull request #300932 from anthonyroussel/wiremock-add-passthru-tests-version
wiremock: add passthru.tests.version, use stdenvNoCC
-rw-r--r-- | pkgs/by-name/wi/wiremock/package.nix | 36 |
1 files changed, 25 insertions, 11 deletions
diff --git a/pkgs/by-name/wi/wiremock/package.nix b/pkgs/by-name/wi/wiremock/package.nix index b474ea2556df9..577c2582df977 100644 --- a/pkgs/by-name/wi/wiremock/package.nix +++ b/pkgs/by-name/wi/wiremock/package.nix @@ -1,11 +1,19 @@ -{ lib, stdenv, fetchurl, jre, makeWrapper, gitUpdater }: - -stdenv.mkDerivation rec { +{ + fetchurl, + gitUpdater, + jre, + lib, + makeWrapper, + stdenvNoCC, + testers, +}: + +stdenvNoCC.mkDerivation (finalAttrs: { pname = "wiremock"; version = "3.5.2"; src = fetchurl { - url = "mirror://maven/org/wiremock/wiremock-standalone/${version}/wiremock-standalone-${version}.jar"; + url = "mirror://maven/org/wiremock/wiremock-standalone/${finalAttrs.version}/wiremock-standalone-${finalAttrs.version}.jar"; hash = "sha256-27DIcfP5R1Qiwl2fhvUQjFsE8pTHTv5MuFqHGa+whVY="; }; @@ -15,25 +23,31 @@ stdenv.mkDerivation rec { installPhase = '' mkdir -p "$out"/{share/wiremock,bin} - cp ${src} "$out/share/wiremock/wiremock.jar" + cp ${finalAttrs.src} "$out/share/wiremock/wiremock.jar" - makeWrapper ${jre}/bin/java $out/bin/${pname} \ + makeWrapper ${jre}/bin/java $out/bin/${finalAttrs.meta.mainProgram} \ --add-flags "-jar $out/share/wiremock/wiremock.jar" ''; - passthru.updateScript = gitUpdater { - url = "https://github.com/wiremock/wiremock.git"; - ignoredVersions = "(alpha|beta|rc).*"; + 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).*"; + }; }; meta = { description = "A flexible tool for building mock APIs"; homepage = "https://wiremock.org/"; - changelog = "https://github.com/wiremock/wiremock/releases/tag/${version}"; + changelog = "https://github.com/wiremock/wiremock/releases/tag/${finalAttrs.version}"; maintainers = with lib.maintainers; [ bobvanderlinden anthonyroussel ]; mainProgram = "wiremock"; platforms = jre.meta.platforms; sourceProvenance = with lib.sourceTypes; [ binaryBytecode ]; license = lib.licenses.asl20; }; -} +}) |