Skip to content

Commit

Permalink
fastfetch: update to 2.21.3 for legacy systems
Browse files Browse the repository at this point in the history
  • Loading branch information
barracuda156 committed Aug 15, 2024
1 parent 6696606 commit 15dc90c
Show file tree
Hide file tree
Showing 24 changed files with 451 additions and 498 deletions.
58 changes: 32 additions & 26 deletions sysutils/fastfetch/Portfile
Original file line number Diff line number Diff line change
Expand Up @@ -51,44 +51,50 @@ if {${os.platform} eq "darwin" && ${os.major} < 11} {
# but since rebasing may be non-trivial,
# we keep a dedicated case for older OS
# to avoid potential breakages on every update.
github.setup fastfetch-cli fastfetch 2.21.0
github.setup fastfetch-cli fastfetch 2.21.3
revision 0
checksums rmd160 a9567e0c0773714b049e04783d2ba3cc4a179417 \
sha256 21d085a612b6bd9ab0f4e7bffe2632e313e6f67d432251cfd5a7f877b7194733 \
size 1086262
checksums rmd160 db69b939835aeb5a2ff0caf1548495f903a1d16d \
sha256 cec1f126ade7a5ef971901b1cdbe79f5864523d7a0a92732991619485d13e2e7 \
size 1093534

maintainers-append \
{@barracuda156 gmail.com:vital.had}
# Every update is tested on 10.6 for ppc.
# 2.21.0 has also been tested on 10.4–10.5.

# https://github.com/fastfetch-cli/fastfetch/issues/942
# https://github.com/fastfetch-cli/fastfetch/issues/943
# https://github.com/fastfetch-cli/fastfetch/issues/944
# https://github.com/fastfetch-cli/fastfetch/issues/1148
patch.pre_args-replace -p0 -p1
patchfiles-append \
0001-gpu_apple.m-unbreak-for-10.11.patch \
0002-memory_apple-fix-for-32-bit.patch \
0003-opengl_apple.c-fix-for-10.7.patch \
0004-sound_apple.c-fix-for-10.8.patch \
0005-monitor_apple.m-no-HDR-before-10.11.patch \
0006-gpu_apple.c-fix-for-old-systems.patch \
0007-camera_apple.m-unbreak-for-10.7.patch \
0008-brightness_apple.c-add-a-missing-include.patch \
0009-CMakeLists-adjust-for-legacy-macOS.patch \
0010-os_apple.m-etc.-fix-syntax-for-plists.patch \
0011-osascript.m-fix-syntax.patch \
0012-Fix-PowerPC-macros.patch \
0013-Fix-autorelease-pools.patch \
0014-disk_bsd-no-support-for-creation-time.patch \
0015-Support-PowerPC-CPU-detection.patch \
0016-Support-hostinfo-for-PowerPC-Macs.patch \
0017-Revert-some-breakages.patch \
0018-Fix-compatibility-with-10.4.patch

# 2.21.0 has been tested on Tiger. Leopard may not need this patch,
# but we rather disable an extra module than have this broken.
0001-Support-hostinfo-for-PowerPC-Macs.patch \
0002-version.c-add-a-missing-macro-for-powerpc.patch \
0003-Support-PowerPC-CPU-detection.patch \
0004-gpu_apple.m-unbreak-for-10.11.patch \
0005-memory_apple-fix-for-32-bit.patch \
0006-opengl_apple.c-fix-for-10.7.patch \
0007-sound_apple.c-fix-for-10.8.patch \
0008-gpu_apple.c-fix-for-old-systems.patch \
0009-camera_apple.m-unbreak-for-10.7.patch \
0010-brightness_apple.c-add-a-missing-include.patch \
0011-os_apple.m-etc.-fix-syntax-for-plists.patch \
0012-osascript.m-fix-syntax.patch \
0013-disk_bsd-no-support-for-creation-time.patch \
0014-yyjson-PowerPC-macros.patch \
0015-monitor_apple.m-no-HDR-before-10.11.patch \
0016-Fix-autorelease-pools.patch \
0017-CMakeLists-adjust-for-legacy-macOS.patch \
0018-Fix-compatibility-with-10.4.patch \
0019-Revert-some-breakages.patch

# Leopard needs this at least due to physicaldisk_apple module,
# which uses definitions from storage/IOStorageDeviceCharacteristics.h (IOKit framework);
# those only appear in 10A222 build of 10.6. When building on 10.6, please use at least
# that SDK version, or otherwise disable physicaldisk_apple (see the patch).
if {${os.major} < 10} {
patchfiles-append \
0019-Tiger-specific-adjustments-to-CMakeLists.patch
0020-Tiger-specific-adjustments-to-CMakeLists.patch
}

# To make sure OpenCL is not accidentally enabled.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
From c12d5784603bc222f48fb1866b1ef37352207aed Mon Sep 17 00:00:00 2001
From b861e7a46b54fda9af20f7d9661cda551c50824b Mon Sep 17 00:00:00 2001
From: Sergey Fedorov <[email protected]>
Date: Tue, 6 Aug 2024 01:28:18 +0800
Subject: [PATCH 16/19] Support hostinfo for PowerPC Macs
Subject: [PATCH 01/19] Support hostinfo for PowerPC Macs

---
src/detection/host/host_apple.c | 54 +++++++++++++++++++++++++++++++++
1 file changed, 54 insertions(+)

diff --git src/detection/host/host_apple.c src/detection/host/host_apple.c
diff --git a/src/detection/host/host_apple.c b/src/detection/host/host_apple.c
index 61a14e64..efc15ab5 100644
--- src/detection/host/host_apple.c
+++ src/detection/host/host_apple.c
--- a/src/detection/host/host_apple.c
+++ b/src/detection/host/host_apple.c
@@ -166,6 +166,60 @@ static const char* getProductNameWithHwModel(const FFstrbuf* hwModel)
if(ffStrEquals(version, "10,1")) return "iMac (27/21.5-inch, Late 2009)";
if(ffStrEquals(version, "9,1")) return "iMac (24/20-inch, Early 2009)";
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
From 9a5cf92cda83165b69493290b941e829ace74cb6 Mon Sep 17 00:00:00 2001
From: Sergey Fedorov <[email protected]>
Date: Tue, 6 Aug 2024 09:31:41 +0800
Subject: [PATCH 02/19] version.c: add a missing macro for powerpc

---
src/detection/version/version.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/detection/version/version.c b/src/detection/version/version.c
index 5c1fb0ae..b745b45d 100644
--- a/src/detection/version/version.c
+++ b/src/detection/version/version.c
@@ -10,7 +10,7 @@
#define FF_ARCHITECTURE "arm"
#elif defined(__mips__)
#define FF_ARCHITECTURE "mips"
-#elif defined(__powerpc__) || defined(__powerpc)
+#elif defined(__powerpc__) || defined(__powerpc) || defined(__POWERPC__)
#define FF_ARCHITECTURE "powerpc"
#elif defined(__riscv__) || defined(__riscv)
#define FF_ARCHITECTURE "riscv"
--
2.46.0

70 changes: 70 additions & 0 deletions sysutils/fastfetch/files/0003-Support-PowerPC-CPU-detection.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
From b50bb19f3ad6bc9b315b0229404b21d959b7e6f4 Mon Sep 17 00:00:00 2001
From: Sergey Fedorov <[email protected]>
Date: Sun, 4 Aug 2024 21:05:10 +0800
Subject: [PATCH 03/19] Support PowerPC CPU detection

---
src/detection/cpu/cpu.c | 11 +++++++++++
src/detection/cpu/cpu.h | 1 +
src/detection/cpu/cpu_apple.c | 11 +++++++++++
3 files changed, 23 insertions(+)

diff --git a/src/detection/cpu/cpu.c b/src/detection/cpu/cpu.c
index 68d23ac8..e9590344 100644
--- a/src/detection/cpu/cpu.c
+++ b/src/detection/cpu/cpu.c
@@ -39,3 +39,14 @@ const char* ffCPUAppleCodeToName(uint32_t code)
default: return "Apple Silicon";
}
}
+
+const char* ffCPUApplePPCCodeToName(int cpuSubType)
+{
+ switch (cpuSubType)
+ {
+ case 10: return "PowerPC 7400";
+ case 11: return "PowerPC 7450";
+ case 100: return "PowerPC 970";
+ default: return "PowerPC";
+ }
+}
diff --git a/src/detection/cpu/cpu.h b/src/detection/cpu/cpu.h
index e27a437a..753d5294 100644
--- a/src/detection/cpu/cpu.h
+++ b/src/detection/cpu/cpu.h
@@ -30,3 +30,4 @@ typedef struct FFCPUResult

const char* ffDetectCPU(const FFCPUOptions* options, FFCPUResult* cpu);
const char* ffCPUAppleCodeToName(uint32_t code);
+const char* ffCPUApplePPCCodeToName(int cpuSubType);
diff --git a/src/detection/cpu/cpu_apple.c b/src/detection/cpu/cpu_apple.c
index efdad950..6608c11b 100644
--- a/src/detection/cpu/cpu_apple.c
+++ b/src/detection/cpu/cpu_apple.c
@@ -100,12 +100,23 @@ static const char* detectCoreCount(FFCPUResult* cpu)

const char* ffDetectCPUImpl(const FFCPUOptions* options, FFCPUResult* cpu)
{
+#ifdef __POWERPC__
+ int cpuSubType;
+ size_t size = sizeof(cpuSubType);
+ if (sysctlbyname("hw.cpusubtype", &cpuSubType, &size, NULL, 0) == 0) {
+ const char *cpuName = ffCPUApplePPCCodeToName(cpuSubType);
+ ffStrbufAppendS(&cpu->name, cpuName);
+ } else {
+ return "sysctlbyname(hw.cpusubtype) failed";
+ }
+#else
if (ffSysctlGetString("machdep.cpu.brand_string", &cpu->name) != NULL)
return "sysctlbyname(machdep.cpu.brand_string) failed";

ffSysctlGetString("machdep.cpu.vendor", &cpu->vendor);
if (cpu->vendor.length == 0 && ffStrbufStartsWithS(&cpu->name, "Apple "))
ffStrbufAppendS(&cpu->vendor, "Apple");
+#endif

cpu->coresPhysical = (uint16_t) ffSysctlGetInt("hw.physicalcpu_max", 1);
if(cpu->coresPhysical == 1)
--
2.46.0

Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
From c33d7772762850674e7fea4b75d64982b7e72bae Mon Sep 17 00:00:00 2001
From b193ad96b5bfd18c8207c2f120a9b185a50bcd64 Mon Sep 17 00:00:00 2001
From: Sergey Fedorov <[email protected]>
Date: Sun, 4 Aug 2024 00:54:02 +0800
Subject: [PATCH 01/19] gpu_apple.m: unbreak for < 10.11
Subject: [PATCH 04/19] gpu_apple.m: unbreak for < 10.11

---
src/detection/gpu/gpu_apple.m | 5 +++++
1 file changed, 5 insertions(+)

diff --git src/detection/gpu/gpu_apple.m src/detection/gpu/gpu_apple.m
diff --git a/src/detection/gpu/gpu_apple.m b/src/detection/gpu/gpu_apple.m
index e5b6bebf..314f83a3 100644
--- src/detection/gpu/gpu_apple.m
+++ src/detection/gpu/gpu_apple.m
--- a/src/detection/gpu/gpu_apple.m
+++ b/src/detection/gpu/gpu_apple.m
@@ -1,5 +1,7 @@
+#include <AvailabilityMacros.h>
#include "gpu.h"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
From 3d53d9e329075cd81cd760c2e6cdc645784b527a Mon Sep 17 00:00:00 2001
From c6d2b4351450a5deabe86716fcf2fb62fd9bd628 Mon Sep 17 00:00:00 2001
From: Sergey Fedorov <[email protected]>
Date: Sun, 4 Aug 2024 00:58:05 +0800
Subject: [PATCH 02/19] memory_apple: fix for 32-bit
Subject: [PATCH 05/19] memory_apple: fix for 32-bit

---
src/detection/memory/memory_apple.c | 10 ++++++++++
1 file changed, 10 insertions(+)

diff --git src/detection/memory/memory_apple.c src/detection/memory/memory_apple.c
diff --git a/src/detection/memory/memory_apple.c b/src/detection/memory/memory_apple.c
index cabdab26..cdfdee12 100644
--- src/detection/memory/memory_apple.c
+++ src/detection/memory/memory_apple.c
--- a/src/detection/memory/memory_apple.c
+++ b/src/detection/memory/memory_apple.c
@@ -4,6 +4,7 @@
#include <mach/mach.h>
#include <sys/sysctl.h>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
From cc76fa5e9bb52596c4aaf7752143c2e0a254f3db Mon Sep 17 00:00:00 2001
From 4847acc6347c77802a8a6728557f2746b450d307 Mon Sep 17 00:00:00 2001
From: Sergey Fedorov <[email protected]>
Date: Sun, 4 Aug 2024 01:01:30 +0800
Subject: [PATCH 03/19] opengl_apple.c: fix for < 10.7
Subject: [PATCH 06/19] opengl_apple.c: fix for < 10.7

---
src/detection/opengl/opengl_apple.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git src/detection/opengl/opengl_apple.c src/detection/opengl/opengl_apple.c
diff --git a/src/detection/opengl/opengl_apple.c b/src/detection/opengl/opengl_apple.c
index c6b56f07..8c97eeda 100644
--- src/detection/opengl/opengl_apple.c
+++ src/detection/opengl/opengl_apple.c
--- a/src/detection/opengl/opengl_apple.c
+++ b/src/detection/opengl/opengl_apple.c
@@ -1,4 +1,4 @@
-
+#include <AvailabilityMacros.h>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
From 83818345c165fdec465c9b847fb899e8b79b166b Mon Sep 17 00:00:00 2001
From b346305ac72841c4c71dc5ba574e981538e4576b Mon Sep 17 00:00:00 2001
From: Sergey Fedorov <[email protected]>
Date: Sun, 4 Aug 2024 01:03:05 +0800
Subject: [PATCH 04/19] sound_apple.c: fix for < 10.8
Subject: [PATCH 07/19] sound_apple.c: fix for < 10.8

---
src/detection/sound/sound_apple.c | 5 +++++
1 file changed, 5 insertions(+)

diff --git src/detection/sound/sound_apple.c src/detection/sound/sound_apple.c
diff --git a/src/detection/sound/sound_apple.c b/src/detection/sound/sound_apple.c
index 22ecec2a..10646206 100644
--- src/detection/sound/sound_apple.c
+++ src/detection/sound/sound_apple.c
--- a/src/detection/sound/sound_apple.c
+++ b/src/detection/sound/sound_apple.c
@@ -4,6 +4,11 @@
#include <CoreAudio/CoreAudio.h>
#include <AvailabilityMacros.h>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
From 8daf1a861814da455d6bb8b4e4d4b4963f0fa11c Mon Sep 17 00:00:00 2001
From 7588bdb60d3e014bd2d591cf93f46c43fabf72b2 Mon Sep 17 00:00:00 2001
From: Sergey Fedorov <[email protected]>
Date: Sun, 4 Aug 2024 01:09:46 +0800
Subject: [PATCH 06/19] gpu_apple.c: fix for old systems
Subject: [PATCH 08/19] gpu_apple.c: fix for old systems

---
src/detection/gpu/gpu_apple.c | 3 +++
1 file changed, 3 insertions(+)

diff --git src/detection/gpu/gpu_apple.c src/detection/gpu/gpu_apple.c
diff --git a/src/detection/gpu/gpu_apple.c b/src/detection/gpu/gpu_apple.c
index 1190a636..b6fb2721 100644
--- src/detection/gpu/gpu_apple.c
+++ src/detection/gpu/gpu_apple.c
--- a/src/detection/gpu/gpu_apple.c
+++ b/src/detection/gpu/gpu_apple.c
@@ -4,6 +4,7 @@
#include "detection/temps/temps_apple.h"
#include "util/apple/cf_helpers.h"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
From a86599b498e28357abedb68756dbb10573e62ba5 Mon Sep 17 00:00:00 2001
From e1fc41a094b5755b457e54494a8616c070ce5b8b Mon Sep 17 00:00:00 2001
From: Sergey Fedorov <[email protected]>
Date: Sun, 4 Aug 2024 01:11:58 +0800
Subject: [PATCH 07/19] camera_apple.m: unbreak for < 10.7
Subject: [PATCH 09/19] camera_apple.m: unbreak for < 10.7

---
src/detection/camera/camera_apple.m | 4 ++++
1 file changed, 4 insertions(+)

diff --git src/detection/camera/camera_apple.m src/detection/camera/camera_apple.m
diff --git a/src/detection/camera/camera_apple.m b/src/detection/camera/camera_apple.m
index ab15fb99..d30c4259 100644
--- src/detection/camera/camera_apple.m
+++ src/detection/camera/camera_apple.m
--- a/src/detection/camera/camera_apple.m
+++ b/src/detection/camera/camera_apple.m
@@ -1,7 +1,11 @@
#include "camera.h"
#include "common/io/io.h"
Expand Down
Loading

0 comments on commit 15dc90c

Please sign in to comment.