sys-process/nvtop: new package

Nvtop stands for NVidia TOP, a (h)top like task monitor for NVIDIA GPUs. It can
handle multiple GPUs and print information about them in a htop familiar way.

Package-Manager: Portage-2.3.100, Repoman-2.3.22
Signed-off-by: Huang Rui <vowstar@gmail.com>
This commit is contained in:
Huang Rui
2020-06-13 23:24:53 +08:00
parent 0046dcc1fe
commit 30ae0e1985
5 changed files with 1257 additions and 0 deletions

View File

@@ -0,0 +1 @@
DIST nvtop-1.0.0.tar.gz 95427 BLAKE2B d54c166adb250222d2a0c848b64b62677e63845aeb4598dfb330661f5951c21043897c170abef8e9d86ad6c89a6792f1238c4dd8d86faeb4d098bf16b19c1beb SHA512 904daef1ef87a9730bda62fbea18766840bd3d38d2b51715b42c8429737519b71d3857dc342f5cd9fb66763f42ee296e57825ca6aa67d2d0accd2b8f1c7e894b

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,162 @@
diff --git a/cmake/modules/FindCurses.cmake b/cmake/modules/FindCurses.cmake
index 1002813..1ce7131 100644
--- a/cmake/modules/FindCurses.cmake
+++ b/cmake/modules/FindCurses.cmake
@@ -1,46 +1,49 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
-#.rst:
-# FindCurses
-# ----------
-#
-# Find the curses or ncurses include file and library.
-#
-# Result Variables
-# ^^^^^^^^^^^^^^^^
-#
-# This module defines the following variables:
-#
-# ``CURSES_FOUND``
-# True if Curses is found.
-# ``CURSES_INCLUDE_DIRS``
-# The include directories needed to use Curses.
-# ``CURSES_LIBRARIES``
-# The libraries needed to use Curses.
-# ``CURSES_HAVE_CURSES_H``
-# True if curses.h is available.
-# ``CURSES_HAVE_NCURSES_H``
-# True if ncurses.h is available.
-# ``CURSES_HAVE_NCURSES_NCURSES_H``
-# True if ``ncurses/ncurses.h`` is available.
-# ``CURSES_HAVE_NCURSES_CURSES_H``
-# True if ``ncurses/curses.h`` is available.
-#
-# Set ``CURSES_NEED_NCURSES`` to ``TRUE`` before the
-# ``find_package(Curses)`` call if NCurses functionality is required.
-# Set ``CURSES_NEED_WIDE`` to ``TRUE`` before the
-# ``find_package(Curses)`` call if unicode functionality is required.
-#
-# Backward Compatibility
-# ^^^^^^^^^^^^^^^^^^^^^^
-#
-# The following variable are provided for backward compatibility:
-#
-# ``CURSES_INCLUDE_DIR``
-# Path to Curses include. Use ``CURSES_INCLUDE_DIRS`` instead.
-# ``CURSES_LIBRARY``
-# Path to Curses library. Use ``CURSES_LIBRARIES`` instead.
+#[=======================================================================[.rst:
+FindCurses
+----------
+
+Find the curses or ncurses include file and library.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module defines the following variables:
+
+``CURSES_FOUND``
+ True if Curses is found.
+``CURSES_INCLUDE_DIRS``
+ The include directories needed to use Curses.
+``CURSES_LIBRARIES``
+ The libraries needed to use Curses.
+``CURSES_CFLAGS``
+ Parameters which ought be given to C/C++ compilers when using Curses.
+``CURSES_HAVE_CURSES_H``
+ True if curses.h is available.
+``CURSES_HAVE_NCURSES_H``
+ True if ncurses.h is available.
+``CURSES_HAVE_NCURSES_NCURSES_H``
+ True if ``ncurses/ncurses.h`` is available.
+``CURSES_HAVE_NCURSES_CURSES_H``
+ True if ``ncurses/curses.h`` is available.
+
+Set ``CURSES_NEED_NCURSES`` to ``TRUE`` before the
+``find_package(Curses)`` call if NCurses functionality is required.
+Set ``CURSES_NEED_WIDE`` to ``TRUE`` before the
+``find_package(Curses)`` call if unicode functionality is required.
+
+Backward Compatibility
+^^^^^^^^^^^^^^^^^^^^^^
+
+The following variable are provided for backward compatibility:
+
+``CURSES_INCLUDE_DIR``
+ Path to Curses include. Use ``CURSES_INCLUDE_DIRS`` instead.
+``CURSES_LIBRARY``
+ Path to Curses library. Use ``CURSES_LIBRARIES`` instead.
+#]=======================================================================]
include(CheckLibraryExists)
@@ -55,7 +58,7 @@ else()
set(CURSES_NEED_NCURSES TRUE)
endif()
-find_library(CURSES_CURSES_LIBRARY NAMES curses )
+find_library(CURSES_CURSES_LIBRARY NAMES curses)
find_library(CURSES_NCURSES_LIBRARY NAMES "${NCURSES_LIBRARY_NAME}" )
set(CURSES_USE_NCURSES FALSE)
@@ -117,7 +120,7 @@ if(CURSES_USE_NCURSES)
if(CURSES_NCURSES_INCLUDE_PATH)
if (CURSES_NEED_WIDE)
find_path(CURSES_INCLUDE_PATH
- NAMES ncursesw/ncurses.h ncursesw/curses.h
+ NAMES ncursesw/ncurses.h ncursesw/curses.h ncursesw.h cursesw.h
PATHS ${CURSES_NCURSES_INCLUDE_PATH}
NO_DEFAULT_PATH
)
@@ -131,16 +134,18 @@ if(CURSES_USE_NCURSES)
endif()
if (CURSES_NEED_WIDE)
+ set(CURSES_TINFO_LIBRARY_NAME tinfow)
find_path(CURSES_INCLUDE_PATH
- NAMES ncursesw/ncurses.h ncursesw/curses.h
+ NAMES ncursesw/ncurses.h ncursesw/curses.h ncursesw.h cursesw.h
HINTS "${_cursesParentDir}/include"
)
else()
+ set(CURSES_TINFO_LIBRARY_NAME tinfo)
find_path(CURSES_INCLUDE_PATH
NAMES ncurses/ncurses.h ncurses/curses.h ncurses.h curses.h
HINTS "${_cursesParentDir}/include"
)
- endif()
+ endif()
# Previous versions of FindCurses provided these values.
if(NOT DEFINED CURSES_LIBRARY)
@@ -150,8 +155,8 @@ if(CURSES_USE_NCURSES)
CHECK_LIBRARY_EXISTS("${CURSES_NCURSES_LIBRARY}"
cbreak "" CURSES_NCURSES_HAS_CBREAK)
if(NOT CURSES_NCURSES_HAS_CBREAK)
- find_library(CURSES_EXTRA_LIBRARY tinfo HINTS "${_cursesLibDir}")
- find_library(CURSES_EXTRA_LIBRARY tinfo )
+ find_library(CURSES_EXTRA_LIBRARY "${CURSES_TINFO_LIBRARY_NAME}" HINTS "${_cursesLibDir}")
+ find_library(CURSES_EXTRA_LIBRARY "${CURSES_TINFO_LIBRARY_NAME}" )
endif()
else()
get_filename_component(_cursesLibDir "${CURSES_CURSES_LIBRARY}" PATH)
@@ -237,10 +242,16 @@ if(CURSES_FORM_LIBRARY)
set(CURSES_LIBRARIES ${CURSES_LIBRARIES} ${CURSES_FORM_LIBRARY})
endif()
-# Provide the *_INCLUDE_DIRS result.
+# Provide the *_INCLUDE_DIRS and *_CFLAGS results.
set(CURSES_INCLUDE_DIRS ${CURSES_INCLUDE_PATH})
set(CURSES_INCLUDE_DIR ${CURSES_INCLUDE_PATH}) # compatibility
+find_package(PkgConfig QUIET)
+if(PKG_CONFIG_FOUND)
+ pkg_check_modules(NCURSES QUIET ${NCURSES_LIBRARY_NAME})
+ set(CURSES_CFLAGS ${NCURSES_CFLAGS_OTHER})
+endif()
+
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Curses DEFAULT_MSG
CURSES_LIBRARY CURSES_INCLUDE_PATH)

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>vowstar@gmail.com</email>
<name>Huang Rui</name>
</maintainer>
<upstream>
<remote-id type="github">Syllo/nvtop</remote-id>
</upstream>
<longdescription lang="en">
Nvtop stands for NVidia TOP, a (h)top like task monitor for NVIDIA GPUs.
It can handle multiple GPUs and print information about them in a htop
familiar way. Some fields are shown as N/A: Ask NVIDIA for better support
of your hardware! Compatibility issues: Does not work with nouveau driver
stack and older NVIDIA GPU for the time being.
</longdescription>
</pkgmetadata>

View File

@@ -0,0 +1,56 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit cmake-utils
DESCRIPTION="NVIDIA GPUs htop like monitoring tool"
HOMEPAGE="https://github.com/Syllo/nvtop"
if [[ ${PV} == "9999" ]] ; then
EGIT_REPO_URI="https://github.com/Syllo/${PN}.git"
inherit git-r3
else
SRC_URI="https://github.com/Syllo/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
KEYWORDS="~amd64 ~x86"
fi
LICENSE="GPL-3"
SLOT="0"
IUSE="unicode debug"
RDEPEND="
sys-libs/ncurses:0=[unicode?]
x11-drivers/nvidia-drivers
"
DEPEND="${RDEPEND}"
BDEPEND="
virtual/pkgconfig
"
BUILD_DIR="${WORKDIR}/build"
CMAKE_CONF="
!debug? ( -DCMAKE_BUILD_TYPE=Release )
debug? ( -DCMAKE_BUILD_TYPE=Debug )
unicode? ( -DCURSES_NEED_WIDE=TRUE )
"
PATCHES=(
"${FILESDIR}"/${PN}-1.0.0-add-nvml.patch
"${FILESDIR}"/${PN}-1.0.0-fix-ncurses.patch
)
src_configure() {
local mycmakeargs=(
-DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr"
-DNVML_INCLUDE_DIRS="${S}/include"
${CMAKE_CONF}
)
cmake-utils_src_configure
}