mirror of
https://gitlab.redox-os.org/redox-os/redox.git
synced 2026-06-21 04:14:17 +08:00
Recipe for sed
This commit is contained in:
parent
53653625f3
commit
81afdbacab
37
recipes/sed/recipe.sh
Normal file
37
recipes/sed/recipe.sh
Normal file
@ -0,0 +1,37 @@
|
||||
VERSION=4.4
|
||||
TAR=http://ftp.gnu.org/gnu/sed/sed-$VERSION.tar.xz
|
||||
|
||||
HOST=x86_64-elf-redox
|
||||
|
||||
function recipe_version {
|
||||
echo "$VERSION"
|
||||
skip=1
|
||||
}
|
||||
|
||||
function recipe_update {
|
||||
echo "skipping update"
|
||||
skip=1
|
||||
}
|
||||
|
||||
function recipe_build {
|
||||
autoreconf
|
||||
./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
|
||||
skip=1
|
||||
}
|
||||
36
recipes/sed/sed.patch
Normal file
36
recipes/sed/sed.patch
Normal file
@ -0,0 +1,36 @@
|
||||
diff -ru source/lib/getprogname.c source-new/lib/getprogname.c
|
||||
--- source/lib/getprogname.c 2017-01-16 21:36:00.000000000 -0800
|
||||
+++ source-new/lib/getprogname.c 2017-07-13 16:13:35.966956860 -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
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user