diff options
Diffstat (limited to 'pkg/plan9port/patch')
5 files changed, 198 insertions, 0 deletions
diff --git a/pkg/plan9port/patch/0001-Fix-build-with-musl.patch b/pkg/plan9port/patch/0001-Fix-build-with-musl.patch new file mode 100644 index 00000000..65507008 --- /dev/null +++ b/pkg/plan9port/patch/0001-Fix-build-with-musl.patch @@ -0,0 +1,62 @@ +From bc48772672bdb1436455e078b17df47a63813394 Mon Sep 17 00:00:00 2001 +From: Michael Forney <mforney@mforney.org> +Date: Sun, 10 Apr 2016 02:50:03 -0700 +Subject: [PATCH] Fix build with musl + +--- + src/lib9/dirread.c | 34 ---------------------------------- + 1 file changed, 34 deletions(-) + +diff --git a/src/lib9/dirread.c b/src/lib9/dirread.c +index 40fbe3c..345f49c 100644 +--- a/src/lib9/dirread.c ++++ b/src/lib9/dirread.c +@@ -6,45 +6,11 @@ + + extern int _p9dir(struct stat*, struct stat*, char*, Dir*, char**, char*); + +-#if defined(__linux__) +-static int +-mygetdents(int fd, struct dirent *buf, int n) +-{ +- off_t off; +- int nn; +- +- /* This doesn't match the man page, but it works in Debian with a 2.2 kernel */ +- off = p9seek(fd, 0, 1); +- nn = getdirentries(fd, (void*)buf, n, &off); +- return nn; +-} +-#elif defined(__APPLE__) +-static int +-mygetdents(int fd, struct dirent *buf, int n) +-{ +- long off; +- return getdirentries(fd, (void*)buf, n, &off); +-} +-#elif defined(__FreeBSD__) || defined(__DragonFly__) +-static int +-mygetdents(int fd, struct dirent *buf, int n) +-{ +- off_t off; +- return getdirentries(fd, (void*)buf, n, &off); +-} +-#elif defined(__sun__) || defined(__NetBSD__) || defined(__OpenBSD__) + static int + mygetdents(int fd, struct dirent *buf, int n) + { + return getdents(fd, (void*)buf, n); + } +-#elif defined(__AIX__) +-static int +-mygetdents(int fd, struct dirent *buf, int n) +-{ +- return getdirent(fd, (void*)buf, n); +-} +-#endif + + #if defined(__DragonFly__) + static inline int d_reclen(struct dirent *de) { return _DIRENT_DIRSIZ(de); } +-- +2.8.1 + diff --git a/pkg/plan9port/patch/0002-rc-Look-for-lib-rcmain.patch b/pkg/plan9port/patch/0002-rc-Look-for-lib-rcmain.patch new file mode 100644 index 00000000..dbe342ee --- /dev/null +++ b/pkg/plan9port/patch/0002-rc-Look-for-lib-rcmain.patch @@ -0,0 +1,58 @@ +From 73124caea18f5d36417ec24b8e69b540daf97bc2 Mon Sep 17 00:00:00 2001 +From: Michael Forney <mforney@mforney.org> +Date: Wed, 18 May 2016 22:58:17 -0700 +Subject: [PATCH] rc: Look for /lib/rcmain + +--- + src/cmd/rc/exec.c | 2 +- + src/cmd/rc/plan9ish.c | 6 +----- + src/cmd/rc/rc.h | 2 +- + 3 files changed, 3 insertions(+), 7 deletions(-) + +diff --git a/src/cmd/rc/exec.c b/src/cmd/rc/exec.c +index 03c96d4..1fb9be5 100644 +--- a/src/cmd/rc/exec.c ++++ b/src/cmd/rc/exec.c +@@ -147,7 +147,7 @@ main(int argc, char *argv[]) + if(flag['I']) + flag['i'] = 0; + else if(flag['i']==0 && argc==1 && Isatty(0)) flag['i'] = flagset; +- rcmain = flag['m'] ? flag['m'][0] : Rcmain(); ++ rcmain = flag['m'] ? flag['m'][0] : Rcmain; + err = openfd(2); + kinit(); + Trapinit(); +diff --git a/src/cmd/rc/plan9ish.c b/src/cmd/rc/plan9ish.c +index da9d867..60c0ee4 100644 +--- a/src/cmd/rc/plan9ish.c ++++ b/src/cmd/rc/plan9ish.c +@@ -24,12 +24,8 @@ char *syssigname[]={ + "term", + 0 + }; +-char* +-Rcmain(void) +-{ +- return unsharp("#9/rcmain"); +-} + ++char Rcmain[]="/lib/rcmain"; + char Fdprefix[]="/dev/fd/"; + long readnb(int, char *, long); + void execfinit(void); +diff --git a/src/cmd/rc/rc.h b/src/cmd/rc/rc.h +index 7778ff4..986b8be 100644 +--- a/src/cmd/rc/rc.h ++++ b/src/cmd/rc/rc.h +@@ -135,7 +135,7 @@ int doprompt; /* is it time for a prompt? */ + */ + #define PRD 0 + #define PWR 1 +-extern char *Rcmain(), Fdprefix[]; ++extern char Rcmain[], Fdprefix[]; + #define register + /* + * How many dot commands have we executed? +-- +2.8.1 + diff --git a/pkg/plan9port/patch/0003-rcmain-Don-t-use-PLAN9-bin-9.patch b/pkg/plan9port/patch/0003-rcmain-Don-t-use-PLAN9-bin-9.patch new file mode 100644 index 00000000..04c884b0 --- /dev/null +++ b/pkg/plan9port/patch/0003-rcmain-Don-t-use-PLAN9-bin-9.patch @@ -0,0 +1,30 @@ +From 4e822f477a9d1c71c5489e59bd30ee4b3e2f5058 Mon Sep 17 00:00:00 2001 +From: Michael Forney <mforney@mforney.org> +Date: Wed, 18 May 2016 23:02:03 -0700 +Subject: [PATCH] rcmain: Don't use $PLAN9/bin/9 + +--- + rcmain | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/rcmain b/rcmain +index 461cb3e..a73014d 100644 +--- a/rcmain ++++ b/rcmain +@@ -29,11 +29,11 @@ if(flag i){ + # is not sufficient when running in a subshell + # that is rc -e (like mk uses!) + if(builtin cd $1){ +- if(flag i) $PLAN9/bin/9 awd || status='' ++ if(flag i) awd || status='' + status='' + } + } +- $PLAN9/bin/9 awd ++ awd + } + if(flag l && test -r $home/lib/profile) . $home/lib/profile + status='' +-- +2.8.1 + diff --git a/pkg/plan9port/patch/0004-Fix-sys-termios.h-include-to-termios.h.patch b/pkg/plan9port/patch/0004-Fix-sys-termios.h-include-to-termios.h.patch new file mode 100644 index 00000000..0de91323 --- /dev/null +++ b/pkg/plan9port/patch/0004-Fix-sys-termios.h-include-to-termios.h.patch @@ -0,0 +1,25 @@ +From 0af022a4cef553bf2b09bdc6079d22adef7164ad Mon Sep 17 00:00:00 2001 +From: Michael Forney <mforney@mforney.org> +Date: Sat, 10 Dec 2016 23:54:51 -0800 +Subject: [PATCH] Fix sys/termios.h include to termios.h + +--- + src/lib9/readcons.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/lib9/readcons.c b/src/lib9/readcons.c +index 8de44b8f..289f0f3b 100644 +--- a/src/lib9/readcons.c ++++ b/src/lib9/readcons.c +@@ -2,7 +2,7 @@ + #define NOPLAN9DEFINES + #include <libc.h> + #include <termios.h> +-#include <sys/termios.h> ++#include <termios.h> + + static int + rawx(int fd, int echoing) +-- +2.11.0 + diff --git a/pkg/plan9port/patch/0005-Include-u.h-before-any-other-system-headers.patch b/pkg/plan9port/patch/0005-Include-u.h-before-any-other-system-headers.patch new file mode 100644 index 00000000..0b022c64 --- /dev/null +++ b/pkg/plan9port/patch/0005-Include-u.h-before-any-other-system-headers.patch @@ -0,0 +1,23 @@ +From c35ccfd7b03be1770ba3894e2e97b7faf87b8634 Mon Sep 17 00:00:00 2001 +From: Michael Forney <mforney@mforney.org> +Date: Sun, 11 Dec 2016 13:28:47 -0800 +Subject: [PATCH] Include <u.h> before any other system headers + +Otherwise, the system headers may provide different values for feature test +macros than we do in u.h. +--- + src/cmd/rc/io.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/cmd/rc/io.c b/src/cmd/rc/io.c +index bb8af4ab..ac3b7585 100644 +--- a/src/cmd/rc/io.c ++++ b/src/cmd/rc/io.c +@@ -1,3 +1,4 @@ ++#include <u.h> + #include <limits.h> + #include "rc.h" + #include "exec.h" +-- +2.11.0 + |
