diff --git a/sys-apps/diffutils/diffutils-3.6.recipe b/sys-apps/diffutils/diffutils-3.6.recipe new file mode 100644 index 000000000..cc86cb371 --- /dev/null +++ b/sys-apps/diffutils/diffutils-3.6.recipe @@ -0,0 +1,69 @@ +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." +HOMEPAGE="https://www.gnu.org/software/diffutils/" +COPYRIGHT="1992-2016 Free Software Foundation, Inc." +LICENSE="GNU GPL v3" +REVISION="1" +SOURCE_URI="http://ftpmirror.gnu.org/diffutils/diffutils-$portVersion.tar.xz" +CHECKSUM_SHA256="d621e8bdd4b573918c8145f7ae61817d1be9deb4c8d2328a65cea8e11d783bd6" +PATCHES="diffutils-$portVersion.patchset" + +ARCHITECTURES="?x86_gcc2 x86 x86_64" + +PROVIDES=" + diffutils = $portVersion + cmd:diff = $portVersion + cmd:cmp = $portVersion + cmd:diff3 = $portVersion + cmd:sdiff = $portVersion + " +REQUIRES=" + haiku + " + +BUILD_REQUIRES=" + haiku_devel + " +BUILD_PREREQUIRES=" + cmd:make + cmd:gcc + cmd:awk + cmd:perl + " + +defineDebugInfoPackage diffutils \ + $binDir/cmp \ + $binDir/diff \ + $binDir/diff3 \ + $binDir/sdiff + +BUILD() +{ + runConfigure ./configure \ + --disable-gcc-warnings + make $jobArgs +} + +INSTALL() +{ + make install + rm $libDir/charset.alias +} + +TEST() +{ + make check +} diff --git a/sys-apps/diffutils/patches/diffutils-3.6.patchset b/sys-apps/diffutils/patches/diffutils-3.6.patchset new file mode 100644 index 000000000..525b6885f --- /dev/null +++ b/sys-apps/diffutils/patches/diffutils-3.6.patchset @@ -0,0 +1,133 @@ +From 90674adfccdfa1162465f421fe4ef982ad48200c Mon Sep 17 00:00:00 2001 +From: Chris Roberts +Date: Tue, 9 Aug 2016 18:34:58 +0300 +Subject: gcc2 fixes + + +diff --git a/src/dir.c b/src/dir.c +index 52c320a..03e2b32 100644 +--- a/src/dir.c ++++ b/src/dir.c +@@ -265,6 +265,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. */ +@@ -305,7 +306,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) +@@ -363,7 +364,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 b4ef5dc..8806b7f 100644 +--- a/src/io.c ++++ b/src/io.c +@@ -281,6 +281,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)) + { +@@ -295,8 +297,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) + { +diff --git a/src/util.c b/src/util.c +index 88955da..e4435c2 100644 +--- a/src/util.c ++++ b/src/util.c +@@ -580,7 +580,7 @@ parse_diff_color (void) + int ind_no; /* Indicator number */ + char label[3]; /* Indicator label */ + struct color_ext_type *ext; /* Extension we are working on */ +- ++ enum parse_state state = PS_START; + if ((p = color_palette) == NULL || *p == '\0') + return; + +@@ -593,7 +593,6 @@ parse_diff_color (void) + advance. */ + buf = color_buf = xstrdup (p); + +- enum parse_state state = PS_START; + while (true) + { + switch (state) +-- +2.12.2 + + +From 5ca0233267788fae744ad575bdafeee076302ec4 Mon Sep 17 00:00:00 2001 +From: fbrosson +Date: Sun, 21 Aug 2016 05:35:54 +0000 +Subject: additional gcc2 patch for diffutils-3.5. + + +diff --git a/src/diff3.c b/src/diff3.c +index 5f3c7cb..08f02c3 100644 +--- a/src/diff3.c ++++ b/src/diff3.c +@@ -264,6 +264,7 @@ main (int argc, char **argv) + char *commonname; + char **file; + struct stat statb; ++ char *b0, *b1; + + exit_failure = EXIT_TROUBLE; + initialize_main (&argc, &argv); +@@ -415,7 +416,6 @@ main (int argc, char **argv) + /* Invoke diff twice on two pairs of input files, combine the two + diffs, and output them. */ + +- char *b0, *b1; + commonname = file[rev_mapping[FILEC]]; + thread1 = process_diff (file[rev_mapping[FILE1]], commonname, &last_block, &b1); + thread0 = process_diff (file[rev_mapping[FILE0]], commonname, &last_block, &b0); +-- +2.12.2 + + +From 4540be8615f3170629a326546f9f93008b38dbb1 Mon Sep 17 00:00:00 2001 +From: fbrosson +Date: Sun, 21 Aug 2016 05:35:54 +0000 +Subject: replace /usr/bin/perl by /bin/perl in man/help2man. + + +diff --git a/man/help2man b/man/help2man +index 54e5a31..6c5c093 100755 +--- a/man/help2man ++++ b/man/help2man +@@ -1,4 +1,4 @@ +-#!/usr/bin/perl -w ++#!/bin/perl -w + + # Generate a short man page from --help and --version output. + # Copyright (C) 1997-2005, 2009-2011, 2013, 2015-2017 Free Software Foundation, +-- +2.12.2 +