From 8762ddb6cfdc1f03f3ddea88610a1af28c46960c Mon Sep 17 00:00:00 2001 From: hellisabove <59116609+hellisabove@users.noreply.github.com> Date: Sat, 29 Jan 2022 11:39:13 +0200 Subject: [PATCH 1/4] Changed the default of '/usr/lib' to /usr/local/lib' --- Makefile | 11 +++++++---- uwufetch.c | 4 ++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 7d31a0c..5d738a0 100644 --- a/Makefile +++ b/Makefile @@ -6,8 +6,8 @@ CC = cc DESTDIR = /usr ifeq ($(shell uname), Linux) - PREFIX = bin - LIBDIR = lib + PREFIX = local/bin + LIBDIR = local/lib MANDIR = share/man/man1 else ifeq ($(shell uname), Darwin) PREFIX = local/bin @@ -16,8 +16,8 @@ else ifeq ($(shell uname), Darwin) else ifeq ($(shell uname), FreeBSD) CFLAGS += -D__FREEBSD__ CFLAGS_DEBUG += -D__FREEBSD__ - PREFIX = bin - LIBDIR = lib + PREFIX = local/bin + LIBDIR = local/lib MANDIR = share/man/man1 else ifeq ($(shell uname), windows32) CC = gcc @@ -53,6 +53,9 @@ termux_uninstall: rm -rf $(DESTDIR)/data/data/com.termux/files$(PREFIX)/$(NAME) rm -rf $(DESTDIR)/data/data/com.termux/files/usr/lib/uwufetch/ +clean: + rm $(NAME) + man: gzip --keep $(NAME).1 diff --git a/uwufetch.c b/uwufetch.c index 90aa09f..29133e3 100644 --- a/uwufetch.c +++ b/uwufetch.c @@ -326,7 +326,7 @@ void print_image(struct info* user_info) { if (strcmp(user_info->os_name, "android") == 0) sprintf(command, "viu -t -w 18 -h 8 /data/data/com.termux/files/usr/lib/uwufetch/%s.png 2> /dev/null", user_info->os_name); // image command for android else - sprintf(command, "viu -t -w 18 -h 8 /usr/lib/uwufetch/%s.png 2> /dev/null", user_info->os_name); // image command for other systems + sprintf(command, "viu -t -w 18 -h 8 /usr/local/lib/uwufetch/%s.png 2> /dev/null", user_info->os_name); // image command for other systems } printf("\n"); if (system(command) != 0) // if viu is not installed or the image is missing @@ -632,7 +632,7 @@ void print_ascii(struct info* user_info) { if (strcmp(user_info->os_name, "android") == 0) sprintf(ascii_file, "/data/data/com.termux/files/usr/lib/uwufetch/ascii/%s.txt", user_info->os_name); else - sprintf(ascii_file, "/usr/lib/uwufetch/ascii/%s.txt", user_info->os_name); + sprintf(ascii_file, "/usr/local/lib/uwufetch/ascii/%s.txt", user_info->os_name); file = fopen(ascii_file, "r"); if (!file) { From a7aa8f08b7d3e852100872a6a58cef7a1ed05b7a Mon Sep 17 00:00:00 2001 From: hellisabove <59116609+hellisabove@users.noreply.github.com> Date: Sat, 29 Jan 2022 11:39:13 +0200 Subject: [PATCH 2/4] Changed the default of '/usr/lib' to '/usr/local/lib' --- Makefile | 11 +++++++---- uwufetch.c | 4 ++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 7d31a0c..5d738a0 100644 --- a/Makefile +++ b/Makefile @@ -6,8 +6,8 @@ CC = cc DESTDIR = /usr ifeq ($(shell uname), Linux) - PREFIX = bin - LIBDIR = lib + PREFIX = local/bin + LIBDIR = local/lib MANDIR = share/man/man1 else ifeq ($(shell uname), Darwin) PREFIX = local/bin @@ -16,8 +16,8 @@ else ifeq ($(shell uname), Darwin) else ifeq ($(shell uname), FreeBSD) CFLAGS += -D__FREEBSD__ CFLAGS_DEBUG += -D__FREEBSD__ - PREFIX = bin - LIBDIR = lib + PREFIX = local/bin + LIBDIR = local/lib MANDIR = share/man/man1 else ifeq ($(shell uname), windows32) CC = gcc @@ -53,6 +53,9 @@ termux_uninstall: rm -rf $(DESTDIR)/data/data/com.termux/files$(PREFIX)/$(NAME) rm -rf $(DESTDIR)/data/data/com.termux/files/usr/lib/uwufetch/ +clean: + rm $(NAME) + man: gzip --keep $(NAME).1 diff --git a/uwufetch.c b/uwufetch.c index 90aa09f..29133e3 100644 --- a/uwufetch.c +++ b/uwufetch.c @@ -326,7 +326,7 @@ void print_image(struct info* user_info) { if (strcmp(user_info->os_name, "android") == 0) sprintf(command, "viu -t -w 18 -h 8 /data/data/com.termux/files/usr/lib/uwufetch/%s.png 2> /dev/null", user_info->os_name); // image command for android else - sprintf(command, "viu -t -w 18 -h 8 /usr/lib/uwufetch/%s.png 2> /dev/null", user_info->os_name); // image command for other systems + sprintf(command, "viu -t -w 18 -h 8 /usr/local/lib/uwufetch/%s.png 2> /dev/null", user_info->os_name); // image command for other systems } printf("\n"); if (system(command) != 0) // if viu is not installed or the image is missing @@ -632,7 +632,7 @@ void print_ascii(struct info* user_info) { if (strcmp(user_info->os_name, "android") == 0) sprintf(ascii_file, "/data/data/com.termux/files/usr/lib/uwufetch/ascii/%s.txt", user_info->os_name); else - sprintf(ascii_file, "/usr/lib/uwufetch/ascii/%s.txt", user_info->os_name); + sprintf(ascii_file, "/usr/local/lib/uwufetch/ascii/%s.txt", user_info->os_name); file = fopen(ascii_file, "r"); if (!file) { From 460a17d04d60662475b7c891f920da0e5a46e4a4 Mon Sep 17 00:00:00 2001 From: hellisabove <59116609+hellisabove@users.noreply.github.com> Date: Sat, 29 Jan 2022 12:33:19 +0200 Subject: [PATCH 3/4] macOS location is '/usr/local/lib' and the rest is back to '/usr/lib' --- Makefile | 8 ++++---- uwufetch.c | 8 ++++++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 5d738a0..fffb6e2 100644 --- a/Makefile +++ b/Makefile @@ -6,8 +6,8 @@ CC = cc DESTDIR = /usr ifeq ($(shell uname), Linux) - PREFIX = local/bin - LIBDIR = local/lib + PREFIX = bin + LIBDIR = lib MANDIR = share/man/man1 else ifeq ($(shell uname), Darwin) PREFIX = local/bin @@ -16,8 +16,8 @@ else ifeq ($(shell uname), Darwin) else ifeq ($(shell uname), FreeBSD) CFLAGS += -D__FREEBSD__ CFLAGS_DEBUG += -D__FREEBSD__ - PREFIX = local/bin - LIBDIR = local/lib + PREFIX = bin + LIBDIR = lib MANDIR = share/man/man1 else ifeq ($(shell uname), windows32) CC = gcc diff --git a/uwufetch.c b/uwufetch.c index 29133e3..1182e50 100644 --- a/uwufetch.c +++ b/uwufetch.c @@ -325,8 +325,10 @@ void print_image(struct info* user_info) { else { if (strcmp(user_info->os_name, "android") == 0) sprintf(command, "viu -t -w 18 -h 8 /data/data/com.termux/files/usr/lib/uwufetch/%s.png 2> /dev/null", user_info->os_name); // image command for android + else if (strcmp(user_info->os_name, "macos") == 0) + sprintf(command, "viu -t -w 18 -h 8 /usr/local/lib/uwufetch/%s.png 2> /dev/null", user_info->os_name); else - sprintf(command, "viu -t -w 18 -h 8 /usr/local/lib/uwufetch/%s.png 2> /dev/null", user_info->os_name); // image command for other systems + sprintf(command, "viu -t -w 18 -h 8 /usr/lib/uwufetch/%s.png 2> /dev/null", user_info->os_name); // image command for other systems } printf("\n"); if (system(command) != 0) // if viu is not installed or the image is missing @@ -631,8 +633,10 @@ void print_ascii(struct info* user_info) { if (!file) { // if the file does not exist in the local directory, open it from the installation directory if (strcmp(user_info->os_name, "android") == 0) sprintf(ascii_file, "/data/data/com.termux/files/usr/lib/uwufetch/ascii/%s.txt", user_info->os_name); - else + else if (strcmp(user_info->os_name, "macos") == 0) sprintf(ascii_file, "/usr/local/lib/uwufetch/ascii/%s.txt", user_info->os_name); + else + sprintf(ascii_file, "/usr/lib/uwufetch/ascii/%s.txt", user_info->os_name); file = fopen(ascii_file, "r"); if (!file) { From b278bec310e1c5bc8a68e4fd7b01da42ab58f12f Mon Sep 17 00:00:00 2001 From: hellisabove <59116609+hellisabove@users.noreply.github.com> Date: Sat, 29 Jan 2022 12:34:56 +0200 Subject: [PATCH 4/4] Update Makefile --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index fffb6e2..d41b969 100644 --- a/Makefile +++ b/Makefile @@ -33,7 +33,7 @@ debug: $(CC) $(CFLAGS_DEBUG) -o $(NAME) $(FILES) ./$(NAME) -install: +install: build mkdir -p $(DESTDIR)/$(PREFIX) $(DESTDIR)/$(LIBDIR)/uwufetch $(DESTDIR)/$(MANDIR) cp $(NAME) $(DESTDIR)/$(PREFIX)/$(NAME) cp -r res/* $(DESTDIR)/$(LIBDIR)/uwufetch