source: trunk/dports/aqua/emacs-mac-app/Portfile @ 98895

Last change on this file since 98895 was 98895, checked in by hum@…, 7 years ago

emacs-mac-app: fix post-destroot.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 4.1 KB
Line 
1# -*- 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
2# $Id: Portfile 98895 2012-10-20 10:07:11Z hum@macports.org $
3
4PortSystem          1.0
5
6name                emacs-mac-app
7version             3.2
8categories          aqua editors
9maintainers         hum openmaintainer
10
11description         Emacs Mac port
12
13long_description    ${name} is "Mac port" addition to GNU Emacs 24. This provides a native \
14                    GUI support for Mac OS X 10.4 - 10.8.
15
16homepage            http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00803.html
17platforms           darwin
18license             GPL-3+
19
20set emacs_version   24.2
21distname            emacs-${emacs_version}
22dist_subdir         emacs
23
24set mac_distname    emacs-${emacs_version}-mac-${version}
25set mac_distfile    ${mac_distname}${extract.suffix}
26distfiles-append    ${mac_distfile}:mac
27
28master_sites        gnu:emacs \
29                    ftp://ftp.math.s.chiba-u.ac.jp/emacs/:mac
30
31checksums           ${distname}${extract.suffix} \
32                    rmd160  26f6c2b671ed7f160875d62e47c89afec085110f \
33                    sha256  6d9892dff6e1761d4a5eba20712beba4f37d77a196f8021081a2e69fcb5bd357 \
34                    ${mac_distfile} \
35                    rmd160  b04dd09365007a6db16d32df16cf2c29c2b08b5c \
36                    sha256  5a887718c4576f74c26817d473ad6a6e37ceeb72056a7941cce9a689eb21b965
37
38depends_lib         port:ncurses
39
40patchfiles          patch-src_emacs.c.diff
41
42set mac_path        ${workpath}/${mac_distname}
43
44post-extract {
45    # merge mac port files into emacs distribution.
46    copy ${mac_path}/mac ${worksrcpath}
47    copy -force \
48         ${worksrcpath}/nextstep/Cocoa/Emacs.base/Contents/Resources/Emacs.icns \
49         ${worksrcpath}/mac/Emacs.app/Contents/Resources/Emacs.icns
50    foreach f [glob ${mac_path}/etc/images/*] {
51        copy ${f} ${worksrcpath}/etc/images
52    }
53    foreach f [glob ${mac_path}/src/*] {
54        copy ${f} ${worksrcpath}/src
55    }
56    copy ${mac_path}/lisp/term/mac-win.el ${worksrcpath}/lisp/term
57}
58
59post-patch {
60    # postprocess for patch-src_emacs.c.diff.
61    reinplace "s|__PREFIX__|${prefix}|" ${worksrcpath}/src/emacs.c
62    # apply mac port patch.
63    system -W ${worksrcpath} "patch -p 0 < ${mac_path}/patch-mac"
64}
65
66universal_variant   no
67
68configure.args      --with-mac \
69                    --enable-mac-app=${applications_dir}
70
71if {${os.major} >= 11 && ${os.platform} == "darwin"} {
72    configure.cflags-append -fobjc-arc
73}
74
75post-destroot {
76    # move files into the app bundle.
77    # https://github.com/railwaycat/emacs-mac-port/blob/master/build-emacs.app.sh
78    set app_dir ${destroot}${applications_dir}/Emacs.app/Contents/Resources
79    foreach d [glob ${destroot}${prefix}/share/emacs/${emacs_version}/*] {
80        move ${d} ${app_dir}
81    }
82    move ${destroot}${prefix}/share/info ${app_dir}
83    move ${destroot}${prefix}/share/man  ${app_dir}
84    move ${destroot}${prefix}/var        ${app_dir}
85    move ${destroot}${prefix}/bin        ${app_dir}/../MacOS
86    xinstall -d ${app_dir}/../MacOS/libexec
87    foreach f [glob ${destroot}${prefix}/libexec/emacs/${emacs_version}/*/*] {
88        move ${f} ${app_dir}/../MacOS/libexec
89    }
90    delete ${destroot}${prefix}
91    # make the application binary a hard link.
92    delete ${app_dir}/../MacOS/Emacs
93    file link -hard ${app_dir}/../MacOS/Emacs ${app_dir}/../MacOS/bin/emacs
94
95    # install additional documents.
96    set doc_dir ${destroot}${prefix}/share/doc/emacs-mac
97    xinstall -d ${doc_dir}
98    xinstall -m 644 -W ${mac_path} \
99        COPYING NEWS-mac README-mac \
100        ${doc_dir}
101    # install site-start.el.
102    set site_lisp ${destroot}${applications_dir}/Emacs.app/Contents/Resources/site-lisp
103    xinstall -d ${site_lisp}
104    file copy ${filespath}/site-start.el ${site_lisp}
105    reinplace "s|__PREFIX__|${prefix}|g" ${site_lisp}/site-start.el
106    # rename the app bundle to avoid a conflict with emacs-app.
107    move ${destroot}${applications_dir}/Emacs.app \
108         ${destroot}${applications_dir}/EmacsMac.app
109}
110
111livecheck.type      regex
112livecheck.url       ftp://ftp.math.s.chiba-u.ac.jp/emacs/
113livecheck.regex     emacs-\\d+\\.\\d+\\w*-mac-(\\d+\\.\\d+\\w*)\\.tar
Note: See TracBrowser for help on using the repository browser.