diff options
author | Sandro <sandro.jaeckel@gmail.com> | 2023-02-21 23:22:12 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-21 23:22:12 +0100 |
commit | 581e3f902954cbf7b6eec7b04deb41b23fcb6b7a (patch) | |
tree | fb31d703a425e39996714489a282d3b128afc788 /pkgs/tools/misc | |
parent | 5b7d323435a352fbeca4e2f7166e49aa3593a306 (diff) | |
parent | c7c8258c27c4b7fb22aa862c016e74f83c4b9812 (diff) |
Merge pull request #216340 from wineee/uwu
Diffstat (limited to 'pkgs/tools/misc')
-rw-r--r-- | pkgs/tools/misc/uwufetch/default.nix | 32 | ||||
-rw-r--r-- | pkgs/tools/misc/uwufetch/fix-paths.patch | 28 |
2 files changed, 20 insertions, 40 deletions
diff --git a/pkgs/tools/misc/uwufetch/default.nix b/pkgs/tools/misc/uwufetch/default.nix index 03105b13e4cea..f86320a59b32c 100644 --- a/pkgs/tools/misc/uwufetch/default.nix +++ b/pkgs/tools/misc/uwufetch/default.nix @@ -1,20 +1,31 @@ -{ lib, stdenv, fetchFromGitHub, fetchpatch, makeWrapper, viu }: +{ lib, stdenv, fetchFromGitHub, makeWrapper, viu }: stdenv.mkDerivation rec { pname = "uwufetch"; - version = "2.0"; + version = "2.1"; src = fetchFromGitHub { owner = "TheDarkBug"; repo = pname; rev = version; - hash = "sha256-2kktKdQ1xjQRIQR2auwveHgNWGaX1jdJsdlgWrH6l2g="; + hash = "sha256-cA8sajh+puswyKikr0Jp9ei+EpVkH+vhEp+pTerkUqA="; }; - patches = [ - # cannot find images in /usr - ./fix-paths.patch - ]; + postPatch = '' + substituteInPlace uwufetch.c \ + --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 ]; @@ -24,13 +35,9 @@ stdenv.mkDerivation rec { installFlags = [ "DESTDIR=${placeholder "out"}" - "ETC_DIR=${placeholder "out"}" + "ETC_DIR=${placeholder "out"}/etc" ]; - postPatch = '' - substituteAllInPlace uwufetch.c - ''; - postFixup = '' wrapProgram $out/bin/uwufetch \ --prefix PATH ":" ${lib.makeBinPath [ viu ]} @@ -40,6 +47,7 @@ stdenv.mkDerivation rec { description = "A meme system info tool for Linux"; homepage = "https://github.com/TheDarkBug/uwufetch"; license = licenses.gpl3Plus; + platforms = platforms.unix; maintainers = with maintainers; [ lourkeur ]; }; } diff --git a/pkgs/tools/misc/uwufetch/fix-paths.patch b/pkgs/tools/misc/uwufetch/fix-paths.patch deleted file mode 100644 index 4869104819d63..0000000000000 --- a/pkgs/tools/misc/uwufetch/fix-paths.patch +++ /dev/null @@ -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) { |