Ticket #31196: emacs-app.diff
File emacs-app.diff, 2.3 KB (added by takanori@…, 13 years ago) |
---|
-
files/patch-emacs.c.diff
1 --- src/emacs.c.orig 2011-01-09 02:45:14.000000000 +0900 2 +++ src/emacs.c 2011-09-09 23:13:44.000000000 +0900 3 @@ -23,6 +23,8 @@ 4 #include <signal.h> 5 #include <errno.h> 6 #include <stdio.h> 7 +#include <stdlib.h> 8 +#include <string.h> 9 10 #include <sys/types.h> 11 #include <sys/file.h> 12 @@ -839,6 +841,25 @@ 13 #ifdef DARWIN_OS 14 if (!initialized) 15 unexec_init_emacs_zone (); 16 + 17 + /* Imaxima won't work properly if PATH does not contain the 18 + MacPorts directory. The following code is a workaround to 19 + avoid this problem. */ 20 + { 21 + char *oldpath = getenv("PATH"); 22 + if (!oldpath) {oldpath = "";} 23 + size_t oldpathsize = strlen(oldpath)+1; 24 + if (!strstr(oldpath, "__PREFIX__/bin")) { 25 + char *newpath; 26 + size_t newpathsize = oldpathsize + strlen("__PREFIX__/bin:"); 27 + if ((newpath = (char *)malloc(newpathsize)) != NULL) { 28 + strlcpy(newpath, "__PREFIX__/bin:", newpathsize); 29 + strlcat(newpath, oldpath, newpathsize); 30 + setenv("PATH", newpath, 1); 31 + free(newpath); 32 + } 33 + } 34 + } 35 #endif 36 37 sort_args (argc, argv); -
Portfile
5 5 6 6 name emacs-app 7 7 version 23.3 8 revision 18 revision 2 9 9 categories aqua editors 10 10 maintainers css 11 11 description The GNU Emacs text editor (Cocoa version) … … 35 35 36 36 configure.args --with-ns --without-x --without-dbus 37 37 38 patchfiles patch-src_unexmacosx.c.diff 38 patchfiles patch-src_unexmacosx.c.diff \ 39 patch-emacs.c.diff 39 40 40 41 variant fullscreen description {Add fullscreen patch from http://gist.github.com/291150 as mentioned in http://www.sanityinc.com/full-screen-support-for-cocoa-emacs-on-osx} { 41 42 patchfiles-append patch-fullscreen.diff … … 47 48 configure.ldflags-append -fno-pie 48 49 } 49 50 51 post-patch { 52 reinplace "s|__PREFIX__|${prefix}|" ${worksrcpath}/src/emacs.c 53 } 54 50 55 destroot { 51 56 system "cd ${worksrcpath} && make install" 52 57 xinstall -m 755 -d ${destroot}${applications_dir}