Merge pull request #142123 from lourkeur/uwufetch-init

uwufetch: init at 1.7
This commit is contained in:
figsoda 2021-10-19 10:23:50 -04:00 committed by GitHub
commit 9aedbca409
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 71 additions and 0 deletions

View File

@ -0,0 +1,47 @@
{ lib, stdenv, fetchFromGitHub, fetchpatch, makeWrapper, viu }:
stdenv.mkDerivation rec {
pname = "uwufetch";
version = "1.7";
src = fetchFromGitHub {
owner = "TheDarkBug";
repo = pname;
rev = version;
hash = "sha256-6yfRWFKdg7wM18hD2Bn095HzpnURhZJtx+SYx8SVBLA=";
};
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 ];
installFlags = [
"PREFIX=${placeholder "out"}/bin"
"LIBDIR=${placeholder "out"}/lib"
"MANDIR=${placeholder "out"}/share/man/man1"
];
postPatch = ''
substituteAllInPlace uwufetch.c
'';
postFixup = ''
wrapProgram $out/bin/uwufetch \
--prefix PATH ":" ${lib.makeBinPath [ viu ]}
'';
meta = with lib; {
description = "A meme system info tool for Linux";
homepage = "https://github.com/TheDarkBug/uwufetch";
license = licenses.gpl3Plus;
maintainers = with maintainers; [ lourkeur ];
};
}

View File

@ -0,0 +1,22 @@
diff --git a/uwufetch.c b/uwufetch.c
index 75863a2..ab31dda 100644
--- a/uwufetch.c
+++ b/uwufetch.c
@@ -921,7 +921,7 @@ void print_ascii()
}
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);
}
printf("\n");
if (system(command) != 0)

View File

@ -10125,6 +10125,8 @@ with pkgs;
uwsgi = callPackage ../servers/uwsgi { };
uwufetch = callPackage ../tools/misc/uwufetch { };
v2ray = callPackage ../tools/networking/v2ray { };
vacuum = callPackage ../applications/networking/instant-messengers/vacuum {};