mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-28 18:03:04 +00:00
Merge pull request #142123 from lourkeur/uwufetch-init
uwufetch: init at 1.7
This commit is contained in:
commit
9aedbca409
47
pkgs/tools/misc/uwufetch/default.nix
Normal file
47
pkgs/tools/misc/uwufetch/default.nix
Normal 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 ];
|
||||||
|
};
|
||||||
|
}
|
22
pkgs/tools/misc/uwufetch/fix-paths.patch
Normal file
22
pkgs/tools/misc/uwufetch/fix-paths.patch
Normal 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)
|
@ -10125,6 +10125,8 @@ with pkgs;
|
|||||||
|
|
||||||
uwsgi = callPackage ../servers/uwsgi { };
|
uwsgi = callPackage ../servers/uwsgi { };
|
||||||
|
|
||||||
|
uwufetch = callPackage ../tools/misc/uwufetch { };
|
||||||
|
|
||||||
v2ray = callPackage ../tools/networking/v2ray { };
|
v2ray = callPackage ../tools/networking/v2ray { };
|
||||||
|
|
||||||
vacuum = callPackage ../applications/networking/instant-messengers/vacuum {};
|
vacuum = callPackage ../applications/networking/instant-messengers/vacuum {};
|
||||||
|
Loading…
Reference in New Issue
Block a user