| @@ -1,60 +1,89 @@ | | | @@ -1,60 +1,89 @@ |
1 | # $NetBSD: options.mk,v 1.1 2023/07/31 15:03:33 ryoon Exp $ | | 1 | # $NetBSD: options.mk,v 1.2 2023/08/12 03:20:58 wiz Exp $ |
2 | | | 2 | |
3 | ### Set options | | 3 | ### Set options |
4 | PKG_OPTIONS_VAR= PKG_OPTIONS.emacs | | 4 | PKG_OPTIONS_VAR= PKG_OPTIONS.emacs |
5 | PKG_SUPPORTED_OPTIONS= dbus gnutls imagemagick jansson svg xaw3d xml | | 5 | PKG_SUPPORTED_OPTIONS= dbus gnutls imagemagick jansson libgccjit libotf libwebp svg tree-sitter xaw3d xml |
6 | # xaw3d is only valid with tookit = xaw | | 6 | # xaw3d is only valid with tookit = xaw |
7 | | | 7 | |
8 | PKG_OPTIONS_OPTIONAL_GROUPS+= window-system | | 8 | PKG_OPTIONS_OPTIONAL_GROUPS+= window-system |
9 | PKG_OPTIONS_GROUP.window-system= x11 nextstep | | 9 | PKG_OPTIONS_GROUP.window-system= x11 nextstep |
10 | | | 10 | |
11 | PKG_OPTIONS_OPTIONAL_GROUPS+= toolkit | | 11 | PKG_OPTIONS_OPTIONAL_GROUPS+= toolkit |
12 | PKG_SUGGESTED_OPTIONS.Darwin= nextstep | | 12 | PKG_SUGGESTED_OPTIONS.Darwin= nextstep |
13 | # --with-x-toolkit=KIT use an X toolkit (KIT one of: yes or gtk2, | | 13 | # --with-x-toolkit=KIT use an X toolkit (KIT one of: yes or gtk2, |
14 | # gtk3, xaw or lucid or athena, motif, no) | | 14 | # gtk3, xaw, no) |
15 | # gtk in next line implies gtk2, xaw = athena = lucid | | 15 | # gtk in next line implies gtk2, xaw |
16 | PKG_OPTIONS_GROUP.toolkit= gtk gtk2 gtk3 motif xaw | | 16 | PKG_OPTIONS_GROUP.toolkit= gtk gtk2 gtk3 xaw |
17 | # gtk2 and gtk has the same effect | | 17 | # gtk2 and gtk has the same effect |
18 | # gtk3 is default in the logic below (even not included in SUGGESTED_=) | | 18 | # gtk3 is default in the logic below (even not included in SUGGESTED_=) |
19 | # gtk* will be ignored for nextstep even shown as selected. | | 19 | # gtk* will be ignored for nextstep even shown as selected. |
20 | | | 20 | |
21 | # imagemagick is disabled because of stability/security | | 21 | # imagemagick is disabled because of stability/security |
22 | # svg is omitted because it is rarely needed and heavyweight due to the rust dependency | | 22 | # svg is omitted because it is rarely needed and heavyweight due to the rust dependency |
23 | # xaw3d is omitted because it is only valid with xaw | | 23 | # xaw3d is omitted because it is only valid with xaw |
24 | PKG_SUGGESTED_OPTIONS= dbus gnutls gtk3 jansson xml x11 | | 24 | PKG_SUGGESTED_OPTIONS= dbus libgccjit gnutls gtk3 jansson libotf libwebp tree-sitter xml x11 |
25 | | | 25 | |
26 | .include "../../mk/bsd.options.mk" | | 26 | .include "../../mk/bsd.options.mk" |
27 | | | 27 | |
28 | ### --- Check window-system independent options first | | 28 | ### --- Check window-system independent options first |
29 | ### | | 29 | ### |
30 | ### Support D-BUS | | 30 | ### Support D-BUS |
31 | ### | | 31 | ### |
32 | .if !empty(PKG_OPTIONS:Mdbus) | | 32 | .if !empty(PKG_OPTIONS:Mdbus) |
33 | . include "../../sysutils/dbus/buildlink3.mk" | | 33 | . include "../../sysutils/dbus/buildlink3.mk" |
34 | .else | | 34 | .else |
35 | CONFIGURE_ARGS+= --without-dbus | | 35 | CONFIGURE_ARGS+= --without-dbus |
36 | .endif | | 36 | .endif |
37 | | | 37 | |
38 | ### | | 38 | ### |
39 | ### Support JSON | | 39 | ### Support JSON |
40 | ### | | 40 | ### |
41 | .if !empty(PKG_OPTIONS:Mjansson) | | 41 | .if !empty(PKG_OPTIONS:Mjansson) |
42 | . include "../../textproc/jansson/buildlink3.mk" | | 42 | . include "../../textproc/jansson/buildlink3.mk" |
43 | .else | | 43 | .else |
44 | CONFIGURE_ARGS+= --without-json | | 44 | CONFIGURE_ARGS+= --without-json |
45 | .endif | | 45 | .endif |
46 | | | 46 | |
47 | ### | | 47 | ### |
| | | 48 | ### Support libgccjit |
| | | 49 | ### |
| | | 50 | .if !empty(PKG_OPTIONS:Mlibgccjit) |
| | | 51 | CONFIGURE_ARGS+= --with-native-compilation |
| | | 52 | LDFLAGS+= ${COMPILER_RPATH_FLAG}${BUILDLINK_PREFIX.gcc13-libjit}/gcc13/lib |
| | | 53 | GENERATE_PLIST+= cd ${DESTDIR}${PREFIX} && \ |
| | | 54 | ${FIND} lib/emacs/${PKGVERSION_NOREV}/native-lisp/ \( -type f -o -type l \) -print | ${SORT}; |
| | | 55 | . include "../../lang/gcc13-libjit/buildlink3.mk" |
| | | 56 | .endif |
| | | 57 | |
| | | 58 | ### |
| | | 59 | ### Support OTF |
| | | 60 | ### |
| | | 61 | .if !empty(PKG_OPTIONS:Mlibotf) |
| | | 62 | . include "../../graphics/libotf/buildlink3.mk" |
| | | 63 | .else |
| | | 64 | CONFIGURE_ARGS+= --without-libotf |
| | | 65 | .endif |
| | | 66 | |
| | | 67 | ### |
| | | 68 | ### Support WEBP |
| | | 69 | ### |
| | | 70 | .if !empty(PKG_OPTIONS:Mlibwebp) |
| | | 71 | . include "../../graphics/libwebp/buildlink3.mk" |
| | | 72 | .else |
| | | 73 | CONFIGURE_ARGS+= --without-webp |
| | | 74 | .endif |
| | | 75 | |
| | | 76 | ### |
48 | ### Support XML2 | | 77 | ### Support XML2 |
49 | ### | | 78 | ### |
50 | .if !empty(PKG_OPTIONS:Mxml) | | 79 | .if !empty(PKG_OPTIONS:Mxml) |
51 | USE_TOOLS+= pkg-config | | 80 | USE_TOOLS+= pkg-config |
52 | BUILDLINK_API_DEPENDS.libxml2+= libxml2>=2.6.17 | | 81 | BUILDLINK_API_DEPENDS.libxml2+= libxml2>=2.6.17 |
53 | .include "../../textproc/libxml2/buildlink3.mk" | | 82 | .include "../../textproc/libxml2/buildlink3.mk" |
54 | .else | | 83 | .else |
55 | CONFIGURE_ARGS+= --without-xml2 | | 84 | CONFIGURE_ARGS+= --without-xml2 |
56 | .endif | | 85 | .endif |
57 | | | 86 | |
58 | ### | | 87 | ### |
59 | ### Support gnutls | | 88 | ### Support gnutls |
60 | ### | | 89 | ### |
| @@ -67,27 +96,26 @@ CONFIGURE_ARGS+= --without-gnutls | | | @@ -67,27 +96,26 @@ CONFIGURE_ARGS+= --without-gnutls |
67 | | | 96 | |
68 | ### | | 97 | ### |
69 | ### Check non nextstep (implies x11) options | | 98 | ### Check non nextstep (implies x11) options |
70 | ### | | 99 | ### |
71 | ### x11 is selected (as SUGGESTED above) | | 100 | ### x11 is selected (as SUGGESTED above) |
72 | ### | | 101 | ### |
73 | .if !empty(PKG_OPTIONS:Mx11) | | 102 | .if !empty(PKG_OPTIONS:Mx11) |
74 | ### | | 103 | ### |
75 | ### on OSX the configure script will select the "nextstep" window system | | 104 | ### on OSX the configure script will select the "nextstep" window system |
76 | ### unless you explicitly tell it not to. this should not impact other | | 105 | ### unless you explicitly tell it not to. this should not impact other |
77 | ### platforms. | | 106 | ### platforms. |
78 | ### | | 107 | ### |
79 | CONFIGURE_ARGS+= --without-ns | | 108 | CONFIGURE_ARGS+= --without-ns |
80 | | | | |
81 | ### | | 109 | ### |
82 | ### Support SVG | | 110 | ### Support SVG |
83 | ### | | 111 | ### |
84 | . if !empty(PKG_OPTIONS:Msvg) | | 112 | . if !empty(PKG_OPTIONS:Msvg) |
85 | .include "../../graphics/librsvg/buildlink3.mk" | | 113 | .include "../../graphics/librsvg/buildlink3.mk" |
86 | . else | | 114 | . else |
87 | CONFIGURE_ARGS+= --without-rsvg | | 115 | CONFIGURE_ARGS+= --without-rsvg |
88 | . endif | | 116 | . endif |
89 | | | 117 | |
90 | ### | | 118 | ### |
91 | ### Support ImageMagick (not recognized for now, sorry) | | 119 | ### Support ImageMagick (not recognized for now, sorry) |
92 | ### | | 120 | ### |
93 | . if !empty(PKG_OPTIONS:Mimagemagick) | | 121 | . if !empty(PKG_OPTIONS:Mimagemagick) |
| @@ -101,57 +129,52 @@ CONFIGURE_ARGS+= --without-imagemagick | | | @@ -101,57 +129,52 @@ CONFIGURE_ARGS+= --without-imagemagick |
101 | ### Support Xaw3d (This is only valid with Lucid Toolkit) | | 129 | ### Support Xaw3d (This is only valid with Lucid Toolkit) |
102 | ### | | 130 | ### |
103 | . if !empty(PKG_OPTIONS:Mxaw3d) | | 131 | . if !empty(PKG_OPTIONS:Mxaw3d) |
104 | .include "../../x11/libXaw3d/buildlink3.mk" | | 132 | .include "../../x11/libXaw3d/buildlink3.mk" |
105 | . else | | 133 | . else |
106 | CONFIGURE_ARGS+= --without-xaw3d | | 134 | CONFIGURE_ARGS+= --without-xaw3d |
107 | . endif | | 135 | . endif |
108 | | | 136 | |
109 | ### | | 137 | ### |
110 | ### Toolkit selection | | 138 | ### Toolkit selection |
111 | ### | | 139 | ### |
112 | . if (empty(PKG_OPTIONS:Mxaw) && \ | | 140 | . if (empty(PKG_OPTIONS:Mxaw) && \ |
113 | empty(PKG_OPTIONS:Mgtk) && \ | | 141 | empty(PKG_OPTIONS:Mgtk) && \ |
114 | empty(PKG_OPTIONS:Mgtk2) && \ | | 142 | empty(PKG_OPTIONS:Mgtk2)) |
115 | empty(PKG_OPTIONS:Mmotif)) | | | |
116 | # defaults to gtk3 | | 143 | # defaults to gtk3 |
117 | USE_TOOLS+= pkg-config | | 144 | USE_TOOLS+= pkg-config |
118 | .include "../../x11/gtk3/buildlink3.mk" | | 145 | .include "../../x11/gtk3/buildlink3.mk" |
119 | CONFIGURE_ARGS+= --with-x-toolkit=gtk3 | | 146 | CONFIGURE_ARGS+= --with-x-toolkit=gtk3 |
120 | . elif !empty(PKG_OPTIONS:Mgtk2) || !empty(PKG_OPTIONS:Mgtk) | | 147 | . elif !empty(PKG_OPTIONS:Mgtk2) || !empty(PKG_OPTIONS:Mgtk) |
121 | USE_TOOLS+= pkg-config | | 148 | USE_TOOLS+= pkg-config |
122 | .include "../../x11/gtk2/buildlink3.mk" | | 149 | .include "../../x11/gtk2/buildlink3.mk" |
123 | CONFIGURE_ARGS+= --with-x-toolkit=gtk2 | | 150 | CONFIGURE_ARGS+= --with-x-toolkit=gtk2 |
124 | . elif !empty(PKG_OPTIONS:Mxaw) | | 151 | . elif !empty(PKG_OPTIONS:Mxaw) |
125 | .include "../../mk/xaw.buildlink3.mk" | | 152 | .include "../../mk/xaw.buildlink3.mk" |
126 | CONFIGURE_ARGS+= --with-x-toolkit=athena | | 153 | CONFIGURE_ARGS+= --with-x-toolkit=athena |
127 | . elif !empty(PKG_OPTIONS:Mmotif) | | | |
128 | .include "../../mk/motif.buildlink3.mk" | | | |
129 | CONFIGURE_ARGS+= --with-x-toolkit=motif | | | |
130 | . endif | | 154 | . endif |
131 | | | 155 | |
132 | ### | | 156 | ### |
133 | ### End of Check non nextstep (implies x11) options | | 157 | ### End of Check non nextstep (implies x11) options |
134 | | | 158 | |
135 | .include "../../mk/jpeg.buildlink3.mk" | | 159 | .include "../../mk/jpeg.buildlink3.mk" |
136 | .include "../../graphics/tiff/buildlink3.mk" | | 160 | .include "../../graphics/tiff/buildlink3.mk" |
137 | .include "../../graphics/giflib/buildlink3.mk" | | 161 | .include "../../graphics/giflib/buildlink3.mk" |
138 | .include "../../graphics/png/buildlink3.mk" | | 162 | .include "../../graphics/png/buildlink3.mk" |
139 | .include "../../x11/libSM/buildlink3.mk" | | 163 | .include "../../x11/libSM/buildlink3.mk" |
140 | .include "../../x11/libXaw/buildlink3.mk" | | 164 | .include "../../x11/libXaw/buildlink3.mk" |
141 | .include "../../x11/libXpm/buildlink3.mk" | | 165 | .include "../../x11/libXpm/buildlink3.mk" |
142 | .include "../../x11/libXrender/buildlink3.mk" | | 166 | .include "../../x11/libXrender/buildlink3.mk" |
143 | | | 167 | |
144 | | | | |
145 | ### | | 168 | ### |
146 | ### Support using NextStep (Cocoa or GNUstep) windowing system | | 169 | ### Support using NextStep (Cocoa or GNUstep) windowing system |
147 | ### | | 170 | ### |
148 | # If you check the variable system-configuration-options after Emacs is | | 171 | # If you check the variable system-configuration-options after Emacs is |
149 | # built, you may see many x11 related configurations. But if you have | | 172 | # built, you may see many x11 related configurations. But if you have |
150 | # --without-x there, all other x11 related configurations were ignored. | | 173 | # --without-x there, all other x11 related configurations were ignored. |
151 | # | | 174 | # |
152 | .elif !empty(PKG_OPTIONS:Mnextstep) | | 175 | .elif !empty(PKG_OPTIONS:Mnextstep) |
153 | . if exists(/System/Library/Frameworks/Cocoa.framework) | | 176 | . if exists(/System/Library/Frameworks/Cocoa.framework) |
154 | APPLICATIONS_DIR= Applications | | 177 | APPLICATIONS_DIR= Applications |
155 | PLIST_SRC+= PLIST.cocoa | | 178 | PLIST_SRC+= PLIST.cocoa |
156 | CHECK_WRKREF_SKIP+= Applications/Emacs.app/Contents/MacOS/Emacs | | 179 | CHECK_WRKREF_SKIP+= Applications/Emacs.app/Contents/MacOS/Emacs |
157 | CHECK_WRKREF_SKIP+= Applications/Emacs.app/Contents/MacOS/libexec/Emacs.pdmp | | 180 | CHECK_WRKREF_SKIP+= Applications/Emacs.app/Contents/MacOS/libexec/Emacs.pdmp |
| @@ -173,17 +196,42 @@ USE_TOOLS+= pax | | | @@ -173,17 +196,42 @@ USE_TOOLS+= pax |
173 | post-install: | | 196 | post-install: |
174 | cd ${WRKSRC}/nextstep && \ | | 197 | cd ${WRKSRC}/nextstep && \ |
175 | pax -rw -pp -pm Emacs.app ${DESTDIR}${PREFIX}/${APPLICATIONS_DIR} | | 198 | pax -rw -pp -pm Emacs.app ${DESTDIR}${PREFIX}/${APPLICATIONS_DIR} |
176 | | | 199 | |
177 | .else # no window system | | 200 | .else # no window system |
178 | CONFIGURE_ARGS+= --without-x | | 201 | CONFIGURE_ARGS+= --without-x |
179 | CONFIGURE_ARGS+= --without-xpm | | 202 | CONFIGURE_ARGS+= --without-xpm |
180 | CONFIGURE_ARGS+= --without-jpeg | | 203 | CONFIGURE_ARGS+= --without-jpeg |
181 | CONFIGURE_ARGS+= --without-tiff | | 204 | CONFIGURE_ARGS+= --without-tiff |
182 | CONFIGURE_ARGS+= --without-gif | | 205 | CONFIGURE_ARGS+= --without-gif |
183 | CONFIGURE_ARGS+= --without-png | | 206 | CONFIGURE_ARGS+= --without-png |
184 | .endif | | 207 | .endif |
185 | | | 208 | |
| | | 209 | .if !empty(PKG_OPTIONS:Mtree-sitter) |
| | | 210 | DEPENDS+= tree-sitter-bash-[0-9]*:../../textproc/tree-sitter-bash |
| | | 211 | DEPENDS+= tree-sitter-c-[0-9]*:../../textproc/tree-sitter-c |
| | | 212 | DEPENDS+= tree-sitter-c-sharp-[0-9]*:../../textproc/tree-sitter-c-sharp |
| | | 213 | DEPENDS+= tree-sitter-cmake-[0-9]*:../../textproc/tree-sitter-cmake |
| | | 214 | DEPENDS+= tree-sitter-cpp-[0-9]*:../../textproc/tree-sitter-cpp |
| | | 215 | DEPENDS+= tree-sitter-css-[0-9]*:../../textproc/tree-sitter-css |
| | | 216 | DEPENDS+= tree-sitter-dockerfile-[0-9]*:../../textproc/tree-sitter-dockerfile |
| | | 217 | DEPENDS+= tree-sitter-elixir-[0-9]*:../../textproc/tree-sitter-elixir |
| | | 218 | DEPENDS+= tree-sitter-go-[0-9]*:../../textproc/tree-sitter-go |
| | | 219 | DEPENDS+= tree-sitter-go-mod-[0-9]*:../../textproc/tree-sitter-go-mod |
| | | 220 | DEPENDS+= tree-sitter-heex-[0-9]*:../../textproc/tree-sitter-heex |
| | | 221 | DEPENDS+= tree-sitter-html-[0-9]*:../../textproc/tree-sitter-html |
| | | 222 | DEPENDS+= tree-sitter-java-[0-9]*:../../textproc/tree-sitter-java |
| | | 223 | DEPENDS+= tree-sitter-json-[0-9]*:../../textproc/tree-sitter-json |
| | | 224 | DEPENDS+= tree-sitter-python-[0-9]*:../../textproc/tree-sitter-python |
| | | 225 | DEPENDS+= tree-sitter-ruby-[0-9]*:../../textproc/tree-sitter-ruby |
| | | 226 | DEPENDS+= tree-sitter-rust-[0-9]*:../../textproc/tree-sitter-rust |
| | | 227 | DEPENDS+= tree-sitter-toml-[0-9]*:../../textproc/tree-sitter-toml |
| | | 228 | DEPENDS+= tree-sitter-tsx-[0-9]*:../../textproc/tree-sitter-tsx |
| | | 229 | DEPENDS+= tree-sitter-typescript-[0-9]*:../../textproc/tree-sitter-typescript |
| | | 230 | DEPENDS+= tree-sitter-yaml-[0-9]*:../../textproc/tree-sitter-yaml |
| | | 231 | .include "../../textproc/tree-sitter/buildlink3.mk" |
| | | 232 | .endif |
| | | 233 | |
186 | # Local Variables: | | 234 | # Local Variables: |
187 | # mode: outline-minor | | 235 | # mode: outline-minor |
188 | # outline-regexp: "\\(.[ \t]*\\(if\\|endif\\|else\\|elif\\|include.*options\\|PKG_SUGGES\\)\\)\\|### .\\|# Local" | | 236 | # outline-regexp: "\\(.[ \t]*\\(if\\|endif\\|else\\|elif\\|include.*options\\|PKG_SUGGES\\)\\)\\|### .\\|# Local" |
189 | # End: | | 237 | # End: |