cpufetch: fix x86_64-darwin build (add sysctl.c on darwin too) (#528322)
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -30,7 +30,7 @@
|
||||
HEADERS += $(SRC_DIR)freq/freq.h
|
||||
CFLAGS += -pthread
|
||||
endif
|
||||
- ifeq ($(os), FreeBSD)
|
||||
+ ifneq (,$(filter $(os),FreeBSD Darwin))
|
||||
SOURCE += $(SRC_COMMON)sysctl.c
|
||||
HEADERS += $(SRC_COMMON)sysctl.h
|
||||
endif
|
||||
@@ -20,6 +20,15 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
installShellFiles
|
||||
];
|
||||
|
||||
# Upstream Makefile bug: for x86 builds, sysctl.c is only added to
|
||||
# SOURCE on FreeBSD even though cpuid.c calls get_sys_info_by_name
|
||||
# (defined there) on darwin too. Without this the x86_64-darwin
|
||||
# build fails to link with "Undefined symbols: _get_sys_info_by_name".
|
||||
# Widen the conditional to cover Darwin alongside FreeBSD.
|
||||
patches = lib.optionals stdenv.hostPlatform.isDarwin [
|
||||
./darwin-x86-sysctl.patch
|
||||
];
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
|
||||
Reference in New Issue
Block a user