Util-Linux: new recipe (#1590)

This commit is contained in:
miqlas
2017-08-22 20:09:34 +02:00
committed by diversys
parent 04c072010e
commit 4e0ee3060f
2 changed files with 235 additions and 0 deletions

View File

@@ -0,0 +1,132 @@
From f9bda2ce44de1d434aee3e985b0ea88d9306434b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= <zmizsei@extrowerk.com>
Date: Tue, 22 Aug 2017 18:43:38 +0200
Subject: [PATCH] Haiku patches
---
include/c.h | 4 ++++
include/ttyutils.h | 36 ++++++++++++++++++++++++++++++++++++
lib/randutils.c | 2 ++
3 files changed, 42 insertions(+)
diff --git a/include/c.h b/include/c.h
index a5162b9..d9ffef7 100644
--- a/include/c.h
+++ b/include/c.h
@@ -29,6 +29,10 @@
# define LOGIN_NAME_MAX 256
#endif
+#ifndef _SC_HOST_NAME_MAX
+#define _SC_HOST_NAME_MAX 72
+#endif
+
/*
* Compiler-specific stuff
*/
diff --git a/include/ttyutils.h b/include/ttyutils.h
index 7278d36..f0d902f 100644
--- a/include/ttyutils.h
+++ b/include/ttyutils.h
@@ -60,15 +60,23 @@ extern int get_terminal_name(const char **path, const char **name,
static inline void reset_virtual_console(struct termios *tp, int flags)
{
/* Use defaults of <sys/ttydefaults.h> for base settings */
+#ifdef TTYDEF_IFLAG
tp->c_iflag |= TTYDEF_IFLAG;
+#endif
+#ifdef TTYDEF_OFLAG
tp->c_oflag |= TTYDEF_OFLAG;
+#endif
+#ifdef TTYDEF_LFLAG
tp->c_lflag |= TTYDEF_LFLAG;
+#endif
if ((flags & UL_TTY_KEEPCFLAGS) == 0) {
#ifdef CBAUD
tp->c_lflag &= ~CBAUD;
#endif
+#ifdef TTYDEF_CFLAG
tp->c_cflag |= (B38400 | TTYDEF_CFLAG);
+#endif
}
/* Sane setting, allow eight bit characters, no carriage return delay
@@ -114,7 +122,11 @@ static inline void reset_virtual_console(struct termios *tp, int flags)
# define FFDLY 0
#endif
+#ifdef IMAXBEL
tp->c_iflag |= (BRKINT | ICRNL | IMAXBEL);
+#else
+ tp->c_iflag |= (BRKINT | ICRNL);
+#endif
tp->c_iflag &= ~(IGNBRK | INLCR | IGNCR | IXOFF | IUCLC | IXANY | ISTRIP);
tp->c_oflag |= (OPOST | ONLCR | NL0 | CR0 | TAB0 | BS0 | VT0 | FF0);
tp->c_oflag &= ~(OLCUC | OCRNL | ONOCR | ONLRET | OFILL | \
@@ -144,24 +156,48 @@ static inline void reset_virtual_console(struct termios *tp, int flags)
*/
tp->c_cc[VTIME] = 0;
tp->c_cc[VMIN] = 1;
+#ifdef CINTR
tp->c_cc[VINTR] = CINTR;
+#endif
+#ifdef CQUIT
tp->c_cc[VQUIT] = CQUIT;
+#endif
+#ifdef CERASE
tp->c_cc[VERASE] = CERASE; /* ASCII DEL (0177) */
+#endif
+#ifdef CKILL
tp->c_cc[VKILL] = CKILL;
+#endif
+#ifdef CEOF
tp->c_cc[VEOF] = CEOF;
+#endif
#ifdef VSWTC
tp->c_cc[VSWTC] = _POSIX_VDISABLE;
#elif defined(VSWTCH)
tp->c_cc[VSWTCH] = _POSIX_VDISABLE;
#endif
+#ifdef CSTART
tp->c_cc[VSTART] = CSTART;
+#endif
+#ifdef CSTOP
tp->c_cc[VSTOP] = CSTOP;
+#endif
+#ifdef CSUSP
tp->c_cc[VSUSP] = CSUSP;
+#endif
tp->c_cc[VEOL] = _POSIX_VDISABLE;
+#ifdef VREPRINT
tp->c_cc[VREPRINT] = CREPRINT;
+#endif
+#ifdef VDISCARD
tp->c_cc[VDISCARD] = CDISCARD;
+#endif
+#ifdef VWERASE
tp->c_cc[VWERASE] = CWERASE;
+#endif
+#ifdef CLNEXT
tp->c_cc[VLNEXT] = CLNEXT;
+#endif
tp->c_cc[VEOL2] = _POSIX_VDISABLE;
}
diff --git a/lib/randutils.c b/lib/randutils.c
index 09dd261..cc7ac1f 100644
--- a/lib/randutils.c
+++ b/lib/randutils.c
@@ -13,7 +13,9 @@
#include <string.h>
#include <sys/time.h>
+#ifndef __HAIKU__
#include <sys/syscall.h>
+#endif
#include "c.h"
#include "randutils.h"
--
2.14.1

View File

@@ -0,0 +1,103 @@
SUMMARY="A random collection of Linux utilities"
DESCRIPTION="Various useful Linux utilities."
HOMEPAGE="https://www.kernel.org/pub/linux/utils/util-linux/"
COPYRIGHT="Various Authors"
LICENSE="GNU GPL v2
GNU LGPL v2
BSD (4-clause)
Public Domain"
REVISION="1"
SOURCE_URI="https://www.kernel.org/pub/linux/utils/util-linux/v2.30/util-linux-$portVersion.tar.gz"
CHECKSUM_SHA256="88bb1d08f0d67fb1b548c3e2160f7f40fb552cdf6b771a5dd1b94e1e04fc1d9a"
SOURCE_DIR="util-linux-$portVersion"
PATCHES="util_linux-$portVersion.patchset"
ARCHITECTURES="?x86_gcc2 x86 x86_64"
SECONDARY_ARCHITECTURES="x86"
# On x86_gcc2 we don't want to install the commands in bin/<arch>/, but in bin/.
commandSuffix=$secondaryArchSuffix
if [ "$targetArchitecture" = x86_gcc2 ]; then
commandSuffix=
fi
PROVIDES="
util_linux$secondaryArchSuffix = $portVersion compat >= 2
cmd:cal$commandSuffix = $portVersion
cmd:nologin$commandSuffix = $portVersion
cmd:rename$commandSuffix = $portVersion
cmd:ul$commandSuffix = $portVersion
lib:libsmartcols$secondaryArchSuffix = $portVersion compat >= 1
"
REQUIRES="
haiku$secondaryArchSuffix
lib:libintl$secondaryArchSuffix
lib:libncurses$secondaryArchSuffix
lib:libz$secondaryArchSuffix
"
PROVIDES_devel="
util_linux${secondaryArchSuffix}_devel = $portVersion compat >= 2
devel:libsmartcols$secondaryArchSuffix = $portVersion compat >= 1
"
REQUIRES_devel="
util_linux$secondaryArchSuffix == $portVersion base
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libintl$secondaryArchSuffix
devel:libncurses$secondaryArchSuffix
devel:libz$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:aclocal
cmd:autoconf
cmd:autom4te
cmd:automake
cmd:bison
cmd:gcc$secondaryArchSuffix
cmd:gettext$secondaryArchSuffix
cmd:libtoolize$secondaryArchSuffix
cmd:make
cmd:pkg_config$secondaryArchSuffix
"
BUILD()
{
export CFLAGS="-D_BSD_SOURCE -DB_USE_POSITIVE_POSIX_ERRORS"
export LDFLAGS="-lnetwork -lbsd -lposix_error_mapper"
autogen.sh
runConfigure ./configure \
--disable-all-programs \
--enable-cal \
--enable-libsmartcols \
--enable-rename \
--enable-nologin \
--enable-ul
make
}
INSTALL()
{
make install
# Cleanup
rm -rf $prefix/sbin
# Remove libtool file
rm -f $libDir/libsmartcols.la
prepareInstalledDevelLib libsmartcols
fixPkgconfig
packageEntries devel \
$developDir
}
TEST()
{
make check
}