From 4b1f06b50b428af73e47e8450c1b194f13d7b921 Mon Sep 17 00:00:00 2001 From: Francesco Gazzetta Date: Thu, 16 Mar 2023 17:13:20 +0100 Subject: [PATCH] tkman: init at 2.2 --- pkgs/tools/misc/tkman/default.nix | 87 +++++++++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 89 insertions(+) create mode 100644 pkgs/tools/misc/tkman/default.nix diff --git a/pkgs/tools/misc/tkman/default.nix b/pkgs/tools/misc/tkman/default.nix new file mode 100644 index 00000000000..e178e173108 --- /dev/null +++ b/pkgs/tools/misc/tkman/default.nix @@ -0,0 +1,87 @@ +{ lib +, stdenv +, fetchzip +, fetchpatch +, makeWrapper +, makeDesktopItem +, copyDesktopItems +, tk +, groff +, rman +}: + +stdenv.mkDerivation rec { + pname = "tkman"; + version = "2.2"; + + src = fetchzip { + url = "mirror://sourceforge/tkman/tkman-${version}.tar.gz"; + hash = "sha256-S4ffz+7zmVy9+isz/8q+FV4wF5Rw2iL1ftY8RsJjRLs="; + }; + + nativeBuildInputs = [ + makeWrapper + copyDesktopItems + ]; + + patches = [(fetchpatch { + url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/app-text/tkman/files/tkman-CVE-2008-5137.diff"; + hash = "sha256-l97SY2/YnMgzHYKnVYCVJKV7oGLN1hXNpeHFlLVzTMA="; + })]; + + makeFlags = [ + "BINDIR=$(out)/bin" + "WISH=${tk}/bin/wish" + "rman=${rman}/bin/rman" + # TODO package glimpse https://github.com/gvelez17/glimpse + "glimpse=\"\"" + ]; + + preBuild = '' + makeFlagsArray+=( + 'manformat="${groff}/bin/groff -te -Tlatin1 -mandoc $$manx(longtmp) -"' + ) + ''; + + preInstall = '' + mkdir -p $out/bin + ''; + + postInstall = '' + wrapProgram $out/bin/tkman \ + --run 'export MANPATH="$(manpath)"' + rm $out/bin/retkman # doesn't work + install -Dm644 contrib/TkMan.gif $out/share/icons/hicolor/64x64/apps/tkman.gif + ''; + + desktopItems = [(makeDesktopItem { + name = "tkman"; + desktopName = "TkMan"; + comment = "Graphical man page and info viewer"; + exec = "tkman %f"; + icon = "tkman"; + terminal = false; + type = "Application"; + categories = [ "Utility" ]; + })]; + + meta = with lib; { + description = "Graphical, hypertext manual page and Texinfo browser for UNIX"; + longDescription = '' + TkMan is a graphical, hypertext manual page and Texinfo browser for UNIX. + TkMan boasts hypertext links, unmatched online text formatting and display + quality, (optional) outline view of man pages, high quality display and + superior navigational interface to Texinfo documents, a novel information + visualization mechanism called Notemarks, full text search among man pages + and Texinfo, incremental and regular expression search within pages, + regular expression search within Texinfo that shows all matches (not just + the next), robustly attached yellow highlight annotations, a shortcut/hot + list, lists of all pages in user configurable volumes, a comprehensive + Preferences panel, and man page versioning support, among many other features. + ''; + homepage = "https://tkman.sourceforge.net/index.html"; + license = licenses.artistic1; + platforms = platforms.unix; + maintainers = with maintainers; [ fgaz ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 765682bcc04..52e4b358d81 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -12732,6 +12732,8 @@ with pkgs; tiv = callPackage ../applications/misc/tiv { }; + tkman = callPackage ../tools/misc/tkman { }; + tldr = callPackage ../tools/misc/tldr { }; tldr-hs = haskellPackages.tldr;