Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
cookbook
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
redox-os
cookbook
Commits
7f27da77
Unverified
Commit
7f27da77
authored
7 years ago
by
Ian Douglas Scott
Browse files
Options
Downloads
Patches
Plain Diff
Recipe for GNU grep
parent
2067c829
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!52
Recipe for GNU grep
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
recipes/gnu-grep/grep.patch
+68
-0
68 additions, 0 deletions
recipes/gnu-grep/grep.patch
recipes/gnu-grep/recipe.sh
+34
-0
34 additions, 0 deletions
recipes/gnu-grep/recipe.sh
with
102 additions
and
0 deletions
recipes/gnu-grep/grep.patch
0 → 100644
+
68
−
0
View file @
7f27da77
Only in source: grep.patch
diff -ru source/lib/getdtablesize.c source-new/lib/getdtablesize.c
--- source/lib/getdtablesize.c 2017-07-23 20:50:44.287742363 -0700
+++ source-new/lib/getdtablesize.c 2017-07-23 20:51:06.271284748 -0700
@@ -109,15 +109,6 @@
int
getdtablesize (void)
{
- struct rlimit lim;
-
- if (getrlimit (RLIMIT_NOFILE, &lim) == 0
- && 0 <= lim.rlim_cur && lim.rlim_cur <= INT_MAX
- && lim.rlim_cur != RLIM_INFINITY
- && lim.rlim_cur != RLIM_SAVED_CUR
- && lim.rlim_cur != RLIM_SAVED_MAX)
- return lim.rlim_cur;
-
return INT_MAX;
}
diff -ru source/lib/getprogname.c source-new/lib/getprogname.c
--- source/lib/getprogname.c 2017-01-16 09:29:13.000000000 -0800
+++ source-new/lib/getprogname.c 2017-07-23 20:49:21.133618122 -0700
@@ -43,13 +43,11 @@
# include <string.h>
#endif
-#ifdef __sgi
# include <string.h>
# include <unistd.h>
# include <stdio.h>
# include <fcntl.h>
-# include <sys/procfs.h>
-#endif
+# include <limits.h>
#include "dirname.h"
@@ -178,7 +176,16 @@
}
return NULL;
# else
-# error "getprogname module not ported to this OS"
+ char filename[PATH_MAX];
+ int fd = open ("sys:exe", O_RDONLY);
+ if (fd > 0) {
+ int len = read(fd, filename, PATH_MAX-1);
+ if (len > 0) {
+ filename[len] = '\0';
+ return strdup(filename);
+ }
+ }
+ return NULL;
# endif
}
diff -ru source/src/grep.c source-new/src/grep.c
--- source/src/grep.c 2017-07-02 10:41:41.000000000 -0700
+++ source-new/src/grep.c 2017-07-23 20:53:10.439131874 -0700
@@ -2895,7 +2895,7 @@
#ifdef _SC_PAGESIZE
long psize = sysconf (_SC_PAGESIZE);
#else
- long psize = getpagesize ();
+ long psize = 4096;
#endif
if (! (0 < psize && psize <= (SIZE_MAX - sizeof (uword)) / 2))
abort ();
This diff is collapsed.
Click to expand it.
recipes/gnu-grep/recipe.sh
0 → 100644
+
34
−
0
View file @
7f27da77
VERSION
=
3.1
TAR
=
https://ftp.gnu.org/gnu/grep/grep-
$VERSION
.tar.xz
HOST
=
x86_64-elf-redox
function
recipe_update
{
echo
"skipping update"
skip
=
1
}
function
recipe_build
{
rm
-f
build-aux/missing
./configure
--host
=
${
HOST
}
--prefix
=
/
make
skip
=
1
}
function
recipe_test
{
echo
"skipping test"
skip
=
1
}
function
recipe_clean
{
make clean
skip
=
1
}
function
recipe_stage
{
dest
=
"
$(
realpath
$1
)
"
make
DESTDIR
=
"
$dest
"
install
$HOST
-strip
"
$1
"
/bin/grep
rm
-rf
"
$1
"
/
{
lib,share
}
skip
=
1
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment