diff options
author | Louis Bettens <louis@bettens.info> | 2022-09-22 15:41:42 +0200 |
---|---|---|
committer | Louis Bettens <louis@bettens.info> | 2022-09-22 15:48:37 +0200 |
commit | fa67882db2b8c4de7150fc924f3cc43577409ccf (patch) | |
tree | 4f635b1ee89cf84cc09acc21447e57ba05ee8dd3 /pkgs/tools/misc/uwufetch | |
parent | 7efcab28238e81b47f91edcb473f8202c7a88836 (diff) |
uwufetch: 1.7 -> 2.0
Diffstat (limited to 'pkgs/tools/misc/uwufetch')
-rw-r--r-- | pkgs/tools/misc/uwufetch/default.nix | 18 | ||||
-rw-r--r-- | pkgs/tools/misc/uwufetch/fix-paths.patch | 38 |
2 files changed, 30 insertions, 26 deletions
diff --git a/pkgs/tools/misc/uwufetch/default.nix b/pkgs/tools/misc/uwufetch/default.nix index c728a0c8dbee8..03105b13e4cea 100644 --- a/pkgs/tools/misc/uwufetch/default.nix +++ b/pkgs/tools/misc/uwufetch/default.nix @@ -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 = '' diff --git a/pkgs/tools/misc/uwufetch/fix-paths.patch b/pkgs/tools/misc/uwufetch/fix-paths.patch index e79c2a1fb9d07..4869104819d63 100644 --- a/pkgs/tools/misc/uwufetch/fix-paths.patch +++ b/pkgs/tools/misc/uwufetch/fix-paths.patch @@ -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) { |