uwufetch: 1.7 -> 2.0

+30 -26
+8 -10
pkgs/tools/misc/uwufetch/default.nix
··· 2 2 3 3 stdenv.mkDerivation rec { 4 4 pname = "uwufetch"; 5 - version = "1.7"; 5 + version = "2.0"; 6 6 7 7 src = fetchFromGitHub { 8 8 owner = "TheDarkBug"; 9 9 repo = pname; 10 10 rev = version; 11 - hash = "sha256-6yfRWFKdg7wM18hD2Bn095HzpnURhZJtx+SYx8SVBLA="; 11 + hash = "sha256-2kktKdQ1xjQRIQR2auwveHgNWGaX1jdJsdlgWrH6l2g="; 12 12 }; 13 13 14 14 patches = [ 15 15 # cannot find images in /usr 16 16 ./fix-paths.patch 17 - # https://github.com/TheDarkBug/uwufetch/pull/150 18 - (fetchpatch { 19 - url = "https://github.com/lourkeur/uwufetch/commit/de561649145b57d8750843555e4ffbc1cbcb01f0.patch"; 20 - sha256 = "sha256-KR81zxGlmthcadYBdsiVwxa5+lZUtqP7w0O4uFuputE="; 21 - }) 22 17 ]; 23 18 24 19 nativeBuildInputs = [ makeWrapper ]; 25 20 21 + makeFlags = [ 22 + "UWUFETCH_VERSION=${version}" 23 + ]; 24 + 26 25 installFlags = [ 27 - "PREFIX=${placeholder "out"}/bin" 28 - "LIBDIR=${placeholder "out"}/lib" 29 - "MANDIR=${placeholder "out"}/share/man/man1" 26 + "DESTDIR=${placeholder "out"}" 27 + "ETC_DIR=${placeholder "out"}" 30 28 ]; 31 29 32 30 postPatch = ''
+22 -16
pkgs/tools/misc/uwufetch/fix-paths.patch
··· 1 1 diff --git a/uwufetch.c b/uwufetch.c 2 - index 75863a2..ab31dda 100644 2 + index f2d7857..8191888 100644 3 3 --- a/uwufetch.c 4 4 +++ b/uwufetch.c 5 - @@ -921,7 +921,7 @@ void print_ascii() 6 - } 7 - else 8 - { 9 - - sprintf(ascii_file, "/usr/lib/uwufetch/ascii/%s.txt", version_name); 10 - + sprintf(ascii_file, "@out@/lib/uwufetch/ascii/%s.txt", version_name); 11 - } 12 - file = fopen(ascii_file, "r"); 13 - if (!file) 14 - @@ -1220,7 +1220,7 @@ void print_image() 15 - if (strcmp(version_name, "android") == 0) 16 - sprintf(command, "viu -t -w 18 -h 8 /data/data/com.termux/files/usr/lib/uwufetch/%s.png 2> /dev/null", version_name); 5 + @@ -160,9 +160,9 @@ void print_image(struct info* user_info) { 6 + if (strcmp(user_info->os_name, "android") == 0) 7 + 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 8 + else if (strcmp(user_info->os_name, "macos") == 0) 9 + - sprintf(command, "viu -t -w 18 -h 8 /usr/local/lib/uwufetch/%s.png 2> /dev/null", user_info->os_name); 10 + + sprintf(command, "viu -t -w 18 -h 8 @out@/lib/uwufetch/%s.png 2> /dev/null", user_info->os_name); 17 11 else 18 - - sprintf(command, "viu -t -w 18 -h 8 /usr/lib/uwufetch/%s.png 2> /dev/null", version_name); 19 - + sprintf(command, "viu -t -w 18 -h 8 @out@/lib/uwufetch/%s.png 2> /dev/null", version_name); 12 + - 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 13 + + 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 20 14 } 21 15 printf("\n"); 22 - if (system(command) != 0) 16 + if (system(command) != 0) // if viu is not installed or the image is missing 17 + @@ -587,9 +587,9 @@ void print_ascii(struct info* user_info) { 18 + if (strcmp(user_info->os_name, "android") == 0) 19 + sprintf(ascii_file, "/data/data/com.termux/files/usr/lib/uwufetch/ascii/%s.txt", user_info->os_name); 20 + else if (strcmp(user_info->os_name, "macos") == 0) 21 + - sprintf(ascii_file, "/usr/local/lib/uwufetch/ascii/%s.txt", user_info->os_name); 22 + + sprintf(ascii_file, "@out@/lib/uwufetch/ascii/%s.txt", user_info->os_name); 23 + else 24 + - sprintf(ascii_file, "/usr/lib/uwufetch/ascii/%s.txt", user_info->os_name); 25 + + sprintf(ascii_file, "@out@/lib/uwufetch/ascii/%s.txt", user_info->os_name); 26 + 27 + file = fopen(ascii_file, "r"); 28 + if (!file) {