[84045] trunk/dports/aqua/emacs-app
takanori at macports.org
takanori at macports.org
Thu Sep 15 13:12:25 PDT 2011
Revision: 84045
http://trac.macports.org/changeset/84045
Author: takanori at macports.org
Date: 2011-09-15 13:12:21 -0700 (Thu, 15 Sep 2011)
Log Message:
-----------
emacs-app: Applied a patch to allow working Imaxima with Cocoa Emacs. (Ticket #31196)
Modified Paths:
--------------
trunk/dports/aqua/emacs-app/Portfile
Added Paths:
-----------
trunk/dports/aqua/emacs-app/files/patch-src_emacs.c.diff
Modified: trunk/dports/aqua/emacs-app/Portfile
===================================================================
--- trunk/dports/aqua/emacs-app/Portfile 2011-09-15 19:34:09 UTC (rev 84044)
+++ trunk/dports/aqua/emacs-app/Portfile 2011-09-15 20:12:21 UTC (rev 84045)
@@ -5,7 +5,7 @@
name emacs-app
version 23.3
-revision 1
+revision 2
categories aqua editors
maintainers css
description The GNU Emacs text editor (Cocoa version)
@@ -35,7 +35,8 @@
configure.args --with-ns --without-x --without-dbus
-patchfiles patch-src_unexmacosx.c.diff
+patchfiles patch-src_emacs.c.diff \
+ patch-src_unexmacosx.c.diff
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} {
patchfiles-append patch-fullscreen.diff
@@ -65,6 +66,10 @@
configure.ldflags-append -fno-pie
}
+post-patch {
+ reinplace "s|__PREFIX__|${prefix}|" ${worksrcpath}/src/emacs.c
+}
+
destroot {
system "cd ${worksrcpath} && make install"
xinstall -m 755 -d ${destroot}${applications_dir}
Added: trunk/dports/aqua/emacs-app/files/patch-src_emacs.c.diff
===================================================================
--- trunk/dports/aqua/emacs-app/files/patch-src_emacs.c.diff (rev 0)
+++ trunk/dports/aqua/emacs-app/files/patch-src_emacs.c.diff 2011-09-15 20:12:21 UTC (rev 84045)
@@ -0,0 +1,37 @@
+--- src/emacs.c.orig 2011-01-09 02:45:14.000000000 +0900
++++ src/emacs.c 2011-09-09 23:13:44.000000000 +0900
+@@ -23,6 +23,8 @@
+ #include <signal.h>
+ #include <errno.h>
+ #include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
+
+ #include <sys/types.h>
+ #include <sys/file.h>
+@@ -839,6 +841,25 @@
+ #ifdef DARWIN_OS
+ if (!initialized)
+ unexec_init_emacs_zone ();
++
++ /* Imaxima won't work properly if PATH does not contain the
++ MacPorts directory. The following code is a workaround to
++ avoid this problem. */
++ {
++ char *oldpath = getenv("PATH");
++ if (!oldpath) {oldpath = "";}
++ size_t oldpathsize = strlen(oldpath) + 1;
++ if (!strstr(oldpath, "__PREFIX__/bin")) {
++ char *newpath;
++ size_t newpathsize = oldpathsize + strlen("__PREFIX__/bin:");
++ if ((newpath = (char *)malloc(newpathsize)) != NULL) {
++ strlcpy(newpath, "__PREFIX__/bin:", newpathsize);
++ strlcat(newpath, oldpath, newpathsize);
++ setenv("PATH", newpath, 1);
++ free(newpath);
++ }
++ }
++ }
+ #endif
+
+ sort_args (argc, argv);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20110915/72534afc/attachment.html>
More information about the macports-changes
mailing list