htop: convert to an actual recipe

Builds but doesn't run. More work is needed.
This commit is contained in:
Sergei Reznikov
2016-03-25 14:48:07 +03:00
parent 465c424ede
commit 4a97ad28e2
4 changed files with 79 additions and 68 deletions

View File

@@ -1,21 +0,0 @@
DESCRIPTION="htop- an interactive process viewer for Linux"
HOMEPAGE="http://htop.sourceforge.net/"
SOURCE_URI="http://downloads.sourceforge.net/project/htop/htop/1.0.2/htop-1.0.2.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fhtop%2Ffiles%2Fhtop%2F1.0.2%2F&ts=1354198817&use_mirror=heanet"
CHECKSUM_MD5="0d01cca8df3349c74569cefebbd9919e"
REVISION="1"
STATUS_HAIKU="broken"
DEPEND=""
BUILD()
{
cd htop-1.0.2
./configure --disable-unicode --prefix=`finddir B_COMMON_DIRECTORY`
make
}
INSTALL()
{
cd htop-1.0.2
make install
}
LICENSE="GNU GPL v2"
COPYRIGHT="2004-2010 Hisham Muhammad"

View File

@@ -0,0 +1,50 @@
SUMMARY="An interactive process viewer for Unix"
DESCRIPTION="This is htop, an interactive process viewer for Unix systems. It \
is a text-mode application (for console or X terminals) and requires ncurses."
HOMEPAGE="http://hisham.hm/htop/"
COPYRIGHT="22004-2016 Hisham Muhammad"
LICENSE="GNU GPL v2"
SOURCE_URI="https://github.com/hishamhm/htop/archive/$portVersion.tar.gz"
CHECKSUM_SHA256="636c1e8b703058e793e8d25423af4b74059290ef9e48fa261ba58555069517b5"
REVISION="1"
PATCHES="htop-$portVersion.patchset"
ARCHITECTURES="!x86_gcc2 ?x86 ?x86_64"
SECONDARY_ARCHITECTURES="x86"
PROVIDES="
htop$secondaryArchSuffix = $portVersion
cmd:htop$secondaryArchSuffix = $portVersion
"
REQUIRES="
haiku$secondaryArchSuffix
lib:libncursesw$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libncursesw$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:aclocal
cmd:autoreconf
cmd:make
cmd:gcc$secondaryArchSuffix
cmd:libtoolize
cmd:pkg_config$secondaryArchSuffix
cmd:python
"
BUILD()
{
autogen.sh
sed -i 's/-lm//g' configure
CFLAGS=-D_BSD_SOURCE LDFLAGS=-lbsd runConfigure ./configure
make $jobArgs
}
INSTALL()
{
make install
}

View File

@@ -1,47 +0,0 @@
diff -Naur htop-1.0.2/configure htop-1.0.2-haiku/configure
--- htop-1.0.2/configure 2012-10-03 20:13:10.000000000 +0000
+++ htop-1.0.2-haiku/configure 2012-11-29 12:07:07.717750272 +0000
@@ -11388,13 +11388,13 @@
# Checks for libraries.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ceil in -lm" >&5
-$as_echo_n "checking for ceil in -lm... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ceil in $LIBM" >&5
+$as_echo_n "checking for ceil in $LIBM... " >&6; }
if test "${ac_cv_lib_m_ceil+set}" = set; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lm $LIBS"
+LIBS="$LIBM $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -11429,7 +11429,7 @@
#define HAVE_LIBM 1
_ACEOF
- LIBS="-lm $LIBS"
+ LIBS="$LIBM $LIBS"
else
missing_libraries="$missing_libraries libm"
diff -Naur htop-1.0.2/configure.ac htop-1.0.2-haiku/configure.ac
--- htop-1.0.2/configure.ac 2012-08-29 13:24:31.023330816 +0000
+++ htop-1.0.2-haiku/configure.ac 2012-11-29 10:13:11.320602112 +0000
@@ -1,3 +1,5 @@
+
+
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
@@ -22,7 +24,7 @@
AC_PROG_LIBTOOL
# Checks for libraries.
-AC_CHECK_LIB([m], [ceil], [], [missing_libraries="$missing_libraries libm"])
+AC_CHECK_LIB(m, cos, LIBM="$LIBM")
# Checks for header files.
AC_HEADER_DIRENT

View File

@@ -0,0 +1,29 @@
From 7c7c23526c63e255b9404e38c0cf9f3f720fe664 Mon Sep 17 00:00:00 2001
From: Sergei Reznikov <diver@gelios.net>
Date: Fri, 25 Mar 2016 14:36:50 +0300
Subject: Haiku doesn't have {get,set}priority yet
diff --git a/Process.c b/Process.c
index dddd7fc..58880b2 100644
--- a/Process.c
+++ b/Process.c
@@ -519,6 +519,7 @@ void Process_toggleTag(Process* this) {
bool Process_setPriority(Process* this, int priority) {
uid_t euid = geteuid();
seteuid(getuid());
+#ifdef HAVE_SETPRIORITY
int old_prio = getpriority(PRIO_PROCESS, this->pid);
int err = setpriority(PRIO_PROCESS, this->pid, priority);
seteuid(euid);
@@ -526,6 +527,7 @@ bool Process_setPriority(Process* this, int priority) {
this->nice = priority;
}
return (err == 0);
+#endif
}
bool Process_changePriorityBy(Process* this, size_t delta) {
--
2.7.0