uwufetch: 2.0 -> 2.1
This commit is contained in:
parent
349eefb89f
commit
c7c8258c27
|
@ -1,20 +1,31 @@
|
||||||
{ lib, stdenv, fetchFromGitHub, fetchpatch, makeWrapper, viu }:
|
{ lib, stdenv, fetchFromGitHub, makeWrapper, viu }:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "uwufetch";
|
pname = "uwufetch";
|
||||||
version = "2.0";
|
version = "2.1";
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "TheDarkBug";
|
owner = "TheDarkBug";
|
||||||
repo = pname;
|
repo = pname;
|
||||||
rev = version;
|
rev = version;
|
||||||
hash = "sha256-2kktKdQ1xjQRIQR2auwveHgNWGaX1jdJsdlgWrH6l2g=";
|
hash = "sha256-cA8sajh+puswyKikr0Jp9ei+EpVkH+vhEp+pTerkUqA=";
|
||||||
};
|
};
|
||||||
|
|
||||||
patches = [
|
postPatch = ''
|
||||||
# cannot find images in /usr
|
substituteInPlace uwufetch.c \
|
||||||
./fix-paths.patch
|
--replace "/usr/lib/uwufetch" "$out/lib/uwufetch" \
|
||||||
];
|
--replace "/usr/local/lib/uwufetch" "$out/lib/uwufetch" \
|
||||||
|
--replace "/etc/uwufetch/config" "$out/etc/uwufetch/config"
|
||||||
|
# fix command_path for package manager (nix-store)
|
||||||
|
substituteInPlace fetch.c \
|
||||||
|
--replace "/usr/bin" "/run/current-system/sw/bin"
|
||||||
|
'' + lib.optionalString stdenv.isDarwin ''
|
||||||
|
substituteInPlace Makefile \
|
||||||
|
--replace "local/bin" "bin" \
|
||||||
|
--replace "local/lib" "lib" \
|
||||||
|
--replace "local/include" "include" \
|
||||||
|
--replace "local/share" "share"
|
||||||
|
'';
|
||||||
|
|
||||||
nativeBuildInputs = [ makeWrapper ];
|
nativeBuildInputs = [ makeWrapper ];
|
||||||
|
|
||||||
|
@ -24,13 +35,9 @@ stdenv.mkDerivation rec {
|
||||||
|
|
||||||
installFlags = [
|
installFlags = [
|
||||||
"DESTDIR=${placeholder "out"}"
|
"DESTDIR=${placeholder "out"}"
|
||||||
"ETC_DIR=${placeholder "out"}"
|
"ETC_DIR=${placeholder "out"}/etc"
|
||||||
];
|
];
|
||||||
|
|
||||||
postPatch = ''
|
|
||||||
substituteAllInPlace uwufetch.c
|
|
||||||
'';
|
|
||||||
|
|
||||||
postFixup = ''
|
postFixup = ''
|
||||||
wrapProgram $out/bin/uwufetch \
|
wrapProgram $out/bin/uwufetch \
|
||||||
--prefix PATH ":" ${lib.makeBinPath [ viu ]}
|
--prefix PATH ":" ${lib.makeBinPath [ viu ]}
|
||||||
|
@ -40,6 +47,7 @@ stdenv.mkDerivation rec {
|
||||||
description = "A meme system info tool for Linux";
|
description = "A meme system info tool for Linux";
|
||||||
homepage = "https://github.com/TheDarkBug/uwufetch";
|
homepage = "https://github.com/TheDarkBug/uwufetch";
|
||||||
license = licenses.gpl3Plus;
|
license = licenses.gpl3Plus;
|
||||||
|
platforms = platforms.unix;
|
||||||
maintainers = with maintainers; [ lourkeur ];
|
maintainers = with maintainers; [ lourkeur ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,28 +0,0 @@
|
||||||
diff --git a/uwufetch.c b/uwufetch.c
|
|
||||||
index f2d7857..8191888 100644
|
|
||||||
--- a/uwufetch.c
|
|
||||||
+++ b/uwufetch.c
|
|
||||||
@@ -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(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 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) {
|
|
Loading…
Reference in a new issue