Unverified Commit 6d7b9a5d authored by Artturin's avatar Artturin Committed by GitHub
Browse files

komac: format, refactor and add version check hook (#348876)

parents 503d3f18 d1893e8c
Loading
Loading
Loading
Loading
+43 −27
Original line number Diff line number Diff line
{ lib
, stdenv
, fetchFromGitHub
, pkg-config
, openssl
, rustPlatform
, darwin
, testers
, komac
, dbus
, zstd
{
  lib,
  stdenv,
  fetchFromGitHub,
  pkg-config,
  openssl,
  rustPlatform,
  darwin,
  testers,
  komac,
  dbus,
  zstd,
  versionCheckHook,
  nix-update-script,
}:

let
@@ -16,7 +19,7 @@ let
  src = fetchFromGitHub {
    owner = "russellbanks";
    repo = "Komac";
    rev = "v${version}";
    rev = "refs/tags/v${version}";
    hash = "sha256-YFaa2kU42NlhRivBEPV1mSr3j95P4NFwUKM0Xx8tpfg=";
  };
in
@@ -29,11 +32,13 @@ rustPlatform.buildRustPackage {

  nativeBuildInputs = [ pkg-config ];

  buildInputs = [
  buildInputs =
    [
      dbus
      openssl
      zstd
  ] ++ lib.optionals stdenv.hostPlatform.isDarwin [
    ]
    ++ lib.optionals stdenv.hostPlatform.isDarwin [
      darwin.apple_sdk.frameworks.Security
      darwin.apple_sdk.frameworks.SystemConfiguration
    ];
@@ -44,19 +49,30 @@ rustPlatform.buildRustPackage {
    ZSTD_SYS_USE_PKG_CONFIG = true;
  };

  passthru.tests.version = testers.testVersion {
  doInstallCheck = true;
  nativeInstallCheckInputs = [ versionCheckHook ];
  versionCheckProgram = "${placeholder "out"}/bin/komac";

  passthru = {
    tests.version = testers.testVersion {
      inherit version;

      package = komac;
      command = "komac --version";
    };

  meta = with lib; {
    updateScript = nix-update-script { };
  };

  meta = {
    description = "Community Manifest Creator for WinGet";
    homepage = "https://github.com/russellbanks/Komac";
    changelog = "https://github.com/russellbanks/Komac/releases/tag/${src.rev}";
    license = licenses.gpl3Plus;
    maintainers = with maintainers; [ kachick HeitorAugustoLN ];
    license = lib.licenses.gpl3Plus;
    maintainers = with lib.maintainers; [
      kachick
      HeitorAugustoLN
    ];
    mainProgram = "komac";
  };
}