Unverified Commit 11ba5520 authored by Austin Horstman's avatar Austin Horstman Committed by GitHub
Browse files

btop: Fix static build (#507812)

parents 8d4e3729 0fffcbb0
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -41,8 +41,12 @@ stdenv.mkDerivation (finalAttrs: {
  # fix build on darwin (see https://github.com/NixOS/nixpkgs/pull/422218#issuecomment-3039181870 and https://github.com/aristocratos/btop/pull/1173)
  cmakeFlags = [
    (lib.cmakeBool "BTOP_LTO" (!stdenv.hostPlatform.isDarwin))
    (lib.cmakeBool "BTOP_STATIC" (stdenv.hostPlatform.isStatic))
    (lib.cmakeBool "BTOP_FORTIFY" (!stdenv.hostPlatform.isStatic))
  ];

  hardeningDisable = lib.optionals stdenv.hostPlatform.isStatic [ "fortify" ];

  postInstall = ''
    ${removeReferencesTo}/bin/remove-references-to -t ${stdenv.cc.cc} $(readlink -f $out/bin/btop)
  '';