nixpkgs/pkgs/os-specific/darwin/apple-source-releases/top/default.nix
Sergei Trofimovich 6868bb9ceb darwin.top: add -fcommon workaround
Workaround build failure on -fno-common toolchains like upstream
clang-11. Otherwise build fails as:

    duplicate symbol '_tsamp' in: main.o top.o
2022-06-05 10:11:41 +01:00

19 lines
665 B
Nix

{xcbuildHook, appleDerivation, apple_sdk, ncurses, libutil, lib}:
appleDerivation {
nativeBuildInputs = [ xcbuildHook ];
buildInputs = [ apple_sdk.frameworks.IOKit ncurses libutil ];
# Workaround build failure on -fno-common toolchains:
# duplicate symbol '_tsamp' in: main.o top.o
NIX_CFLAGS_COMPILE = "-fcommon";
NIX_LDFLAGS = "-lutil";
installPhase = ''
install -D Products/Release/libtop.a $out/lib/libtop.a
install -D Products/Release/libtop.h $out/include/libtop.h
install -D Products/Release/top $out/bin/top
'';
meta = {
platforms = lib.platforms.darwin;
maintainers = with lib.maintainers; [ matthewbauer ];
};
}