nixpkgs/pkgs/os-specific/darwin/apple-source-releases/top/default.nix
Artturin f9fdf2d402 treewide: move NIX_CFLAGS_COMPILE to the env attrset
with structuredAttrs lists will be bash arrays which cannot be exported
which will be a issue with some patches and some wrappers like cc-wrapper

this makes it clearer that NIX_CFLAGS_COMPILE must be a string as lists
in env cause a eval failure
2023-02-22 21:23:04 +02:00

20 lines
669 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
env.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 ];
};
}