macports / aqua / emacs-app / Portfile

Full commit
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
# $Id: Portfile 89440 2012-01-29 10:29:46Z $

PortSystem          1.0

name                emacs-app
version             23.4
revision            1
categories          aqua editors
maintainers         css hum openmaintainer

description         The GNU Emacs text editor (Cocoa version)

long_description    GNU Emacs is a self-documenting, customizable, extensible  \
                    real-time display editor. This is a port of the latest GNU \
                    Emacs source to the OpenStep (or NeXTstep) APIs, as        \
                    implemented by Cocoa on OS X. It differs from Carbon ports \
                    of GNU Emacs in that it makes a more concerted attempt     \
                    from the ground up to follow OS X desktop and UI conventions.

# Note that this distribution can support GNUstep as well, but that
# configuration is untested at this time.

platforms           darwin
license             GPL-3+

master_sites        gnu:emacs
distname            emacs-${version}
dist_subdir         emacs
checksums           rmd160  5fb7e4cd4270a524b8723ad86a145a0e47336bf7 \
                    sha256  b9a2b8434052771f797d2032772eba862ff9aa143029efc72295170607289c18

depends_lib         port:ncurses

patchfiles          patch-src_emacs.c.diff
# patch.pre_args      -p1

if {${configure.compiler} == "clang"} {
    patchfiles-append   patch-clang.diff

post-patch {
    reinplace "s|__PREFIX__|${prefix}|" ${worksrcpath}/src/emacs.c

configure.args      --with-ns --without-x --without-dbus

use_parallel_build  yes

destroot {
    system "cd ${worksrcpath} && make install"
    xinstall -m 755 -d ${destroot}${applications_dir}
    file copy ${worksrcpath}/nextstep/ \
    file copy ${filespath}/site-start.el \

post-destroot {
    reinplace "s|__PREFIX__|${prefix}|g" \

# patch-fullscreen.diff
variant fullscreen description {Add fullscreen patch} {
    patchfiles-append   patch-fullscreen.diff

# inline and font patches are fetched from MacEmacsJP.
#   revision 574.
# patch-macemacsjp-inline.diff <= emacs-inline.patch
# patch-macemacsjp-jpfont.diff <= font.patch
variant inline description {Add inline patch from MacEmacsJP} {
    patchfiles-append   patch-macemacsjp-inline.diff

variant jpfont description {Add Japanese font patch from MacEmacsJP} {
    patchfiles-append   patch-macemacsjp-jpfont.diff

variant shiftmodifier conflicts inline description {Add Shift modifier patch from} {
    patchfiles-append   patch-shiftmodifier-with-ime.diff

variant patches requires fullscreen inline jpfont shiftmodifier description {Add all patches: fullscreen, inline and jpfont} {}

platform darwin 11 {
   patchfiles-append    patch-fix-title-bar.diff
   # patch-lion-fullscreen.diff
   if {[variant_isset fullscreen]} {
       patchfiles-append   patch-lion-fullscreen.diff
   configure.cflags-append   -fno-pie -O2
   configure.ldflags-append  -fno-pie

livecheck.type      regex
livecheck.regex     emacs-(\\d+\\.\\d+\\w*)\\.tar