summaryrefslogtreecommitdiffstats
path: root/main/util-linux
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2013-09-20 14:14:03 +0000
committerTimo Teräs <timo.teras@iki.fi>2013-09-20 14:14:25 +0000
commitd2304eb98c8947460d9838720ad3ed8a6d48fb86 (patch)
treec4cd38d99bbbc25074634a9047275e016cac6882 /main/util-linux
parent1248355b4aa388274049dd00290701d2d7895ec1 (diff)
downloadaports-d2304eb98c8947460d9838720ad3ed8a6d48fb86.tar.bz2
aports-d2304eb98c8947460d9838720ad3ed8a6d48fb86.tar.xz
main/util-linux: fix build against musl
Diffstat (limited to 'main/util-linux')
-rw-r--r--main/util-linux/APKBUILD18
-rw-r--r--main/util-linux/ttydefaults.h39
-rw-r--r--main/util-linux/util-linux-posix.patch101
3 files changed, 154 insertions, 4 deletions
diff --git a/main/util-linux/APKBUILD b/main/util-linux/APKBUILD
index 056726a8c..ab81b7def 100644
--- a/main/util-linux/APKBUILD
+++ b/main/util-linux/APKBUILD
@@ -8,7 +8,7 @@ case $pkgver in
*.*) _v=$pkgver;;
esac
-pkgrel=0
+pkgrel=1
pkgdesc="Random collection of Linux utilities"
url="http://kernel.org/~kzak/util-linux/"
arch="all"
@@ -20,6 +20,8 @@ install=
source="http://www.kernel.org/pub/linux/utils/util-linux/v${_v}/util-linux-$pkgver.tar.xz
program-invocation.patch
gentoo-no-scanf.patch
+ util-linux-posix.patch
+ ttydefaults.h
"
subpackages="$pkgname-doc $pkgname-dev libuuid libblkid sfdisk cfdisk mcookie blkid"
replaces="e2fsprogs util-linux-ng"
@@ -28,11 +30,13 @@ _builddir="$srcdir/util-linux-$pkgver"
prepare() {
local i
cd "$_builddir"
+ update_config_sub || return 1
for i in $source; do
case $i in
*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
esac
done
+ cp "$srcdir"/ttydefaults.h include/
libtoolize --force && aclocal -I m4 && autoconf \
&& automake --add-missing
}
@@ -120,10 +124,16 @@ mcookie() {
md5sums="b39fde897334a4858bb2098edcce5b3f util-linux-2.23.2.tar.xz
9682a6ddd5abe65434a145ebe512c123 program-invocation.patch
-85125e2cc7d54dc2733bedc603886f81 gentoo-no-scanf.patch"
+85125e2cc7d54dc2733bedc603886f81 gentoo-no-scanf.patch
+43a03270b6e49fdf4c7fb0ab3390c242 util-linux-posix.patch
+6196f1ce853dfaf717569c1e35555d6d ttydefaults.h"
sha256sums="7c4042bd91f621250d7b3b2f34e3b11921a32c7f080c149dcc0c7ce62a8a7cac util-linux-2.23.2.tar.xz
2bfa27969effc77631e981bbbcd1bf261e61f3e51875db950883ddb2a90ea4fd program-invocation.patch
-2a2429b59151a63a75d2ff46f60732c6a3fbe9b52e472802edcf4eedbe3e22f2 gentoo-no-scanf.patch"
+2a2429b59151a63a75d2ff46f60732c6a3fbe9b52e472802edcf4eedbe3e22f2 gentoo-no-scanf.patch
+d099d398d5e6649276d0ccd3b276aa762f52efec8295706370fef44287a2386f util-linux-posix.patch
+46faf1198bd884d12c5d45019a5fec8dfdefeae6721d8c9f3da89921acdb2a6d ttydefaults.h"
sha512sums="dcccf8e3a3892a2ac98eea0a7e1c24c1b612ef10b466a8b34d8ebe6c2d49778bc9e8bfb1866ce0daa6db387396659120c290c5b36f47864c4d513b5ed15f9618 util-linux-2.23.2.tar.xz
5a07e86fa84961f73e53677d202e7a2101704eacb698426e62da897af07c7f1227e841f79ff59deed50cfb0e9ef1816f7c3fd03382ae4aa46909b6cd41a95d4e program-invocation.patch
-5f199511d3c6919c1a23248f2fd1d15343ee330e169b8440ca48bbbbc1aae243d8bd652ab504520c5d12dd0875e5e94a704d727d4b71bcd940d4ff51115b3981 gentoo-no-scanf.patch"
+5f199511d3c6919c1a23248f2fd1d15343ee330e169b8440ca48bbbbc1aae243d8bd652ab504520c5d12dd0875e5e94a704d727d4b71bcd940d4ff51115b3981 gentoo-no-scanf.patch
+4a5052caad3a9fb176283d49c486256453ede2a10d99c5f0a4e78a25a03f09a69c6d840756e07aaee581003b018c8b8279e6f727712edf03ff755d162544b729 util-linux-posix.patch
+876bb9041eca1b2cca1e9aac898f282db576f7860aba690a95c0ac629d7c5b2cdeccba504dda87ff55c2a10b67165985ce16ca41a0694a267507e1e0cafd46d9 ttydefaults.h"
diff --git a/main/util-linux/ttydefaults.h b/main/util-linux/ttydefaults.h
new file mode 100644
index 000000000..0004b66a8
--- /dev/null
+++ b/main/util-linux/ttydefaults.h
@@ -0,0 +1,39 @@
+#ifndef _SYS_TTYDEFAULTS_H_
+#define _SYS_TTYDEFAULTS_H_
+#define TTYDEF_IFLAG (BRKINT | ISTRIP | ICRNL | IMAXBEL | IXON | IXANY)
+#define TTYDEF_OFLAG (OPOST | ONLCR | XTABS)
+#define TTYDEF_LFLAG (ECHO | ICANON | ISIG | IEXTEN | ECHOE|ECHOKE|ECHOCTL)
+#define TTYDEF_CFLAG (CREAD | CS7 | PARENB | HUPCL)
+#define TTYDEF_SPEED (B9600)
+#define CTRL(x) (x&037)
+#define CEOF CTRL('d')
+#ifdef _POSIX_VDISABLE
+# define CEOL _POSIX_VDISABLE
+#else
+# define CEOL '\0'
+#endif
+#define CERASE 0177
+#define CINTR CTRL('c')
+#ifdef _POSIX_VDISABLE
+# define CSTATUS _POSIX_VDISABLE
+#else
+# define CSTATUS '\0'
+#endif
+#define CKILL CTRL('u')
+#define CMIN 1
+#define CQUIT 034
+#define CSUSP CTRL('z')
+#define CTIME 0
+#define CDSUSP CTRL('y')
+#define CSTART CTRL('q')
+#define CSTOP CTRL('s')
+#define CLNEXT CTRL('v')
+#define CDISCARD CTRL('o')
+#define CWERASE CTRL('w')
+#define CREPRINT CTRL('r')
+#define CEOT CEOF
+#define CBRK CEOL
+#define CRPRNT CREPRINT
+#define CFLUSH CDISCARD
+#endif
+
diff --git a/main/util-linux/util-linux-posix.patch b/main/util-linux/util-linux-posix.patch
new file mode 100644
index 000000000..3fd93cd0a
--- /dev/null
+++ b/main/util-linux/util-linux-posix.patch
@@ -0,0 +1,101 @@
+patch taken from sabotage linux -- https://github.com/rofl0r/sabotage
+diff -aur util-linux-2.23.1.org/fdisks/cfdisk.c util-linux-2.23.1/fdisks/cfdisk.c
+--- util-linux-2.23.1.org/fdisks/cfdisk.c 2013-07-01 21:37:58.508000002 +0000
++++ util-linux-2.23.1/fdisks/cfdisk.c 2013-07-01 22:00:23.042000002 +0000
+@@ -325,7 +325,7 @@
+ int logical = 0;
+ long long logical_sectors[MAXIMUM_PARTS];
+
+-__sighandler_t old_SIGINT, old_SIGTERM;
++sighandler_t old_SIGINT, old_SIGTERM;
+
+ int arrow_cursor = FALSE;
+ int display_units = MEGABYTES;
+diff -aur util-linux-2.23.1.org/fdisks/fdisksunlabel.c util-linux-2.23.1/fdisks/fdisksunlabel.c
+--- util-linux-2.23.1.org/fdisks/fdisksunlabel.c 2013-07-01 21:37:58.508000002 +0000
++++ util-linux-2.23.1/fdisks/fdisksunlabel.c 2013-07-01 21:59:43.721000002 +0000
+@@ -383,9 +383,11 @@
+ }
+ }
+
+-static int verify_sun_cmp(int *a, int *b, void *data)
++static void* cmp_data;
++static int verify_sun_cmp(const void *pa, const void *pb)
+ {
+- unsigned int *verify_sun_starts = (unsigned int *) data;
++ const int *a = pa, *b = pb;
++ unsigned int *verify_sun_starts = (unsigned int *) cmp_data;
+
+ if (*a == -1)
+ return 1;
+@@ -449,9 +451,8 @@
+ else
+ array[i] = -1;
+ }
+- qsort_r(array,ARRAY_SIZE(array),sizeof(array[0]),
+- (int (*)(const void *,const void *,void *)) verify_sun_cmp,
+- verify_sun_starts);
++ cmp_data = verify_sun_starts;
++ qsort(array,ARRAY_SIZE(array),sizeof(array[0]), verify_sun_cmp);
+
+ if (array[0] == -1) {
+ fdisk_info(cxt, _("No partitions defined"));
+diff -aur util-linux-2.23.1.org/include/ttyutils.h util-linux-2.23.1/include/ttyutils.h
+--- util-linux-2.23.1.org/include/ttyutils.h 2013-07-01 21:37:58.433000002 +0000
++++ util-linux-2.23.1/include/ttyutils.h 2013-07-01 21:48:42.328000002 +0000
+@@ -10,6 +10,7 @@
+ #include <stdlib.h>
+ #include <termios.h>
+ #include <limits.h>
++#include "ttydefaults.h"
+ #ifdef HAVE_SYS_IOCTL_H
+ #include <sys/ioctl.h>
+ #endif
+diff -aur util-linux-2.23.1.org/term-utils/setterm.c util-linux-2.23.1/term-utils/setterm.c
+--- util-linux-2.23.1.org/term-utils/setterm.c 2013-07-01 21:37:58.442000002 +0000
++++ util-linux-2.23.1/term-utils/setterm.c 2013-07-01 22:02:54.244000002 +0000
+@@ -123,7 +123,7 @@
+ #include "nls.h"
+ #include "closestream.h"
+
+-#if __GNU_LIBRARY__ < 5
++#if defined(__GLIBC__) && __GNU_LIBRARY__ < 5
+ #ifndef __alpha__
+ # include <linux/unistd.h>
+ #define __NR_klogctl __NR_syslog
+diff -aur util-linux-2.23.1.org/term-utils/ttymsg.c util-linux-2.23.1/term-utils/ttymsg.c
+--- util-linux-2.23.1.org/term-utils/ttymsg.c 2013-07-01 21:37:58.442000002 +0000
++++ util-linux-2.23.1/term-utils/ttymsg.c 2013-07-01 22:07:02.788000002 +0000
+@@ -41,6 +41,7 @@
+ */
+
+ #include <sys/types.h>
++#include <sys/param.h>
+ #include <sys/uio.h>
+ #include <signal.h>
+ #include <fcntl.h>
+diff -aur util-linux-2.23.1.org/text-utils/hexdump.h util-linux-2.23.1/text-utils/hexdump.h
+--- util-linux-2.23.1.org/text-utils/hexdump.h 2013-07-01 21:37:58.437000002 +0000
++++ util-linux-2.23.1/text-utils/hexdump.h 2013-07-01 22:01:27.005000002 +0000
+@@ -32,7 +32,7 @@
+ *
+ * @(#)hexdump.h 5.4 (Berkeley) 6/1/90
+ */
+-
++#include <sys/types.h>
+ typedef struct _pr {
+ struct _pr *nextpr; /* next print unit */
+ #define F_ADDRESS 0x001 /* print offset */
+diff -aur util-linux-2.23.1.org/text-utils/pg.c util-linux-2.23.1/text-utils/pg.c
+--- util-linux-2.23.1.org/text-utils/pg.c 2013-07-01 21:37:58.437000002 +0000
++++ util-linux-2.23.1/text-utils/pg.c 2013-07-01 22:01:55.831000002 +0000
+@@ -37,7 +37,7 @@
+ #ifndef TIOCGWINSZ
+ # include <sys/ioctl.h>
+ #endif
+-#include <sys/termios.h>
++#include <termios.h>
+ #include <fcntl.h>
+ #include <regex.h>
+ #include <stdio.h>
+