Fix for iphone and m1 mac builds (#172)

This commit is contained in:
TheDarkBug 2021-12-06 15:25:25 +01:00
parent 824ba3f42f
commit 794ea4f735
2 changed files with 6 additions and 6 deletions

View file

@ -50,7 +50,7 @@ To install UwUfetch from the source, type these commands in the terminal:
```shell ```shell
git clone https://github.com/TheDarkBug/uwufetch.git git clone https://github.com/TheDarkBug/uwufetch.git
cd uwufetch cd uwufetch
make build make build # add "CFLAGS+=-D__IPHONE__" if you are building for iOS
sudo make install # for termux, use `make termux` sudo make install # for termux, use `make termux`
``` ```

View file

@ -469,7 +469,7 @@ void print_info(struct configuration* config_flags, struct info* user_info) {
responsively_printf(print_buf, "%s%s%sSHEWW %s%s", responsively_printf(print_buf, "%s%s%sSHEWW %s%s",
terminal_cursor_move, NORMAL, BOLD, NORMAL, terminal_cursor_move, NORMAL, BOLD, NORMAL,
user_info->shell); user_info->shell);
#if defined(__APPLE__) && !defined(TARGET_OS_IPHONE) #if defined(__APPLE__) && !defined(__IPHONE__) // some time ago __IPHONE__ was defined as TARGET_OS_IPHONE, but it was defined also in m1 macs, so i changed it
if (config_flags->show_pkgs) if (config_flags->show_pkgs)
system( system(
"ls $(brew --cellar) | wc -l | awk -F' ' '{print \" \x1b[34mw " "ls $(brew --cellar) | wc -l | awk -F' ' '{print \" \x1b[34mw "
@ -811,7 +811,7 @@ struct info get_info()
sysctlbyname("machdep.cpu.brand_string", &cpu_buffer, sysctlbyname("machdep.cpu.brand_string", &cpu_buffer,
&cpu_buffer_len, NULL, 0); &cpu_buffer_len, NULL, 0);
#ifndef TARGET_OS_IPHONE #ifndef __IPHONE__
sprintf(user_info.version_name, "macos"); sprintf(user_info.version_name, "macos");
#else #else
sprintf(user_info.version_name, "ios"); sprintf(user_info.version_name, "ios");
@ -1194,7 +1194,7 @@ void print_ascii(
void print_image( void print_image(
struct info* user_info) { // prints logo (as an image) of the given system. struct info* user_info) { // prints logo (as an image) of the given system.
// distributions listed alphabetically. // distributions listed alphabetically.
#ifndef TARGET_OS_IPHONE #ifndef __IPHONE__
char command[256]; char command[256];
if (strlen(user_info->image_name) > 1) if (strlen(user_info->image_name) > 1)
sprintf(command, "viu -t -w 18 -h 8 %s 2> /dev/null", sprintf(command, "viu -t -w 18 -h 8 %s 2> /dev/null",
@ -1243,7 +1243,7 @@ void usage(char* arg) {
" -c --config use custom config path\n" " -c --config use custom config path\n"
" -d, --distro lets you choose the logo to print\n" " -d, --distro lets you choose the logo to print\n"
" -h, --help prints this help page\n" " -h, --help prints this help page\n"
#ifndef TARGET_OS_IPHONE #ifndef __IPHONE__
" -i, --image prints logo as image and use a custom " " -i, --image prints logo as image and use a custom "
"image if provided\n" "image if provided\n"
" %sworks in most terminals\n" " %sworks in most terminals\n"
@ -1259,7 +1259,7 @@ void usage(char* arg) {
" using the cache set $UWUFETCH_CACHE_ENABLED to TRUE, true " " using the cache set $UWUFETCH_CACHE_ENABLED to TRUE, true "
"or 1\n", "or 1\n",
arg, arg,
#ifndef TARGET_OS_IPHONE #ifndef __IPHONE__
BLUE, BLUE,
#else #else
RED, RED,