/
Portfile
227 lines (191 loc) · 7.36 KB
/
Portfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
# -*- 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
PortSystem 1.0
PortGroup active_variants 1.1
name emacs
categories editors
license GPL-3+
maintainers {dports @drkp} openmaintainer
description The GNU Emacs text editor
long_description \
GNU Emacs is a self-documenting, customizable, extensible real-time \
display editor. Users new to Emacs will be able to use basic \
features fairly rapidly by studying the tutorial and using the \
self-documentation features. Emacs also has an extensive \
interactive manual browser. It is easily extensible since its \
editing commands are written in Lisp.
platforms darwin freebsd
homepage https://www.gnu.org/software/emacs/emacs.html
master_sites gnu
if {$subport eq $name} {
conflicts xemacs emacs-devel
}
subport emacs-devel {
conflicts xemacs $name
}
subport emacs-app {
conflicts emacs-app-devel
}
subport emacs-app-devel {
conflicts emacs-app
}
depends_build-append port:autoconf port:automake port:libtool
configure.args --without-ns \
--without-x \
--without-dbus \
--without-gconf \
--without-libotf \
--without-m17n-flt \
--without-gpm \
--with-gnutls \
--with-xml2 \
--with-modules \
--infodir ${prefix}/share/info/${name}
depends_build-append port:pkgconfig \
port:texinfo
depends_lib-append port:ncurses \
port:libxml2 \
port:gnutls
post-destroot {
xinstall -d ${destroot}${prefix}/share/emacs/${version}/leim
delete ${destroot}${prefix}/bin/ctags
delete ${destroot}${prefix}/share/man/man1/ctags.1.gz
}
platform darwin {
post-patch {
# Leopard's Xcode 3.1.x ld(1) man page claims -no_pie is supported, but it's not
if {${os.major} < 9} {
reinplace "s:-fno-pie::" ${worksrcpath}/configure
} elseif {${os.major} > 10} {
configure.ldflags-append -Wl,-no_pie
}
}
}
if {$subport eq $name || $subport eq "emacs-app"} {
version 26.1
revision 2
checksums rmd160 f13fe104345738c853bcce2e3e061dbfb8692bc5 \
sha256 760382d5e8cdc5d0d079e8f754bce1136fbe1473be24bb885669b0e38fc56aa3 \
size 65007481
patchfiles patch-configure.diff
pre-configure {
system -W ${worksrcpath} "sh ./autogen.sh"
}
}
if {$subport eq "emacs-devel" || $subport eq "emacs-app-devel"} {
epoch 1
version 20190111
fetch.type git
git.url http://git.savannah.gnu.org/r/emacs.git
git.branch e567ac149518967f992b1286d90d94df6bb589b7
pre-configure {
system -W ${worksrcpath} "sh ./autogen.sh"
}
configure.args-append --with-json
depends_lib-append port:jansson
livecheck.type none
} else {
livecheck.type regex
livecheck.url https://ftp.gnu.org/gnu/emacs/?C=M&O=D
livecheck.regex ${name}-(\\d+\\.\\d+\\w*)\\.tar
}
if {$subport eq $name || $subport eq "emacs-devel"} {
PortGroup muniversal 1.0
variant x11 description {Builds emacs as a X11 program with Lucid widgets} {
configure.args-delete --without-x
configure.args-append --with-x-toolkit=lucid \
--without-xaw3d \
--without-imagemagick \
--with-xpm \
--with-jpeg \
--with-tiff \
--with-gif \
--with-png \
--with-lcms2 \
--without-rsvg \
--with-xft
depends_lib-append port:xorg-libXmu \
port:xorg-libXaw \
port:xpm \
port:jpeg \
port:tiff \
port:giflib \
port:libpng \
port:lcms2 \
port:Xft2
# autoconf appears to be dropping linker flags for freetype &
# fontconfig; work around this. See #28083
configure.ldflags-append -lfreetype -lfontconfig
}
variant motif requires x11 description {Builds emacs as an X11 program with Motif widgets} {
configure.args-delete --with-x-toolkit=lucid
configure.args-append --with-x-toolkit=motif
depends_lib-append lib:libXm:openmotif
}
variant gtk requires x11 description {Builds emacs as an X11 program with GTK+2 widgets} {
configure.args-delete --with-x-toolkit=lucid
configure.args-delete --without-gconf
configure.args-delete --without-rsvg
configure.args-append --with-x-toolkit=gtk2
configure.args-append --with-gconf
configure.args-append --with-rsvg
depends_lib-append port:gtk2 \
path:lib/pkgconfig/glib-2.0.pc:glib2 \
port:gconf \
port:librsvg
# see #21917
require_active_variants gtk2 x11
}
# imagemagick variant requires either x11 or quartz, so we have to
# define it twice; see #53315
variant imagemagick requires x11 description {Use ImageMagick} {
depends_lib-append port:ImageMagick
configure.args-append --with-imagemagick
}
variant dbus description {Builds emacs with D-Bus support} {
# our dbus is autolaunched by launchd, so disable the check that it's running
patchfiles-append patch-src_dbusbind.c.diff
configure.args-delete --without-dbus
configure.args-append --with-dbus
depends_lib-append port:dbus
}
post-destroot {
xinstall -m 755 -d ${destroot}${prefix}/include/emacs
xinstall -m 644 ${worksrcpath}/src/emacs-module.h \
${destroot}${prefix}/include/emacs
}
}
if {$subport eq "emacs-app" || $subport eq "emacs-app-devel"} {
categories-append aqua
configure.args-append --with-ns --with-lcms2
configure.args-delete --without-ns --without-x
depends_lib-append port:lcms2
universal_variant no
destroot {
system -W ${worksrcpath} "make install"
xinstall -m 755 -d ${destroot}${applications_dir}
file copy ${worksrcpath}/nextstep/Emacs.app \
${destroot}${applications_dir}
# fix read-permission to resources
system "chmod a+r ${destroot}${applications_dir}/Emacs.app/Contents/Resources/*"
file copy ${filespath}/site-start.el \
${destroot}${applications_dir}/Emacs.app/Contents/Resources/site-lisp
reinplace "s|__PREFIX__|${prefix}|g" \
${destroot}${applications_dir}/Emacs.app/Contents/Resources/site-lisp/site-start.el
}
if {$subport eq "emacs-app"} {
revision 3
}
variant multicolor_font description {Apply multicolor font patch} {
# Revert "Disable multicolor fonts on OS X..."
# This reverts commit 9344612d3cd164317170b6189ec43175757e4231.
patchfiles-append patch-enable-multicolor-fonts.diff
}
variant imagemagick description {Use ImageMagick} {
depends_lib-append port:ImageMagick
configure.args-append --with-imagemagick
}
variant rsvg description {Use librsvg} {
depends_lib-append port:librsvg
configure.args-append --with-rsvg
}
}