Merge all changes from trunk

This commit is contained in:
Oliver Tappe
2013-03-29 14:04:07 +00:00
parent 888e133171
commit 94cc6aaf85
1052 changed files with 65053 additions and 2541 deletions

View File

@@ -9,7 +9,9 @@ BUILD {
cd coreutils-8.5
MANDIR=`finddir B_COMMON_DOCUMENTATION_DIRECTORY`/man
./configure --prefix=`finddir B_COMMON_DIRECTORY` \
--mandir=${MANDIR}
--datarootdir=`finddir B_COMMON_DATA_DIRECTORY` \
--infodir=`finddir B_COMMON_DOCUMENTATION`/info \
--mandir=`finddir B_COMMON_DOCUMENTATION`/man
make
}

View File

@@ -0,0 +1,29 @@
DESCRIPTION="dbus message bus system"
HOMEPAGE="http://www.freedesktop.org/wiki/Software/dbus"
SRC_URI="http://dbus.freedesktop.org/releases/dbus/dbus-1.6.8.tar.gz"
CHECKSUM_MD5="3bf059c7dd5eda5f539a1b7cfe7a14a2"
REVISION="1"
STATUS_HAIKU="untested"
DEPEND=""
MESSAGE="This port only builds with gcc4. Use 'setgcc gcc4' before building."
BUILD {
cd dbus-1.6.8
./configure --prefix="$(finddir B_COMMON_DIRECTORY)" \
--datarootdir="$(finddir B_COMMON_DATA_DIRECTORY)" \
--mandir="$(finddir B_COMMON_DOCUMENTATION_DIRECTORY)/man"
make
}
INSTALL {
cd dbus-1.6.8
make install
}
TEST {
cd dbus-1.6.8
make check
}
LICENSE="GNU GPL v2"

View File

@@ -0,0 +1,11 @@
--- dbus-1.6.8/dbus/sd-daemon.c 2011-07-13 20:42:21.040108032 +0000
+++ dbus-1.6.8-haiku/dbus/sd-daemon.c 2013-02-12 18:57:28.067108864 +0000
@@ -32,7 +32,7 @@
#include <sys/stat.h>
#include <sys/socket.h>
#include <sys/un.h>
-#include <sys/fcntl.h>
+#include <fcntl.h>
#include <netinet/in.h>
#include <stdlib.h>
#include <errno.h>

View File

@@ -7,7 +7,7 @@ STATUS_HAIKU="stable"
DEPEND=""
BUILD {
cd diffutils-2.9
./configure --prefix=/boot/common
./configure --prefix=`finddir B_COMMON_DIRECTORY`
make
}

View File

@@ -0,0 +1,28 @@
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,58 @@
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,23 @@
DESCRIPTION="Reports information about your system's hardware as described in your system BIOS according to the SMBIOS/DMI standard"
HOMEPAGE="http://www.nongnu.org/dmidecode/"
SRC_URI="http://download.savannah.gnu.org/releases/dmidecode/dmidecode-2.11.tar.gz"
CHECKSUM_MD5="9fddbbc3e330bee5950b8b5d424a57cb"
REVISION="2"
STATUS_HAIKU="stable"
DEPEND=""
BUILD {
cd dmidecode-2.11
make
}
INSTALL {
cd dmidecode-2.11
make install prefix=`finddir B_COMMON_DIRECTORY` \
sbindir=`finddir B_COMMON_BIN_DIRECTORY` \
DESTDIR="$DESTDIR" \
mandir=`finddir B_COMMON_DOCUMENTATION_DIRECTORY`/man \
docdir=`finddir B_COMMON_DOCUMENTATION_DIRECTORY`/doc/dmidecode
}
LICENSE="GNU GPL v2"
COPYRIGHT="2000-2002 Alan Cox, 2002-2010 Jean Delvare"

View File

@@ -0,0 +1,27 @@
DESCRIPTION="The Device Tree Compiler"
HOMEPAGE="http://git.jdl.com/gitweb/?p=dtc.git;a=summary"
SRC_URI="git://git.jdl.com/software/dtc.git"
REVISION="1"
STATUS_HAIKU="untested"
DEPEND="sys-devel/bison >= 2.5"
# TODO: test gcc2 build
MESSAGE="This port only builds with gcc4. Use 'setgcc gcc4' before building."
#CHECKSUM_MD5=""
BUILD {
cd dtc-1.3.0-git
make PREFIX=`finddir B_COMMON_DIRECTORY`
}
INSTALL {
cd dtc-1.3.0-git
make install PREFIX=`finddir B_COMMON_DIRECTORY`
}
TEST {
cd dtc-1.3.0-git
make tests
}
LICENSE="GNU GPL v2"
COPYRIGHT="2005 David Gibson, IBM Corporation"

View File

@@ -0,0 +1,66 @@
diff --git a/Makefile dtc-1.3.0-git/Makefile
index 1169e6c..60077a5 100644
--- a/Makefile
+++ dtc-1.3.0-git/Makefile
@@ -41,6 +41,15 @@ SHAREDLIB_EXT=so
SHAREDLIB_LINK_OPTIONS=-shared -Wl,--version-script=$(LIBFDT_version) -Wl,-soname,
endif
+ifeq ($(HOSTOS),haiku)
+INSTALL = /bin/install
+endif
+
+ifneq ($(HOSTOS),haiku)
+LIBDL = -ldl
+endif
+
+
#
# Overall rules
#
diff --git a/tests/Makefile.tests dtc-1.3.0-git/tests/Makefile.tests
index 1795466..97b6131 100644
--- a/tests/Makefile.tests
+++ dtc-1.3.0-git/tests/Makefile.tests
@@ -50,7 +50,7 @@ $(LIB_TESTS): %: $(TESTS_PREFIX)testutils.o util.o $(LIBFDT_archive)
$(DL_LIB_TESTS): %: %.o $(TESTS_PREFIX)testutils.o util.o $(LIBFDT_archive)
@$(VECHO) LD [libdl] $@
- $(LINK.c) -o $@ $^ -ldl
+ $(LINK.c) -o $@ $^ $(LIBDL)
$(LIBTREE_TESTS): %: $(TESTS_PREFIX)testutils.o $(TESTS_PREFIX)trees.o \
util.o $(LIBFDT_archive)
diff --git a/tests/testutils.c dtc-1.3.0-git/tests/testutils.c
index f185133..66b34df 100644
--- a/tests/testutils.c
+++ dtc-1.3.0-git/tests/testutils.c
@@ -45,16 +45,15 @@ static void sigint_handler(int signum, siginfo_t *si, void *uc)
{
cleanup();
fprintf(stderr, "%s: %s (pid=%d)\n", test_name,
- strsignal(signum), getpid());
+ strsignal(signum), (int)getpid());
exit(RC_BUG);
}
void test_init(int argc, char *argv[])
{
int err;
- struct sigaction sa_int = {
- .sa_sigaction = sigint_handler,
- };
+ struct sigaction sa_int = { };
+ sa_int.sa_sigaction = sigint_handler;
test_name = argv[0];
@@ -66,7 +65,7 @@ void test_init(int argc, char *argv[])
verbose_test = 0;
verbose_printf("Starting testcase \"%s\", pid %d\n",
- test_name, getpid());
+ test_name, (int)getpid());
}
void check_mem_rsv(void *fdt, int n, uint64_t addr, uint64_t size)

View File

@@ -7,7 +7,7 @@ STATUS_HAIKU="stable"
DEPEND=""
BUILD {
cd ed-1.4
./configure --prefix=/boot/common
./configure --prefix=`finddir B_COMMON_DIRECTORY`
make
}

View File

@@ -8,7 +8,7 @@ DEPEND=""
BUILD {
cd file-5.04
autoreconf -fvi
./configure --prefix=/boot/common
./configure --prefix=`finddir B_COMMON_DIRECTORY`
make
}

View File

@@ -0,0 +1,22 @@
DESCRIPTION="Identify a file's format by scanning binary data for patterns"
HOMEPAGE="ftp://ftp.astron.com/pub/file/"
SRC_URI="ftp://ftp.astron.com/pub/file/file-5.11.tar.gz"
CHECKSUM_MD5="16a407bd66d6c7a832f3a5c0d609c27b"
REVISION="1"
STATUS_HAIKU="stable"
DEPEND=""
BUILD {
cd file-5.11
autoreconf -fvi
./configure --prefix="$(finddir B_COMMON_DIRECTORY)" \
--mandir="$(finddir B_COMMON_DOCUMENTATION_DIRECTORY)/man" \
--datadir="$(finddir B_COMMON_DATA_DIRECTORY)"
make
}
INSTALL {
cd file-5.11
make install
}
LICENSE="BSD (2-clause)"
COPYRIGHT="1986-1999 Ian F. Darwin"

View File

@@ -0,0 +1,20 @@
diff -up file-5.11/configure.ac.orig file-5.11/configure.ac
--- file-5.11/configure.ac.orig 2012-02-21 12:16:29.015728640 -0700
+++ file-5.11/configure.ac 2012-05-02 22:53:14.077594624 -0600
@@ -142,14 +142,14 @@ else
WARNINGS="-Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith \
-Wmissing-declarations -Wredundant-decls -Wnested-externs \
-Wsign-compare -Wreturn-type -Wswitch -Wshadow \
- -Wcast-qual -Wwrite-strings -Wextra -Wunused-parameter -Wformat=2"
+ -Wcast-qual -Wwrite-strings"
fi], [
if test "$GCC" = yes; then
AC_MSG_RESULT(yes)
WARNINGS="-Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith \
-Wmissing-declarations -Wredundant-decls -Wnested-externs \
-Wsign-compare -Wreturn-type -Wswitch -Wshadow \
- -Wcast-qual -Wwrite-strings -Wextra -Wunused-parameter -Wformat=2"
+ -Wcast-qual -Wwrite-strings"
else
WARNINGS=
AC_MSG_RESULT(no)

View File

@@ -8,10 +8,10 @@ CHECKSUM_MD5="52b41c6c4418b3226dfb8f82076193bb"
BUILD {
cd gawk-3.1.8
libtoolize --force --copy --install
MANDIR=`finddir B_COMMON_DOCUMENTATION_DIRECTORY`/man
./configure --prefix=`finddir B_COMMON_DIRECTORY` \
--mandir=${MANDIR}
--datarootdir=`finddir B_COMMON_DATA_DIRECTORY` \
--libexecdir=`finddir B_COMMON_BIN_DIRECTORY` \
--mandir=`finddir B_COMMON_DOCUMENTATION_DIRECTORY`/man
make
}

View File

@@ -0,0 +1,23 @@
DESCRIPTION="GNU awk"
HOMEPAGE="http://www.gnu.org/software/coreutils"
SRC_URI="http://ftp.gnu.org/gnu/gawk/gawk-4.0.1.tar.gz"
CHECKSUM_MD5="bab2bda483e9f32be65b43b8dab39fa5"
STATUS_HAIKU="stable"
REVISION="1"
BUILD {
cd gawk-4.0.1
libtoolize --force --copy --install
./configure --prefix=`finddir B_COMMON_DIRECTORY` \
--datarootdir=`finddir B_COMMON_DATA_DIRECTORY` \
--libexecdir=`finddir B_COMMON_LIB_DIRECTORY` \
--mandir=`finddir B_COMMON_DOCUMENTATION_DIRECTORY`/man
make
}
INSTALL {
cd gawk-4.0.1
make install
}
LICENSE="GNU GPL v3"
COPYRIGHT="2012 Free Software Foundation, Inc."

View File

@@ -0,0 +1,32 @@
DESCRIPTION="GNU regular expression matcher"
HOMEPAGE="http://www.gnu.org/software/grep/"
SRC_URI="http://ftpmirror.gnu.org/grep/grep-2.12.tar.xz"
CHECKSUM_MD5="8d2f0346d08b13c18afb81f0e8aa1e2f"
REVISION="1"
STATUS_HAIKU="stable"
DEPEND="sys-devel/gettext >= 0.17
sys-devel/libiconv >= 1.13.1"
BUILD {
cd grep-2.12
libtoolize --force --copy --install
aclocal -I m4
autoconf
./configure --prefix=`finddir B_COMMON_DIRECTORY` \
--datarootdir=`finddir B_COMMON_DATA_DIRECTORY` \
--infodir=`finddir B_COMMON_DOCUMENTATION_DIRECTORY`/info \
--mandir=`finddir B_COMMON_DOCUMENTATION_DIRECTORY`/man
make
}
INSTALL {
cd grep-2.12
make install
}
TEST {
cd grep-2.12
make check
}
LICENSE="GNU GPL v3"
COPYRIGHT="1992-2012 Free Software Foundation, Inc."

View File

@@ -0,0 +1,27 @@
DESCRIPTION="GNU regular expression matcher"
HOMEPAGE="http://www.gnu.org/software/grep/"
SRC_URI="http://ports-space.haiku-files.org/source/grep-2.14.tar.bz2"
CHECKSUM_MD5="db55b9fc67d8c0895f3c73e94e2aebe3"
REVISION="1"
STATUS_HAIKU="stable"
DEPEND="sys-devel/gettext >= 0.17
sys-devel/libiconv >= 1.13.1"
BUILD {
cd grep-2.14
libtoolize --force --copy --install
aclocal -I m4
autoconf
./configure --prefix=`finddir B_COMMON_DIRECTORY` \
--datarootdir=`finddir B_COMMON_DATA_DIRECTORY` \
--infodir=`finddir B_COMMON_DOCUMENTATION_DIRECTORY`/info \
--mandir=`finddir B_COMMON_DOCUMENTATION_DIRECTORY`/man
make
}
INSTALL {
cd grep-2.14
make install
}
LICENSE="GNU GPL v3"
COPYRIGHT="1992-2012 Free Software Foundation, Inc."

View File

@@ -0,0 +1,34 @@
DESCRIPTION="GNU regular expression matcher"
HOMEPAGE="http://www.gnu.org/software/grep/"
SRC_URI="http://ftp.gnu.org/pub/gnu/grep/grep-2.14.tar.xz"
CHECKSUM_MD5="d4a3f03849d1e17ce56ab76aa5a24cab"
REVISION="1"
STATUS_HAIKU="stable"
DEPEND="sys-devel/gettext >= 0.17
sys-devel/libiconv >= 1.13.1"
BUILD {
cd grep-2.14
libtoolize --force --copy --install
aclocal -I m4
autoconf
./configure --prefix=`finddir B_COMMON_DIRECTORY` \
--datarootdir=`finddir B_COMMON_DATA_DIRECTORY` \
--infodir=`finddir B_COMMON_DOCUMENTATION_DIRECTORY`/info \
--mandir=`finddir B_COMMON_DOCUMENTATION_DIRECTORY`/man \
--disable-perl-regexp
make
}
INSTALL {
cd grep-2.14
make install
}
TEST {
cd grep-2.14
make check
}
LICENSE="GNU GPL v3"
COPYRIGHT="1992-2012 Free Software Foundation, Inc."

View File

@@ -8,7 +8,7 @@ DEPEND=""
BUILD {
cd grep-2.5.4
libtoolize --force --copy --install
./configure --prefix=/boot/common
./configure --prefix=`finddir B_COMMON_DIRECTORY`
make
}
@@ -16,5 +16,11 @@ INSTALL {
cd grep-2.5.4
make install
}
TEST {
cd grep-2.5.4
make check
}
LICENSE="GNU GPL v3"
COPYRIGHT="1992-2010 Free Software Foundation, Inc."

View File

@@ -0,0 +1,26 @@
DESCRIPTION="GNU regular expression matcher"
HOMEPAGE="http://www.gnu.org/software/grep/"
SRC_URI="http://ftp.gnu.org/gnu/grep/grep-2.6.1.tar.gz"
CHECKSUM_MD5="8d1496da11029112a4d0986cbf09e26f"
REVISION="1"
STATUS_HAIKU="stable"
DEPEND=""
BUILD {
cd grep-2.6.1
libtoolize --force --copy --install
./configure --prefix=`finddir B_COMMON_DIRECTORY`
make
}
INSTALL {
cd grep-2.6.1
make install
}
TEST {
cd grep-2.6.1
make check
}
LICENSE="GNU GPL v3"
COPYRIGHT="1992-2010 Free Software Foundation, Inc."

View File

@@ -0,0 +1,26 @@
DESCRIPTION="GNU regular expression matcher"
HOMEPAGE="http://www.gnu.org/software/grep/"
SRC_URI="http://ftp.gnu.org/gnu/grep/grep-2.6.3.tar.gz"
CHECKSUM_MD5="3095b57837b312f087c0680559de7f13"
REVISION="1"
STATUS_HAIKU="stable"
DEPEND=""
BUILD {
cd grep-2.6.3
libtoolize --force --copy --install
./configure --prefix=`finddir B_COMMON_DIRECTORY`
make
}
INSTALL {
cd grep-2.6.3
make install
}
TEST {
cd grep-2.6.3
make check
}
LICENSE="GNU GPL v3"
COPYRIGHT="1992-2010 Free Software Foundation, Inc."

View File

@@ -4,13 +4,17 @@ SRC_URI="ftp://mirrors.kernel.org/gnu/grep/grep-2.7.tar.gz"
CHECKSUM_MD5="e848f07e3e79aa7899345d17c7e4115e"
REVISION="1"
STATUS_HAIKU="stable"
DEPEND=""
DEPEND="sys-devel/gettext >= 0.17
sys-devel/libiconv >= 1.13.1"
BUILD {
cd grep-2.7
libtoolize --force --copy --install
aclocal -I m4
autoconf
./configure --prefix=/boot/common
./configure --prefix=`finddir B_COMMON_DIRECTORY` \
--datarootdir=`finddir B_COMMON_DATA_DIRECTORY` \
--infodir=`finddir B_COMMON_DOCUMENTATION_DIRECTORY`/info \
--mandir=`finddir B_COMMON_DOCUMENTATION_DIRECTORY`/man
make
}
@@ -18,5 +22,11 @@ INSTALL {
cd grep-2.7
make install
}
TEST {
cd grep-2.7
make check
}
LICENSE="GNU GPL v3"
COPYRIGHT="1992-2010 Free Software Foundation, Inc."

View File

@@ -0,0 +1,14 @@
diff -up grep-2.12/src/kwsearch.c.orig grep-2.12/src/kwsearch.c
--- grep-2.12/src/kwsearch.c.orig 2012-02-27 02:35:19.015204352 -0700
+++ grep-2.12/src/kwsearch.c 2012-05-02 22:46:36.262668288 -0600
@@ -106,8 +106,9 @@ Fexecute (char const *buf, size_t size,
/* The match was a part of multibyte character, advance at least
one byte to ensure no infinite loop happens. */
mbstate_t s;
+ size_t mb_len;
memset (&s, 0, sizeof s);
- size_t mb_len = mbrlen (mb_start, (buf + size) - (beg + offset), &s);
+ mb_len = mbrlen (mb_start, (buf + size) - (beg + offset), &s);
if (mb_len == (size_t) -2)
goto failure;
beg = mb_start;

View File

@@ -0,0 +1,162 @@
diff -Naur ./grep-2.14-original/lib/fts.c ./grep-2.14/lib/fts.c
--- ./grep-2.14-original/lib/fts.c 2012-02-26 14:01:23.001310720 +0000
+++ ./grep-2.14/lib/fts.c 2012-12-26 19:30:29.630718464 +0000
@@ -1278,6 +1278,7 @@
nlink_t nlinks;
bool nostat;
size_t len, maxlen, new_len;
+ size_t max_entries;
char *cp;
int dir_fd;
FTSENT *cur = sp->fts_cur;
@@ -1343,8 +1344,8 @@
function. But when no such function is specified, we can read
entries in batches that are large enough to help us with inode-
sorting, yet not so large that we risk exhausting memory. */
- size_t max_entries = (sp->fts_compar == NULL
- ? FTS_MAX_READDIR_ENTRIES : SIZE_MAX);
+ max_entries = (sp->fts_compar == NULL
+ ? FTS_MAX_READDIR_ENTRIES : SIZE_MAX);
/*
* Nlinks is the number of possible entries of type directory in the
diff -Naur ./grep-2.14-original/lib/regcomp.c ./grep-2.14/lib/regcomp.c
--- ./grep-2.14-original/lib/regcomp.c 2012-07-03 12:54:55.058982400 +0000
+++ ./grep-2.14/lib/regcomp.c 2012-12-26 19:31:31.972029952 +0000
@@ -952,10 +952,10 @@
internal_function
init_word_char (re_dfa_t *dfa)
{
- dfa->word_ops_used = 1;
int i = 0;
int j;
int ch = 0;
+ dfa->word_ops_used = 1;
if (BE (dfa->map_notascii == 0, 1))
{
bitset_word_t bits0 = 0x00000000;
diff -Naur ./grep-2.14-original/src/dfasearch.c ./grep-2.14/src/dfasearch.c
--- ./grep-2.14-original/src/dfasearch.c 2012-08-07 15:01:53.033030144 +0000
+++ ./grep-2.14/src/dfasearch.c 2012-12-26 19:33:56.699138048 +0000
@@ -216,6 +216,7 @@
int backref;
regoff_t start;
size_t len, best_len;
+ size_t off;
struct kwsmatch kwsm;
size_t i, ret_val;
mb_len_map_t *map = NULL;
@@ -418,7 +419,7 @@
success:
len = end - beg;
success_in_len:;
- size_t off = beg - buf;
+ off = beg - buf;
mb_case_map_apply (map, &off, &len);
*match_size = len;
ret_val = off;
diff -Naur ./grep-2.14-original/src/kwsearch.c ./grep-2.14/src/kwsearch.c
--- ./grep-2.14-original/src/kwsearch.c 2012-06-16 17:08:38.034078720 +0000
+++ ./grep-2.14/src/kwsearch.c 2012-12-26 19:36:28.265814016 +0000
@@ -39,9 +39,9 @@
? mbtolower (pattern, &psize, &map)
: pattern);
- kwsinit (&kwset);
-
char const *beg = pat;
+
+ kwsinit (&kwset);
do
{
char const *lim;
@@ -81,6 +81,7 @@
{
char const *beg, *try, *end, *mb_start;
size_t len;
+ size_t off;
char eol = eolbyte;
struct kwsmatch kwsmatch;
size_t ret_val;
@@ -100,6 +101,7 @@
for (mb_start = beg = start_ptr ? start_ptr : buf; beg <= buf + size; beg++)
{
size_t offset = kwsexec (kwset, beg, buf + size - beg, &kwsmatch);
+ size_t mb_len;
if (offset == (size_t) -1)
goto failure;
len = kwsmatch.size[0];
@@ -110,7 +112,7 @@
one byte to ensure no infinite loop happens. */
mbstate_t s;
memset (&s, 0, sizeof s);
- size_t mb_len = mbrlen (mb_start, (buf + size) - (beg + offset), &s);
+ mb_len = mbrlen (mb_start, (buf + size) - (beg + offset), &s);
if (mb_len == (size_t) -2)
goto failure;
beg = mb_start;
@@ -166,7 +168,7 @@
--beg;
len = end - beg;
success_in_beg_and_len:;
- size_t off = beg - buf;
+ off = beg - buf;
mb_case_map_apply (map, &off, &len);
*match_size = len;
diff -Naur ./grep-2.14-original/src/main.c ./grep-2.14/src/main.c
--- ./grep-2.14-original/src/main.c 2012-08-06 11:38:32.032768000 +0000
+++ ./grep-2.14/src/main.c 2012-12-26 19:39:22.737411072 +0000
@@ -460,6 +460,7 @@
if (SEEK_HOLE != SEEK_END && usable_st_size (st))
{
off_t cur = bufsize;
+ off_t hole_start;
if (O_BINARY || fd == STDIN_FILENO)
{
cur = lseek (fd, 0, SEEK_CUR);
@@ -468,7 +469,7 @@
}
/* Look for a hole after the current location. */
- off_t hole_start = lseek (fd, cur, SEEK_HOLE);
+ hole_start = lseek (fd, cur, SEEK_HOLE);
if (0 <= hole_start)
{
if (lseek (fd, cur, SEEK_SET) < 0)
@@ -1860,6 +1861,7 @@
size_t keycc, oldcc, keyalloc;
int with_filenames;
size_t cc;
+ struct stat tmp_stat;
int opt, status, prepended;
int prev_optind, last_recursive;
intmax_t default_context;
@@ -2223,7 +2225,6 @@
if (show_help)
usage (EXIT_SUCCESS);
- struct stat tmp_stat;
if (fstat (STDOUT_FILENO, &tmp_stat) == 0 && S_ISREG (tmp_stat.st_mode))
out_stat = tmp_stat;
diff -Naur ./grep-2.14-original/src/searchutils.c ./grep-2.14/src/searchutils.c
--- ./grep-2.14-original/src/searchutils.c 2012-06-16 17:08:38.034340864 +0000
+++ ./grep-2.14/src/searchutils.c 2012-12-26 19:32:59.044826624 +0000
@@ -80,6 +80,7 @@
static mb_len_map_t *len_map;
static size_t outalloc;
size_t outlen, mb_cur_max;
+ size_t ombclen;
mbstate_t is, os;
const char *end;
char *p;
@@ -133,7 +134,7 @@
else
{
beg += mbclen;
- size_t ombclen = wcrtomb (p, towlower ((wint_t) wc), &os);
+ ombclen = wcrtomb (p, towlower ((wint_t) wc), &os);
*m = mbclen - ombclen;
memset (m + 1, 0, ombclen - 1);
m += ombclen;

View File

@@ -0,0 +1,20 @@
diff -urN grep-2.6.1/src/dfa.c grep-2.6.1-haiku/src/dfa.c
--- grep-2.6.1/src/dfa.c 2010-03-25 06:28:54.056098816 -0700
+++ grep-2.6.1-haiku/src/dfa.c 2013-02-17 13:32:51.217055232 -0800
@@ -2775,6 +2775,7 @@
unsigned char eol = eolbyte; /* Likewise for eolbyte. */
static int sbit[NOTCHAR]; /* Table for anding with d->success. */
static int sbit_init;
+ unsigned char saved_end;
if (! sbit_init)
{
@@ -2792,7 +2793,7 @@
s = s1 = 0;
p = (unsigned char const *) begin;
trans = d->trans;
- unsigned char saved_end = *(unsigned char *) end;
+ saved_end = *(unsigned char *) end;
*end = eol;
#ifdef MBS_SUPPORT

View File

@@ -7,11 +7,15 @@ STATUS_HAIKU="stable"
DEPEND=""
BUILD {
cd groff-1.20.1
libtoolize --force --copy --install
aclocal -I m4
autoconf
COMMON_DOCS=`finddir B_COMMON_DOCUMENTATION_DIRECTORY`
sed -i 's/docdir=$(datadir)\/doc\/groff\//docdir=`finddir B_COMMON_DOCUMENTATION_DIRECTORY`\/doc\/groff/g' Ma*
./configure --prefix=`finddir B_COMMON_DIRECTORY` \
--datarootdir=`finddir B_COMMON_DATA_DIRECTORY` \
--docdir=`finddir B_COMMON_DOCUMENTATION_DIRECTORY`/doc \
--infodir=`finddir B_COMMON_DOCUMENTATION_DIRECTORY`/info \
--mandir=`finddir B_COMMON_DOCUMENTATION_DIRECTORY`/man
--infodir=$COMMON_DOCS/info \
--mandir=$COMMON_DOCS/man
make
}
@@ -20,5 +24,10 @@ INSTALL {
make install
}
TEST {
cd groff-1.20.1
make check
}
LICENSE="GNU GPL v3"
COPYRIGHT="2003-2009 Free Software Foundation, Inc."

10
sys-apps/hgrep/hgrep Executable file
View File

@@ -0,0 +1,10 @@
#!/bin/sh
#
# Copyright 2011, Haiku, Inc. All Rights Reserved.
# Distributed under the terms of the MIT License.
#
find $(finddir B_COMMON_DEVELOP_DIRECTORY)/headers -type f -print0 | xargs -0 egrep "$@"
# TODO add other header directories to search?

View File

@@ -0,0 +1,20 @@
DESCRIPTION="header grep"
HOMEPAGE="http://www.ports.haiku-files.org/"
SRC_URI="http://www.ports.haiku-files.org/export/1970/haikuports/trunk/sys-apps/hgrep/hgrep-1.0.1.zip"
REVISION="1"
STATUS_HAIKU="stable"
DEPEND=""
CHECKSUM_MD5="1c11724bc9fedd058fde03b5a9f242c2"
BUILD {
cd hgrep-1.0.1
}
INSTALL {
cd hgrep-1.0.1
BINDIR=`finddir B_COMMON_BIN_DIRECTORY`
mkdir -p $DESTDIR/$BINDIR
cp hgrep $DESTDIR/$BINDIR
}
LICENSE="MIT"
COPYRIGHT="2011 Haiku, Inc."

Binary file not shown.

View File

@@ -0,0 +1,20 @@
DESCRIPTION="header grep"
HOMEPAGE="http://www.ports.haiku-files.org/"
SRC_URI="http://www.ports.haiku-files.org/export/1966/haikuports/trunk/sys-apps/hgrep/hgrep-1.0.zip"
REVISION="1"
STATUS_HAIKU="stable"
DEPEND=""
CHECKSUM_MD5="e909cea8f7ae7f6c73fe75a691b0440f"
BUILD {
cd hgrep-1.0
}
INSTALL {
cd hgrep-1.0
BINDIR=`finddir B_COMMON_BIN_DIRECTORY`
mkdir -p $DESTDIR/$BINDIR
cp hgrep $DESTDIR/$BINDIR
}
LICENSE="MIT"
COPYRIGHT="2011 Haiku, Inc."

Binary file not shown.

View File

@@ -8,7 +8,8 @@ DEPEND=""
BUILD {
cd less-436
autoreconf -fvi
./configure --prefix=/boot/common --with-editor=nano
./configure --prefix=`finddir B_COMMON_DIRECTORY` --with-editor=nano \
--mandir=`finddir B_COMMON_DOCUMENTATION_DIRECTORY`/man
make
}

View File

@@ -0,0 +1,21 @@
DESCRIPTION="Less is a free, open-source file pager."
HOMEPAGE="http://www.greenwoodsoftware.com/less/"
SRC_URI="http://www.greenwoodsoftware.com/less/less-451.tar.gz"
CHECKSUM_MD5="765f082658002b2b46b86af4a0da1842"
REVISION="1"
STATUS_HAIKU="stable"
DEPEND=""
BUILD {
cd less-451
autoreconf -fvi
./configure --prefix=`finddir B_COMMON_DIRECTORY` --with-editor=nano \
--mandir=`finddir B_COMMON_DOCUMENTATION_DIRECTORY`/man
make
}
INSTALL {
cd less-451
make install DESTDIR="${DESTDIR}"
}
LICENSE="GNU GPL v3"
COPYRIGHT="1984-2012 Mark Nudelman"

View File

@@ -0,0 +1,128 @@
diff -urN less-451/cmdbuf.c less-451-haiku/cmdbuf.c
--- less-451/cmdbuf.c 2012-07-21 20:39:58.045088768 +0000
+++ less-451-haiku/cmdbuf.c 2012-09-06 18:17:44.432799744 +0000
@@ -1364,7 +1364,11 @@
static char *
histfile_name()
{
+#ifdef __HAIKU__
+ char home[B_PATH_NAME_LENGTH+B_FILE_NAME_LENGTH];
+#else
char *home;
+#endif
char *name;
int len;
@@ -1378,6 +1382,13 @@
return (save(name));
}
+#ifdef __HAIKU__
+ {
+ dev_t volume = dev_for_path("/boot");
+ if (find_directory(B_USER_SETTINGS_DIRECTORY, volume, true, home, sizeof(home)) != B_OK)
+ return (NULL);
+ }
+#else
/* Otherwise, file is in $HOME. */
home = lgetenv("HOME");
if (home == NULL || *home == '\0')
@@ -1388,6 +1399,8 @@
#endif
return (NULL);
}
+#endif
+
len = strlen(home) + strlen(LESSHISTFILE) + 2;
name = (char *) ecalloc(len, sizeof(char));
SNPRINTF2(name, len, "%s/%s", home, LESSHISTFILE);
diff -urN less-451/configure.ac less-451-haiku/configure.ac
--- less-451/configure.ac 2012-07-21 20:39:59.045613056 +0000
+++ less-451-haiku/configure.ac 2012-09-06 18:17:49.640942080 +0000
@@ -589,10 +589,17 @@
* LESSHISTFILE is the filename of the history file
* (in the HOME directory).
*/
-#define LESSKEYFILE ".less"
-#define LESSKEYFILE_SYS SYSDIR "/sysless"
-#define DEF_LESSKEYINFILE ".lesskey"
-#define LESSHISTFILE ".lesshst"
+#ifdef __HAIKU__
+# define LESSKEYFILE "less"
+# define LESSKEYFILE_SYS SYSDIR "/sysless"
+# define DEF_LESSKEYINFILE "lesskey"
+# define LESSHISTFILE "lesshst"
+#else
+# define LESSKEYFILE ".less"
+# define LESSKEYFILE_SYS SYSDIR "/sysless"
+# define DEF_LESSKEYINFILE ".lesskey"
+# define LESSHISTFILE ".lesshst"
+#endif
/* Settings always true on Unix. */
diff -urN less-451/filename.c less-451-haiku/filename.c
--- less-451/filename.c 2012-07-21 20:39:58.046923776 +0000
+++ less-451-haiku/filename.c 2012-09-06 18:17:53.399507456 +0000
@@ -266,12 +266,23 @@
{
register char *pathname;
+#ifdef __HAIKU__
+ char path[B_PATH_NAME_LENGTH+B_FILE_NAME_LENGTH];
+ dev_t volume = dev_for_path("/boot");
+ if (find_directory(B_USER_SETTINGS_DIRECTORY, volume, true, path, sizeof(path)) != B_OK)
+ return (NULL);
+
+ pathname = dirfile(&path, filename);
+ if (pathname != NULL)
+ return (pathname);
+#else
/*
* Try $HOME/filename.
*/
pathname = dirfile(lgetenv("HOME"), filename);
if (pathname != NULL)
return (pathname);
+#endif
#if OS2
/*
* Try $INIT/filename.
diff -urN less-451/less.h less-451-haiku/less.h
--- less-451/less.h 2012-07-21 20:39:59.047972352 +0000
+++ less-451-haiku/less.h 2012-09-06 18:17:57.216268800 +0000
@@ -93,6 +93,11 @@
#include <floss.h>
#endif
+#ifdef __HAIKU__
+#include <FindDirectory.h>
+#include <StorageDefs.h>
+#endif
+
#if MSDOS_COMPILER==WIN32C || OS2
#include <io.h>
#endif
diff -urN less-451/lesskey.c less-451-haiku/lesskey.c
--- less-451/lesskey.c 2012-07-21 20:39:59.049020928 +0000
+++ less-451-haiku/lesskey.c 2012-09-06 18:18:06.898891776 +0000
@@ -245,8 +245,19 @@
char *p;
char *pathname;
+#ifdef __HAIKU__
+ char path[B_PATH_NAME_LENGTH+B_FILE_NAME_LENGTH];
+ dev_t volume = dev_for_path("/boot");
+ if (find_directory(B_USER_SETTINGS_DIRECTORY, volume, true, path, sizeof(path)) != B_OK)
+ return (NULL);
+
+ pathname = mkpathname(&path, filename);
+ if (pathname != NULL)
+ return (pathname);
+#else
if ((p = getenv("HOME")) != NULL && *p != '\0')
pathname = mkpathname(p, filename);
+#endif
#if OS2
else if ((p = getenv("INIT")) != NULL && *p != '\0')
pathname = mkpathname(p, filename);

50
sys-apps/lgrep/lgrep Executable file
View File

@@ -0,0 +1,50 @@
#!/bin/sh
#
# Copyright 2011, Haiku, Inc. All Rights Reserved.
# Distributed under the terms of the MIT License.
#
usage() {
echo `basename $0` \[-V\] \<symbol\>
echo \- list files containing \<symbol\>
echo " -V lists also directories searched"
echo ""
echo `basename $0` -h
echo \- Show this help
exit 0
}
if [ "$1" == "-V" ]; then
VERBOSE=1
shift
else
VERBOSE=0
fi
if [ "$1" == "-h" ]; then
usage
fi
if [ "x$1" == "x" ]; then
usage
fi
LPATH=`echo $LIBRARY_PATH|sed "s|%A/lib:||"`
[ -d ./lib ] && LPATH="./lib:$LPATH" || true
LPATH=`echo $LPATH|sed "s/:/ /g"`
TEMPFILE=/boot/var/tmp/`basename $0`.$PPID
for libdir in `echo $LPATH`; do
if [ "$VERBOSE" == "1" ]; then
echo Searching in \"$libdir\"...
fi
for lib in $libdir/*.so ; do
echo "[ $lib ]" > $TEMPFILE
(nm -D $lib 2>/dev/null)|grep $1 >> $TEMPFILE
LINES=`wc -l $TEMPFILE | awk '{ print $1; }'`
if [ "$LINES" != "1" ]; then
cat $TEMPFILE
fi
done
done
rm -f $TEMPFILE

View File

@@ -0,0 +1,20 @@
DESCRIPTION="library grep"
HOMEPAGE="http://www.ports.haiku-files.org/"
SRC_URI="http://www.ports.haiku-files.org/export/1966/haikuports/trunk/sys-apps/lgrep/lgrep-1.0.zip"
REVISION="1"
STATUS_HAIKU="stable"
DEPEND=""
CHECKSUM_MD5="2a699321a362a64d0999bf883be21452"
BUILD {
cd lgrep-1.0
}
INSTALL {
cd lgrep-1.0
BINDIR=`finddir B_COMMON_BIN_DIRECTORY`
mkdir -p $DESTDIR/$BINDIR
cp lgrep $DESTDIR/$BINDIR
}
LICENSE="MIT"
COPYRIGHT="2011 Haiku, Inc."

Binary file not shown.

View File

@@ -7,7 +7,7 @@ STATUS_HAIKU="stable"
DEPEND="sys-apps/groff >= 1.20.1"
BUILD {
cd man-1.6f
./configure -prefix=/boot/common -sbindir=/boot/common/bin -confdir=`finddir B_COMMON_SETTINGS_DIRECTORY`
./configure -prefix=`finddir B_COMMON_DIRECTORY` -sbindir=`finddir B_COMMON_BIN_DIRECTORY` -confdir=`finddir B_COMMON_SETTINGS_DIRECTORY`
make
}

21
sys-apps/man/man-1.6g.bep Normal file
View File

@@ -0,0 +1,21 @@
DESCRIPTION="Standard commands to read man pages."
HOMEPAGE="http://primates.ximian.com/~flucifredi/man/"
SRC_URI="http://primates.ximian.com/~flucifredi/man/man-1.6g.tar.gz"
CHECKSUM_MD5="ba154d5796928b841c9c69f0ae376660"
REVISION="1"
STATUS_HAIKU="stable"
DEPEND="sys-apps/groff >= 1.20.1"
BUILD {
cd man-1.6g
./configure -prefix=`finddir B_COMMON_DIRECTORY` \
-sbindir=`finddir B_COMMON_BIN_DIRECTORY` \
-confdir=`finddir B_COMMON_SETTINGS_DIRECTORY`
make
}
INSTALL {
cd man-1.6g
make install
}
LICENSE="GNU GPL v2"
COPYRIGHT="1989-2012 Free Software Foundation, Inc."

View File

@@ -0,0 +1,82 @@
diff -up man-1.6g/configure.orig man-1.6g/configure
--- man-1.6g/configure.orig 2010-12-31 13:28:46.006291456 -0700
+++ man-1.6g/configure 2012-05-02 21:57:49.683147264 -0600
@@ -287,6 +287,12 @@ if test -f /xenix; then
esac
fi
+echo checking for Haiku
+if test `uname` = "Haiku"; then
+ LIBS="$LIBS -L/boot/system/lib -llocale"
+ mandir=`finddir B_COMMON_DOCUMENTATION_DIRECTORY`/man
+fi
+
echo checking how to get alloca
echo '
#ifdef __GNUC__
diff -up man-1.6g/man2html/Makefile.in.orig man-1.6g/man2html/Makefile.in
--- man-1.6g/man2html/Makefile.in.orig 2010-12-31 13:28:46.010747904 -0700
+++ man-1.6g/man2html/Makefile.in 2012-05-02 21:58:50.621805568 -0600
@@ -2,7 +2,7 @@ CC = @CC@
CFLAGS += -Wall -Wstrict-prototypes -Wmissing-prototypes
OBJECTS = man2html.o cgibase.o abbrev.o strdefs.o
EXEEXT = @EXEEXT@
-bindir = $(DESTDIR)$(PREFIX)/usr/bin
+bindir = $(DESTDIR)$(PREFIX)/bin
mandir = $(DESTDIR)$(PREFIX)@mandir@
vardir = $(DESTDIR)$(PREFIX)/var
httpdir = $(DESTDIR)$(PREFIX)/home/httpd
diff -up man-1.6g/src/Makefile.in.orig man-1.6g/src/Makefile.in
--- man-1.6g/src/Makefile.in.orig 2010-12-31 13:28:46.006815744 -0700
+++ man-1.6g/src/Makefile.in 2012-05-02 21:59:22.845938688 -0600
@@ -30,6 +30,8 @@ LDFLAGS ?= -s
LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+
all: man$(EXEEXT) man.conf apropos whatis makewhatis
MANOBJS = man.o manfile.o manpath.o man-config.o man-getopt.o \
diff -up man-1.6g/src/man.conf.in.orig man-1.6g/src/man.conf.in
--- man-1.6g/src/man.conf.in.orig 2010-10-25 18:22:24.008388608 -0600
+++ man-1.6g/src/man.conf.in 2012-05-02 21:57:49.699400192 -0600
@@ -36,11 +36,14 @@
#
# Every automatically generated MANPATH includes these fields
#
-MANPATH /usr/man
-MANPATH /usr/share/man
-MANPATH /usr/local/man
-MANPATH /usr/local/share/man
-MANPATH /usr/X11R6/man
+MANPATH /boot/common/man
+MANPATH /boot/common/share/man
+MANPATH /boot/home/config/man
+MANPATH /boot/home/config/share/man
+MANPATH /boot/common/*/man
+MANPATH /boot/common/*/share/man
+MANPATH /boot/home/config/*/man
+MANPATH /boot/home/config/*/share/man
#
# Uncomment if you want to include one of these by default
#
@@ -58,15 +61,9 @@ MANPATH /usr/X11R6/man
# in the mandatory manpath already, but will keep man from statting
# lots of other nearby files and directories.
#
-MANPATH_MAP /bin /usr/share/man
-MANPATH_MAP /sbin /usr/share/man
-MANPATH_MAP /usr/bin /usr/share/man
-MANPATH_MAP /usr/sbin /usr/share/man
-MANPATH_MAP /usr/local/bin /usr/local/share/man
-MANPATH_MAP /usr/local/sbin /usr/local/share/man
-MANPATH_MAP /usr/X11R6/bin /usr/X11R6/man
-MANPATH_MAP /usr/bin/X11 /usr/X11R6/man
-MANPATH_MAP /usr/bin/mh /usr/share/man
+MANPATH_MAP /bin /boot/common/share/man
+MANPATH_MAP /boot/common/bin /boot/common/share/man
+MANPATH_MAP /boot/home/config/bin /boot/home/config/share/man
#
# NOAUTOPATH keeps man from automatically adding directories that look like
# manual page directories to the path.

View File

@@ -21,18 +21,18 @@ BUILD {
libtoolize --force --copy --install
aclocal
autoconf
mkdir -p ${DESTDIR}/`finddir B_COMMON_SERVERS_DIRECTORY`
mkdir -p ${DESTDIR}/`finddir B_COMMON_BIN_DIRECTORY`
mkdir -p ${DESTDIR}/`finddir B_COMMON_DOCUMENTATION_DIRECTORY`/man/man5
mkdir -p ${DESTDIR}/`finddir B_COMMON_DOCUMENTATION_DIRECTORY`/man/man8
./configure --prefix=`finddir B_COMMON_DIRECTORY` \
--sbindir=`finddir B_COMMON_SERVERS_DIRECTORY` \
--sbindir=`finddir B_COMMON_BIN_DIRECTORY` \
--mandir=`finddir B_COMMON_DOCUMENTATION_DIRECTORY`/man
make
}
INSTALL {
cd xinetd-2.3.14
mkdir -p ${DESTDIR}/`finddir B_COMMON_SERVERS_DIRECTORY`
mkdir -p ${DESTDIR}/`finddir B_COMMON_BIN_DIRECTORY`
mkdir -p ${DESTDIR}/`finddir B_COMMON_DOCUMENTATION_DIRECTORY`/man/man5
mkdir -p ${DESTDIR}/`finddir B_COMMON_DOCUMENTATION_DIRECTORY`/man/man8
make install DESTDIR=${DESTDIR}