Unverified Commit cfbf77cc authored by Weijia Wang's avatar Weijia Wang Committed by GitHub
Browse files

btop: switch to apple-sdk_15 (#352630)

parents 7821d2d1 29b57372
Loading
Loading
Loading
Loading
+26 −23
Original line number Diff line number Diff line
{ lib
, config
, stdenv
, fetchFromGitHub
, cmake
, darwin
, removeReferencesTo
, btop
, testers
, autoAddDriverRunpath
, cudaSupport ? config.cudaSupport
, rocmSupport ? config.rocmSupport
, rocmPackages
{
  lib,
  config,
  stdenv,
  fetchFromGitHub,
  cmake,
  removeReferencesTo,
  autoAddDriverRunpath,
  apple-sdk_15,
  darwinMinVersionHook,
  versionCheckHook,
  rocmPackages,
  cudaSupport ? config.cudaSupport,
  rocmSupport ? config.rocmSupport,
}:

stdenv.mkDerivation rec {
@@ -24,15 +25,17 @@ stdenv.mkDerivation rec {
    hash = "sha256-A5hOBxj8tKlkHd8zDHfDoU6fIu8gDpt3/usbiDk0/G0=";
  };

  nativeBuildInputs = [
  nativeBuildInputs =
    [
      cmake
  ] ++ lib.optionals cudaSupport [
    ]
    ++ lib.optionals cudaSupport [
      autoAddDriverRunpath
    ];

  buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [
    darwin.apple_sdk_11_0.frameworks.CoreFoundation
    darwin.apple_sdk_11_0.frameworks.IOKit
    apple-sdk_15
    (darwinMinVersionHook "10.15")
  ];

  installFlags = [ "PREFIX=$(out)" ];
@@ -46,9 +49,9 @@ stdenv.mkDerivation rec {
    patchelf --add-rpath ${lib.getLib rocmPackages.rocm-smi}/lib $out/bin/btop
  '';

  passthru.tests.version = testers.testVersion {
    package = btop;
  };
  nativeInstallCheckInputs = [ versionCheckHook ];
  versionCheckProgramArg = "--version";
  doInstallCheck = true;

  meta = with lib; {
    description = "Monitor of resources";