uwufetch: 1.7 -> 2.0

This commit is contained in:
Louis Bettens 2022-09-22 15:41:42 +02:00
parent 7efcab2823
commit fa67882db2
2 changed files with 30 additions and 26 deletions

View File

@ -2,31 +2,29 @@
stdenv.mkDerivation rec {
pname = "uwufetch";
version = "1.7";
version = "2.0";
src = fetchFromGitHub {
owner = "TheDarkBug";
repo = pname;
rev = version;
hash = "sha256-6yfRWFKdg7wM18hD2Bn095HzpnURhZJtx+SYx8SVBLA=";
hash = "sha256-2kktKdQ1xjQRIQR2auwveHgNWGaX1jdJsdlgWrH6l2g=";
};
patches = [
# cannot find images in /usr
./fix-paths.patch
# https://github.com/TheDarkBug/uwufetch/pull/150
(fetchpatch {
url = "https://github.com/lourkeur/uwufetch/commit/de561649145b57d8750843555e4ffbc1cbcb01f0.patch";
sha256 = "sha256-KR81zxGlmthcadYBdsiVwxa5+lZUtqP7w0O4uFuputE=";
})
];
nativeBuildInputs = [ makeWrapper ];
makeFlags = [
"UWUFETCH_VERSION=${version}"
];
installFlags = [
"PREFIX=${placeholder "out"}/bin"
"LIBDIR=${placeholder "out"}/lib"
"MANDIR=${placeholder "out"}/share/man/man1"
"DESTDIR=${placeholder "out"}"
"ETC_DIR=${placeholder "out"}"
];
postPatch = ''

View File

@ -1,22 +1,28 @@
diff --git a/uwufetch.c b/uwufetch.c
index 75863a2..ab31dda 100644
index f2d7857..8191888 100644
--- a/uwufetch.c
+++ b/uwufetch.c
@@ -921,7 +921,7 @@ void print_ascii()
}
@@ -160,9 +160,9 @@ 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 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);
+ sprintf(command, "viu -t -w 18 -h 8 @out@/lib/uwufetch/%s.png 2> /dev/null", user_info->os_name);
else
{
- sprintf(ascii_file, "/usr/lib/uwufetch/ascii/%s.txt", version_name);
+ sprintf(ascii_file, "@out@/lib/uwufetch/ascii/%s.txt", version_name);
}
file = fopen(ascii_file, "r");
if (!file)
@@ -1220,7 +1220,7 @@ void print_image()
if (strcmp(version_name, "android") == 0)
sprintf(command, "viu -t -w 18 -h 8 /data/data/com.termux/files/usr/lib/uwufetch/%s.png 2> /dev/null", version_name);
else
- sprintf(command, "viu -t -w 18 -h 8 /usr/lib/uwufetch/%s.png 2> /dev/null", version_name);
+ sprintf(command, "viu -t -w 18 -h 8 @out@/lib/uwufetch/%s.png 2> /dev/null", version_name);
- 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 @out@/lib/uwufetch/%s.png 2> /dev/null", user_info->os_name); // image command for other systems
}
printf("\n");
if (system(command) != 0)
if (system(command) != 0) // if viu is not installed or the image is missing
@@ -587,9 +587,9 @@ 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 if (strcmp(user_info->os_name, "macos") == 0)
- sprintf(ascii_file, "/usr/local/lib/uwufetch/ascii/%s.txt", user_info->os_name);
+ sprintf(ascii_file, "@out@/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, "@out@/lib/uwufetch/ascii/%s.txt", user_info->os_name);
file = fopen(ascii_file, "r");
if (!file) {