From 0757cd4dbd174392156a0ac0e0753c0e356b8392 Mon Sep 17 00:00:00 2001 From: AndersonTorres Date: Tue, 23 Jun 2020 16:20:29 -0300 Subject: [PATCH] ytree: init at 2.02 ytree is a simple file manager, inspired in the venerable DOS xtree command. --- pkgs/tools/misc/ytree/default.nix | 49 +++++++++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 51 insertions(+) create mode 100644 pkgs/tools/misc/ytree/default.nix diff --git a/pkgs/tools/misc/ytree/default.nix b/pkgs/tools/misc/ytree/default.nix new file mode 100644 index 000000000000..0400e59d22ff --- /dev/null +++ b/pkgs/tools/misc/ytree/default.nix @@ -0,0 +1,49 @@ +{ stdenv +, fetchurl +, ncurses +, readline +}: + +stdenv.mkDerivation rec { + pname = "ytree"; + version = "2.02"; + + src = fetchurl { + url = "https://han.de/~werner/${pname}-${version}.tar.gz"; + sha256 = "1v70l244rc22f20gac1zha1smrhqkag45jn0iwgcyngfdfml3gz5"; + }; + + buildInputs = [ + ncurses readline + ]; + + # don't save timestamp, in order to improve reproducibility + postPatch = '' + substituteInPlace Makefile --replace 'gzip' 'gzip -n' + ''; + + preBuild = '' + makeFlagsArray+=(CC="cc" + ADD_CFLAGS="" + COLOR="-DCOLOR_SUPPORT" + CLOCK="-DCLOCK_SUPPORT" + READLINE="-DREADLINE_SUPPORT" + CFLAGS="-D_GNU_SOURCE -DWITH_UTF8 $(ADD_CFLAGS) $(COLOR) $(CLOCK) $(READLINE)" + LDFLAGS="-lncursesw -lreadline") + ''; + + installFlags = [ "DESTDIR=${placeholder "out"}" ]; + + preInstall = '' + mkdir -p $out/bin $out/share/man/man1 + ''; + + meta = with stdenv.lib; { + description = "A curses-based file manager similar to DOS Xtree(TM)"; + homepage = "https://www.han.de/~werner/ytree.html"; + license = licenses.gpl2Plus; + maintainers = with maintainers; [ AndersonTorres ]; + platforms = with platforms; unix; + }; +} +# TODO: X11 support diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 6d380d480e3a..865c2c80b4f1 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -7847,6 +7847,8 @@ in inherit (darwin.apple_sdk.frameworks) IOKit; }; + ytree = callPackage ../tools/misc/ytree { }; + yggdrasil = callPackage ../tools/networking/yggdrasil { }; # To expose more packages for Yi, override the extraPackages arg.