util-linux: bump to 2.33, build cmd:col{,rm,umn}. (#3345)

This commit is contained in:
fbrosson
2018-11-08 15:39:37 +00:00
parent 53d23868b9
commit 89d4788867
2 changed files with 89 additions and 51 deletions

View File

@@ -5,11 +5,11 @@ Subject: Haiku patches
diff --git a/include/c.h b/include/c.h
index c8bcb37..bf6ff26 100644
index b769b58..9e0c2dc 100644
--- a/include/c.h
+++ b/include/c.h
@@ -29,6 +29,10 @@
# define LOGIN_NAME_MAX 256
@@ -33,6 +33,10 @@
# define NAME_MAX PATH_MAX
#endif
+#ifndef _SC_HOST_NAME_MAX
@@ -20,10 +20,10 @@ index c8bcb37..bf6ff26 100644
* Compiler-specific stuff
*/
diff --git a/include/ttyutils.h b/include/ttyutils.h
index a9baab3..961fd49 100644
index af97915..e0a3cc2 100644
--- a/include/ttyutils.h
+++ b/include/ttyutils.h
@@ -61,15 +61,23 @@ extern int get_terminal_name(const char **path, const char **name,
@@ -90,15 +90,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 */
@@ -47,8 +47,8 @@ index a9baab3..961fd49 100644
}
/* Sane setting, allow eight bit characters, no carriage return delay
@@ -115,7 +123,11 @@ static inline void reset_virtual_console(struct termios *tp, int flags)
# define FFDLY 0
@@ -150,7 +158,11 @@ static inline void reset_virtual_console(struct termios *tp, int flags)
# define TABDLY 0
#endif
+#ifdef IMAXBEL
@@ -59,7 +59,7 @@ index a9baab3..961fd49 100644
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 | \
@@ -145,24 +157,48 @@ static inline void reset_virtual_console(struct termios *tp, int flags)
@@ -180,24 +192,48 @@ static inline void reset_virtual_console(struct termios *tp, int flags)
*/
tp->c_cc[VTIME] = 0;
tp->c_cc[VMIN] = 1;
@@ -126,52 +126,74 @@ index de42795..9e07457 100644
2.14.1
From e8ab90b9e91df50304e32a77325d2030c1d4aeb6 Mon Sep 17 00:00:00 2001
From 1facdd03af765653e0247b3940e98c72d72c2ace Mon Sep 17 00:00:00 2001
From: fbrosson <fbrosson@localhost>
Date: Tue, 1 May 2018 23:37:15 +0000
Subject: define {makedev,major,minor} macros in blkidP.h for libblkid
Date: Tue, 6 Nov 2018 13:55:22 +0000
Subject: define {makedev,major,minor} macros
diff --git a/libblkid/src/blkidP.h b/libblkid/src/blkidP.h
index 22c9856..1a08190 100644
--- a/libblkid/src/blkidP.h
+++ b/libblkid/src/blkidP.h
@@ -341,6 +341,10 @@ UL_DEBUG_DECLARE_MASK(libblkid);
#define UL_DEBUG_CURRENT_MASK UL_DEBUG_MASK(libblkid)
#include "debugobj.h"
diff --git a/include/c.h b/include/c.h
index 9e0c2dc..4e61d6e 100644
--- a/include/c.h
+++ b/include/c.h
@@ -23,6 +23,10 @@
#ifdef HAVE_SYS_SYSMACROS_H
# include <sys/sysmacros.h> /* for major, minor */
+#else
+#define makedev(ma, mi) ((dev_t)(((((unsigned int)(ma)) << 8) & 0xff00) | (mi)))
+#define major(devnum) (((unsigned int)((devnum) & 0xff00) >> 8))
+#define minor(devnum) (unsigned int)((devnum) & 0xffff00ff)
+
extern void blkid_debug_dump_dev(blkid_dev dev);
#endif
#ifndef LOGIN_NAME_MAX
--
2.17.0
2.19.1
From 8ea31be2a92c3b90417061333da461f1e330e9bb Mon Sep 17 00:00:00 2001
From fd2e9e4c8d43bc0c5504b222b6156f5ef050e6fa Mon Sep 17 00:00:00 2001
From: fbrosson <fbrosson@localhost>
Date: Fri, 4 May 2018 21:25:57 +0000
Subject: define {makedev,major,minor} macros in sysfs.h for fdisk
Date: Tue, 6 Nov 2018 14:07:17 +0000
Subject: Don't define macros if they require others which are undefined.
diff --git a/include/sysfs.h b/include/sysfs.h
index 9a72a20..b21ab10 100644
--- a/include/sysfs.h
+++ b/include/sysfs.h
@@ -16,6 +16,10 @@
#include <inttypes.h>
#include <dirent.h>
diff --git a/include/ttyutils.h b/include/ttyutils.h
index e0a3cc2..21580cd 100644
--- a/include/ttyutils.h
+++ b/include/ttyutils.h
@@ -43,22 +43,32 @@
+#define makedev(ma, mi) ((dev_t)(((((unsigned int)(ma)) << 8) & 0xff00) | (mi)))
+#define major(devnum) (((unsigned int)((devnum) & 0xff00) >> 8))
+#define minor(devnum) (unsigned int)((devnum) & 0xffff00ff)
+
struct sysfs_cxt {
dev_t devno;
int dir_fd; /* /sys/block/<name> */
/* Default termios->iflag */
#ifndef TTYDEF_IFLAG
+# if defined(BRKINT) && defined(ICRNL) && defined(IMAXBEL) && defined(IXON) && \
+ defined(IXANY)
# define TTYDEF_IFLAG (BRKINT | ICRNL | IMAXBEL | IXON | IXANY)
+# endif
#endif
/* Default termios->oflag */
#ifndef TTYDEF_OFLAG
+# if defined(OPOST) && defined(ONLCR)
# define TTYDEF_OFLAG (OPOST | ONLCR /*| OXTABS*/)
+# endif
#endif
/* Default termios->lflag */
#ifndef TTYDEF_LFLAG
+# if defined(ECHO) && defined(ICANON) && defined(ISIG) && defined(IEXTEN) && \
+ defined(IXANY) && defined(ECHOE) && defined(ECHOKE) && defined(ECHOCTL)
# define TTYDEF_LFLAG (ECHO | ICANON | ISIG | IEXTEN | ECHOE|ECHOKE|ECHOCTL)
+# endif
#endif
/* Default termios->cflag */
#ifndef TTYDEF_CFLAG
+# if defined(CREAD) && defined(CS8) && defined(HUPCL)
# define TTYDEF_CFLAG (CREAD | CS8 | HUPCL)
+# endif
#endif
/* Storage for things detected while the login name was read. */
--
2.17.0
2.19.1

View File

@@ -7,8 +7,8 @@ LICENSE="GNU GPL v2
BSD (4-clause)
Public Domain"
REVISION="1"
SOURCE_URI="https://www.kernel.org/pub/linux/utils/util-linux/v2.32/util-linux-$portVersion.tar.xz"
CHECKSUM_SHA256="86e6707a379c7ff5489c218cfaf1e3464b0b95acf7817db0bc5f179e356a67b2"
SOURCE_URI="https://www.kernel.org/pub/linux/utils/util-linux/v2.33/util-linux-$portVersion.tar.xz"
CHECKSUM_SHA256="f261b9d73c35bfeeea04d26941ac47ee1df937bd3b0583e748217c1ea423658a"
SOURCE_DIR="util-linux-$portVersion"
PATCHES="util_linux-$portVersion.patchset"
@@ -34,8 +34,11 @@ for i in $util_linuxLibs; do
done
PROVIDES="
util_linux$secondaryArchSuffix = $portVersion compat >= 2
util_linux$secondaryArchSuffix = $portVersionCompat
cmd:blkid$commandSuffix = $portVersion
cmd:col$commandSuffix = $portVersion
cmd:colrm$commandSuffix = $portVersion
cmd:column$commandSuffix = $portVersion
cmd:hexdump$commandSuffix = $portVersion
cmd:nologin$commandSuffix = $portVersion
cmd:rename$commandSuffix = $portVersion
@@ -43,7 +46,7 @@ PROVIDES="
cmd:uuidgen$commandSuffix = $portVersion
lib:libblkid$secondaryArchSuffix = $libblkidVersionCompat
lib:libfdisk$secondaryArchSuffix = $libfdiskVersionCompat
lib:libsmartcols$secondaryArchSuffix = 1.1.0 compat >= 1
lib:libsmartcols$secondaryArchSuffix = $libsmartcolsVersionCompat
lib:libuuid$secondaryArchSuffix = $libuuidVersionCompat
"
REQUIRES="
@@ -55,7 +58,7 @@ REQUIRES="
SUMMARY_cal="A random collection of Linux utilities (cal)"
PROVIDES_cal="
util_linux${secondaryArchSuffix}_cal = $portVersion compat >= 2
util_linux${secondaryArchSuffix}_cal = $portVersionCompat
cmd:cal$commandSuffix = $portVersion
"
REQUIRES_cal="
@@ -73,7 +76,7 @@ SUMMARY_fdisk="A random collection of Linux utilities (fdisk)"
ARCHITECTURES_fdisk="!x86_gcc2 ?x86 ?x86_64"
SECONDARY_ARCHITECTURES_fdisk="?x86"
PROVIDES_fdisk="
util_linux${secondaryArchSuffix}_fdisk = $portVersion compat >= 2
util_linux${secondaryArchSuffix}_fdisk = $portVersionCompat
cmd:fdisk$commandSuffix = $portVersionCompat
"
REQUIRES_fdisk="
@@ -84,10 +87,10 @@ REQUIRES_fdisk="
"
PROVIDES_devel="
util_linux${secondaryArchSuffix}_devel = $portVersion compat >= 2
util_linux${secondaryArchSuffix}_devel = $portVersionCompat
devel:libblkid$secondaryArchSuffix = $libblkidVersionCompat
devel:libfdisk$secondaryArchSuffix = $libfdiskVersionCompat
devel:libsmartcols$secondaryArchSuffix = 1.1.0 compat >= 1
devel:libsmartcols$secondaryArchSuffix = $libsmartcolsVersionCompat
devel:libuuid$secondaryArchSuffix = $libuuidVersionCompat
"
REQUIRES_devel="
@@ -116,7 +119,10 @@ BUILD_PREREQUIRES="
defineDebugInfoPackage util_linux$secondaryArchSuffix \
"$commandBinDir"/blkid \
"${commandBinDir/util_linux$secondaryArchSuffix/util_linux${secondaryArchSuffix}_cal}"/cal \
"$commandBinDir"/col \
"$commandBinDir"/colrm \
"$commandBinDir"/column \
"${commandBinDir/$portName/${portName}_cal}"/cal \
"$commandBinDir"/hexdump \
"$commandBinDir"/nologin \
"$commandBinDir"/rename \
@@ -152,19 +158,29 @@ BUILD()
--disable-makedev \
--enable-blkid \
--enable-cal \
--enable-col \
--enable-colrm \
--enable-column \
--enable-fdisk \
--enable-hexdump \
--enable-libfdisk \
--enable-libsmartcols \
--enable-libuuid \
--enable-rename \
--enable-nologin \
--enable-rename \
--enable-ul \
--enable-uuidgen \
--without-udev \
# --disable-all-programs kills several --enable-* switches, so enable them:
for i in BLKID FDISK LIBBLKID LIBFDISK HEXDUMP UUIDGEN; do
for i in \
BLKID \
COL COLRM COLUMN \
FDISK \
HEXDUMP \
LIBBLKID \
UUIDGEN \
; do
sed -i \
-e "/BUILD_${i}_TRUE/ s/\"#\"/\"\"/;" \
-e "/BUILD_${i}_FALSE/ s/\"\"/\"#\"/;" \