diff --git a/sys-apps/gawk/gawk-5.0.1.recipe b/sys-apps/gawk/gawk-5.0.1.recipe new file mode 100644 index 000000000..2f333290f --- /dev/null +++ b/sys-apps/gawk/gawk-5.0.1.recipe @@ -0,0 +1,76 @@ +SUMMARY="A pattern scanning and processing language" +DESCRIPTION=" +If you are like many computer users, you would frequently like to make \ +changes in various text files wherever certain patterns appear, or \ +extract data from parts of certain lines while discarding the rest. To \ +write a program to do this in a language such as C or Pascal is a \ +time-consuming inconvenience that may take many lines of code. The job \ +is easy with awk, especially the GNU implementation: gawk. + +The awk utility interprets a special-purpose programming language that \ +makes it possible to handle simple data-reformatting jobs with just a \ +few lines of code. +" +HOMEPAGE="http://www.gnu.org/s/gawk" +COPYRIGHT="1983-2017 Free Software Foundation, Inc." +LICENSE="GNU GPL v3" +REVISION="1" +SOURCE_URI="https://ftp.gnu.org/gnu/gawk/gawk-$portVersion.tar.gz" +CHECKSUM_SHA256="625bf3718e25a84dc4486135d5cb5388174682362c70107fd13f21572f5603bb" +PATCHES="gawk-$portVersion.patchset" + +ARCHITECTURES="?x86_gcc2 ?x86 x86_64 ?arm" + +GLOBAL_WRITABLE_FILES=" + settings/profile.d/gawk.csh keep-old + settings/profile.d/gawk.sh keep-old + " + +PROVIDES=" + gawk = $portVersion compat >= 5 + cmd:awk = $portVersion compat >= 3 + cmd:gawk = $portVersion compat >= 3 + cmd:igawk = $portVersion compat >= 3 + " +REQUIRES=" + haiku + lib:libgmp + lib:libmpfr + " + +BUILD_REQUIRES=" + haiku_devel + devel:libmpfr + " +BUILD_PREREQUIRES=" + cmd:awk + cmd:gcc + cmd:ld + cmd:make + cmd:sed + " + +TEST_REQUIRES=" + cmd:cmp + " + +defineDebugInfoPackage gawk \ + $binDir/gawk + +BUILD() +{ + AUTOCONF=: AUTOMAKE=: \ + runConfigure ./configure \ + --disable-rpath --with-gnu-ld + make $jobArgs +} + +INSTALL() +{ + make install +} + +TEST() +{ + make check +} diff --git a/sys-apps/gawk/patches/gawk-5.0.1.patchset b/sys-apps/gawk/patches/gawk-5.0.1.patchset new file mode 100644 index 000000000..f9a9b73bc --- /dev/null +++ b/sys-apps/gawk/patches/gawk-5.0.1.patchset @@ -0,0 +1,78 @@ +From 0e94b2cadb89649014ef45cacc0b0992cafb2657 Mon Sep 17 00:00:00 2001 +From: Jerome Duval +Date: Mon, 4 May 2015 18:51:15 +0000 +Subject: Haiku patch + + +diff --git a/extension/stack.c b/extension/stack.c +index 637378e..319ee3a 100644 +--- a/extension/stack.c ++++ b/extension/stack.c +@@ -31,14 +31,14 @@ + + static size_t size; + static void **stack; +-static int index = -1; ++static int stack_index = -1; + + /* stack_empty --- return true if stack is empty */ + + int + stack_empty() + { +- return index < 0; ++ return stack_index < 0; + } + + /* stack_top --- return top object on the stack */ +@@ -49,7 +49,7 @@ stack_top() + if (stack_empty() || stack == NULL) + return NULL; + +- return stack[index]; ++ return stack[stack_index]; + } + + /* stack_pop --- pop top object and return it */ +@@ -60,7 +60,7 @@ stack_pop() + if (stack_empty() || stack == NULL) + return NULL; + +- return stack[index--]; ++ return stack[stack_index--]; + } + + /* stack_push --- push an object onto the stack */ +@@ -75,7 +75,7 @@ int stack_push(void *object) + if (stack == NULL) + return 0; + size = INITIAL_STACK; +- } else if (index + 1 >= size) { ++ } else if (stack_index + 1 >= size) { + if (new_size < size) + return 0; + new_stack = realloc(stack, new_size * sizeof(void *)); +@@ -85,6 +85,6 @@ int stack_push(void *object) + stack = new_stack; + } + +- stack[++index] = object; ++ stack[++stack_index] = object; + return 1; + } +diff --git a/io.c b/io.c +index 378b115..935b600 100644 +--- a/io.c ++++ b/io.c +@@ -47,6 +47,8 @@ + #define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) + #endif + ++#include ++ + #ifdef HAVE_TERMIOS_H + #include + #endif +-- +2.14.2 +