Convert/update diffutils to working recipe

This commit is contained in:
Chris Roberts
2013-10-20 00:27:04 -06:00
parent b014d83ce0
commit 5452e6113c
8 changed files with 128 additions and 205 deletions

View File

@@ -1,21 +0,0 @@
DESCRIPTION="Tools to make diffs and compare files."
HOMEPAGE="http://www.gnu.org/software/diffutils/"
SRC_URI="http://ftp.gnu.org/pub/gnu/diffutils/diffutils-2.9.tar.gz"
CHECKSUM_MD5="d6bc1bdc874ddb14cfed4d1655a0dbbe"
REVISION="1"
STATUS_HAIKU="stable"
DEPEND=""
BUILD()
{
cd diffutils-2.9
./configure --prefix=`finddir B_COMMON_DIRECTORY`
make
}
INSTALL()
{
cd diffutils-2.9
make install
}
LICENSE="GNU GPL v3"
COPYRIGHT="1992-2010 Free Software Foundation, Inc."

View File

@@ -1,30 +0,0 @@
DESCRIPTION="Tools to make diffs and compare files."
HOMEPAGE="http://www.gnu.org/software/diffutils/"
SRC_URI="http://ftp.gnu.org/pub/gnu/diffutils/diffutils-3.0.tar.gz"
CHECKSUM_MD5="684aaba1baab743a2a90e52162ff07da"
REVISION="1"
STATUS_HAIKU="stable"
DEPEND=""
BUILD()
{
cd diffutils-3.0
MANDIR=`finddir B_COMMON_DOCUMENTATION_DIRECTORY`/man
./configure --prefix=`finddir B_COMMON_DIRECTORY` \
--mandir=${MANDIR}
make
}
INSTALL()
{
cd diffutils-3.0
make install
}
TEST()
{
cd diffutils-3.0
make check
}
LICENSE="GNU GPL v3"
COPYRIGHT="1992-2010 Free Software Foundation, Inc."

View File

@@ -1,31 +0,0 @@
DESCRIPTION="Tools to make diffs and compare files."
HOMEPAGE="http://www.gnu.org/software/diffutils/"
SRC_URI="http://ftp.gnu.org/pub/gnu/diffutils/diffutils-3.2.tar.gz"
CHECKSUM_MD5="22e4deef5d8949a727b159d6bc65c1cc"
REVISION="1"
STATUS_HAIKU="stable"
DEPEND=""
BUILD()
{
cd diffutils-3.2
./configure --prefix="$(finddir B_COMMON_DIRECTORY)" \
--datarootdir="$(finddir B_COMMON_DATA_DIRECTORY)" \
--mandir="$(finddir B_COMMON_DOCUMENTATION_DIRECTORY)/man" \
--infodir="$(finddir B_COMMON_DOCUMENTATION_DIRECTORY)/info"
make
}
INSTALL()
{
cd diffutils-3.2
make install
}
TEST()
{
cd diffutils-3.2
make check
}
LICENSE="GNU GPL v3"
COPYRIGHT="1992-2011 Free Software Foundation, Inc."

View File

@@ -0,0 +1,66 @@
SUMMARY="Several programs for finding differences between files."
DESCRIPTION="
You can use the diff command to show differences between two files, or
each corresponding file in two directories. diff outputs differences
between files line by line in any of several formats, selectable by
command line options. This set of differences is often called a diff
or patch.
You can use the cmp command to show the offsets and line numbers where
two files differ. cmp can also show all the characters that differ
between the two files, side by side.
You can use the diff3 command to show differences among three files.
When two people have made independent changes to a common original,
diff3 can report the differences between the original and the two
changed versions, and can produce a merged file that contains both
persons' changes together with warnings about conflicts.
You can use the sdiff command to merge two files interactively.
"
LICENSE="GNU GPL v3"
COPYRIGHT="1992-2013 Free Software Foundation, Inc."
HOMEPAGE="http://www.gnu.org/software/diffutils/"
SRC_URI="http://ftp.gnu.org/pub/gnu/diffutils/diffutils-3.3.tar.xz"
CHECKSUM_MD5="99180208ec2a82ce71f55b0d7389f1b3"
REVISION="1"
ARCHITECTURES="x86 x86_gcc2"
PROVIDES="
diffutils = $portVersion
cmd:diff = $portVersion
cmd:cmp = $portVersion
cmd:diff3 = $portVersion
cmd:sdiff = $portVersion
"
REQUIRES="
haiku >= $haikuVersion
"
BUILD_PREREQUIRES="
haiku_devel >= $haikuVersion
cmd:make
cmd:gcc
"
PATCHES="diffutils-3.3.patchset"
SOURCE_DIR="$portVersionedName"
BUILD()
{
runConfigure ./configure \
--disable-gcc-warnings
make
}
INSTALL()
{
make install
}
TEST()
{
make check
}

View File

@@ -1,14 +0,0 @@
diff -up diffutils-2.9/lib/verify.h.orig diffutils-2.9/lib/verify.h
--- diffutils-2.9/lib/verify.h.orig 2010-04-18 13:06:04.590872576 -0600
+++ diffutils-2.9/lib/verify.h 2010-04-18 13:08:52.910163968 -0600
@@ -135,6 +135,10 @@ template <int w>
/* Verify requirement R at compile-time, as a declaration without a
trailing ';'. */
+# if __GNUC__ == 2
+# define verify(R)
+# else
# define verify(R) extern int (* verify_function__ (void)) [verify_true (R)]
+# endif
#endif

View File

@@ -1,51 +0,0 @@
diff -urN diffutils-3.0/gnulib-tests/test-dup2.c diffutils-3.0-haiku/gnulib-tests/test-dup2.c
--- diffutils-3.0/gnulib-tests/test-dup2.c 2010-04-15 13:42:07.036700160 +0000
+++ diffutils-3.0-haiku/gnulib-tests/test-dup2.c 2010-10-06 11:17:38.000000000 +0000
@@ -176,6 +176,7 @@
/* On systems that distinguish between text and binary mode, dup2
reuses the mode of the source. */
+#if O_BINARY
setmode (fd, O_BINARY);
ASSERT (is_mode (fd, O_BINARY));
ASSERT (dup2 (fd, fd + 1) == fd + 1);
@@ -190,6 +191,6 @@
ASSERT (close (fd + 1) == 0);
ASSERT (close (fd) == 0);
ASSERT (unlink (file) == 0);
-
+#endif
return 0;
}
diff -urN diffutils-3.0/gnulib-tests/test-fcntl.c diffutils-3.0-haiku/gnulib-tests/test-fcntl.c
--- diffutils-3.0/gnulib-tests/test-fcntl.c 2010-04-15 13:42:08.027787264 +0000
+++ diffutils-3.0-haiku/gnulib-tests/test-fcntl.c 2010-10-06 11:21:54.000000000 +0000
@@ -298,6 +298,7 @@
ASSERT (is_mode (fd + 2, O_BINARY));
ASSERT (close (fd) == 0);
+#if O_TEXT
setmode (fd + 2, O_TEXT);
ASSERT (fcntl (fd + 2, F_DUPFD, fd + 1) == fd + 1);
ASSERT (!is_open (fd));
@@ -318,7 +319,7 @@
ASSERT (is_mode (fd, O_TEXT));
ASSERT (is_mode (fd + 2, O_TEXT));
ASSERT (close (fd + 2) == 0);
-
+#endif
/* Test F_GETFD. */
errno = 0;
ASSERT (fcntl (-1, F_GETFD) == -1);
diff -urN diffutils-3.0/gnulib-tests/test-signal.c diffutils-3.0-haiku/gnulib-tests/test-signal.c
--- diffutils-3.0/gnulib-tests/test-signal.c 2010-04-15 13:42:09.030932992 +0000
+++ diffutils-3.0-haiku/gnulib-tests/test-signal.c 2010-10-06 11:28:31.000000000 +0000
@@ -58,7 +58,7 @@
#ifdef SIGALRM
case SIGALRM:
#endif
-#ifdef SIGBUS
+#if defined SIGBUS && !defined(__HAIKU__)
case SIGBUS:
#endif
#ifdef SIGCHLD

View File

@@ -1,58 +0,0 @@
diff -urN diffutils-3.2/src/dir.c diffutils-3.2-c89/src/dir.c
--- diffutils-3.2/src/dir.c 2011-08-14 15:58:59.020709376 +0000
+++ diffutils-3.2-c89/src/dir.c 2012-09-14 16:59:18.000000000 +0000
@@ -202,6 +202,7 @@
struct dirdata dirdata[2];
int volatile val = EXIT_SUCCESS;
int i;
+ int v1;
if ((cmp->file[0].desc == -1 || dir_loop (cmp, 0))
&& (cmp->file[1].desc == -1 || dir_loop (cmp, 1)))
@@ -254,6 +255,7 @@
pretend the "next name" in that dir is very large. */
int nameorder = (!*names[0] ? 1 : !*names[1] ? -1
: compare_names (*names[0], *names[1]));
+ int v1;
/* Prefer a file_name_cmp match if available. This algorithm is
O(N**2), where N is the number of names in a directory
@@ -289,7 +291,7 @@
}
}
- int v1 = (*handle_file) (cmp,
+ v1 = (*handle_file) (cmp,
0 < nameorder ? 0 : *names[0]++,
nameorder < 0 ? 0 : *names[1]++);
if (val < v1)
@@ -342,7 +344,8 @@
match = file; /* longjmp may mess up MATCH. */
else
{
- for (char const **p = dirdata.names; *p; p++)
+ char const **p;
+ for (p = dirdata.names; *p; p++)
if (compare_names (*p, file) == 0)
{
if (file_name_cmp (*p, file) == 0)
diff -urN diffutils-3.2/src/io.c diffutils-3.2-c89/src/io.c
--- diffutils-3.2/src/io.c 2011-08-15 05:24:38.019136512 +0000
+++ diffutils-3.2-c89/src/io.c 2012-09-14 17:02:59.000000000 +0000
@@ -258,6 +258,7 @@
case IGNORE_TRAILING_SPACE:
{
size_t column = 0;
+ size_t repetitions = 1;
while ((c = *p++) != '\n')
{
if (ig_white_space & IGNORE_TRAILING_SPACE
@@ -274,8 +275,6 @@
while (isspace (c1));
}
- size_t repetitions = 1;
-
if (ig_white_space & IGNORE_TAB_EXPANSION)
switch (c)
{

View File

@@ -0,0 +1,62 @@
From c648aa48039deac1e3e1e031eaedd74c3428493f Mon Sep 17 00:00:00 2001
From: Chris Roberts <cpr420@gmail.com>
Date: Sat, 19 Oct 2013 23:34:25 -0600
Subject: gcc2 fixes
diff --git a/src/dir.c b/src/dir.c
index 7f647b0..e9526ac 100644
--- a/src/dir.c
+++ b/src/dir.c
@@ -249,6 +249,7 @@ diff_dirs (struct comparison const *cmp,
/* Loop while files remain in one or both dirs. */
while (*names[0] || *names[1])
{
+ int v1;
/* Compare next name in dir 0 with next name in dir 1.
At the end of a dir,
pretend the "next name" in that dir is very large. */
@@ -289,7 +290,7 @@ diff_dirs (struct comparison const *cmp,
}
}
- int v1 = (*handle_file) (cmp,
+ v1 = (*handle_file) (cmp,
0 < nameorder ? 0 : *names[0]++,
nameorder < 0 ? 0 : *names[1]++);
if (val < v1)
@@ -347,7 +348,8 @@ find_dir_file_pathname (char const *dir, char const *file)
match = file; /* longjmp may mess up MATCH. */
else
{
- for (char const **p = dirdata.names; *p; p++)
+ char const **p;
+ for (p = dirdata.names; *p; p++)
if (compare_names (*p, file) == 0)
{
if (file_name_cmp (*p, file) == 0)
diff --git a/src/io.c b/src/io.c
index 463ee35..965cd3b 100644
--- a/src/io.c
+++ b/src/io.c
@@ -274,6 +274,8 @@ find_and_hash_each_line (struct file_data *current)
size_t column = 0;
while ((c = *p++) != '\n')
{
+ size_t repetitions = 1;
+
if (ig_white_space & IGNORE_TRAILING_SPACE
&& isspace (c))
{
@@ -288,8 +290,6 @@ find_and_hash_each_line (struct file_data *current)
while (isspace (c1));
}
- size_t repetitions = 1;
-
if (ig_white_space & IGNORE_TAB_EXPANSION)
switch (c)
{
--
1.8.3.4