| @@ -1,191 +1,195 @@ | | | @@ -1,191 +1,195 @@ |
1 | # $NetBSD: modules.mk,v 1.39 2017/05/04 07:44:41 taca Exp $ | | 1 | # $NetBSD: modules.mk,v 1.40 2017/05/04 15:09:10 taca Exp $ |
2 | | | 2 | |
3 | .if !defined(_RUBY_MODULE_MK) | | 3 | .if !defined(_RUBY_MODULE_MK) |
4 | _RUBY_MODULE_MK= # defined | | 4 | _RUBY_MODULE_MK= # defined |
5 | | | 5 | |
6 | .if defined(RUBY_RAILS_SUPPORTED) | | 6 | .if defined(RUBY_RAILS_SUPPORTED) |
7 | USE_TOOLS+= expr | | 7 | USE_TOOLS+= expr |
8 | .endif | | 8 | .endif |
9 | | | 9 | |
10 | .include "../../lang/ruby/rubyversion.mk" | | 10 | .include "../../lang/ruby/rubyversion.mk" |
11 | | | 11 | |
12 | # | | 12 | # |
13 | # Default package name would prefixed by RUBY_PKGPREFIX. | | 13 | # Default package name would prefixed by RUBY_PKGPREFIX. |
14 | # | | 14 | # |
15 | PKGNAME?= ${RUBY_PKGPREFIX}-${DISTNAME} | | 15 | PKGNAME?= ${RUBY_PKGPREFIX}-${DISTNAME} |
16 | | | 16 | |
17 | .if defined(NO_BUILD) && empty(NO_BUILD:M[Nn][Oo]) | | 17 | .if defined(NO_BUILD) && empty(NO_BUILD:M[Nn][Oo]) |
18 | DEPENDS+= ${RUBY_BASE}>=${RUBY_VERSION}:${RUBY_SRCDIR} | | 18 | DEPENDS+= ${RUBY_BASE}>=${RUBY_VERSION}:${RUBY_SRCDIR} |
19 | .else | | 19 | .else |
20 | .include "../../lang/ruby/buildlink3.mk" | | 20 | .include "../../lang/ruby/buildlink3.mk" |
21 | .endif | | 21 | .endif |
22 | | | 22 | |
| | | 23 | .if defined(RUBY_RAILS_SUPPORTED) |
| | | 24 | .include "../../lang/ruby/rails.mk" |
| | | 25 | .endif |
| | | 26 | |
23 | CONFIGURE_ENV+= RUBY=${RUBY:Q} RDOC=${RDOC:Q} | | 27 | CONFIGURE_ENV+= RUBY=${RUBY:Q} RDOC=${RDOC:Q} |
24 | | | 28 | |
25 | # | | 29 | # |
26 | # extconf.rb support | | 30 | # extconf.rb support |
27 | # | | 31 | # |
28 | # USE_RUBY_EXTCONF Use extconf script. | | 32 | # USE_RUBY_EXTCONF Use extconf script. |
29 | # | | 33 | # |
30 | # RUBY_EXTCONF specify extconf script name (default: extconf.rb). | | 34 | # RUBY_EXTCONF specify extconf script name (default: extconf.rb). |
31 | # RUBY_EXTCONF_CHECK make sure to check existence of Makefile after | | 35 | # RUBY_EXTCONF_CHECK make sure to check existence of Makefile after |
32 | # executing extconf script (default: yes). | | 36 | # executing extconf script (default: yes). |
33 | # RUBY_EXTCONF_MAKEFILE name of Makefile checked by RUBY_EXTCONF_CHECK | | 37 | # RUBY_EXTCONF_MAKEFILE name of Makefile checked by RUBY_EXTCONF_CHECK |
34 | # (default: Makefile) | | 38 | # (default: Makefile) |
35 | # | | 39 | # |
36 | .if defined(USE_RUBY_EXTCONF) && empty(USE_RUBY_EXTCONF:M[nN][oO]) | | 40 | .if defined(USE_RUBY_EXTCONF) && empty(USE_RUBY_EXTCONF:M[nN][oO]) |
37 | | | 41 | |
38 | RUBY_EXTCONF?= extconf.rb | | 42 | RUBY_EXTCONF?= extconf.rb |
39 | INSTALL_TARGET?= site-install | | 43 | INSTALL_TARGET?= site-install |
40 | CONFIGURE_ARGS+= ${RUBY_EXTCONF_ARGS} | | 44 | CONFIGURE_ARGS+= ${RUBY_EXTCONF_ARGS} |
41 | RUBY_EXTCONF_ARGS?= --with-opt-dir=${PREFIX:Q} --vendor | | 45 | RUBY_EXTCONF_ARGS?= --with-opt-dir=${PREFIX:Q} --vendor |
42 | RUBY_EXTCONF_CHECK?= yes | | 46 | RUBY_EXTCONF_CHECK?= yes |
43 | RUBY_EXTCONF_MAKEFILE?= Makefile | | 47 | RUBY_EXTCONF_MAKEFILE?= Makefile |
44 | | | 48 | |
45 | do-configure: ruby-extconf-configure | | 49 | do-configure: ruby-extconf-configure |
46 | | | 50 | |
47 | .if defined(RUBY_EXTCONF_SUBDIRS) | | 51 | .if defined(RUBY_EXTCONF_SUBDIRS) |
48 | ruby-extconf-configure: | | 52 | ruby-extconf-configure: |
49 | .for d in ${RUBY_EXTCONF_SUBDIRS} | | 53 | .for d in ${RUBY_EXTCONF_SUBDIRS} |
50 | @${ECHO_MSG} "===> Running ${RUBY_EXTCONF} in ${d} to configure"; \ | | 54 | @${ECHO_MSG} "===> Running ${RUBY_EXTCONF} in ${d} to configure"; \ |
51 | ${ECHO_MSG} "${RUBY} ${RUBY_EXTCONF} ${CONFIGURE_ARGS}" | | 55 | ${ECHO_MSG} "${RUBY} ${RUBY_EXTCONF} ${CONFIGURE_ARGS}" |
52 | ${RUN}cd ${WRKSRC}/${d}; \ | | 56 | ${RUN}cd ${WRKSRC}/${d}; \ |
53 | ${SETENV} ${CONFIGURE_ENV} ${RUBY} ${RUBY_EXTCONF} ${CONFIGURE_ARGS} | | 57 | ${SETENV} ${CONFIGURE_ENV} ${RUBY} ${RUBY_EXTCONF} ${CONFIGURE_ARGS} |
54 | .if empty(RUBY_EXTCONF_CHECK:M[nN][oO]) | | 58 | .if empty(RUBY_EXTCONF_CHECK:M[nN][oO]) |
55 | ${RUN}cd ${WRKSRC}/${d}; \ | | 59 | ${RUN}cd ${WRKSRC}/${d}; \ |
56 | ${TEST} -f ${RUBY_EXTCONF_MAKEFILE} | | 60 | ${TEST} -f ${RUBY_EXTCONF_MAKEFILE} |
57 | .endif | | 61 | .endif |
58 | .endfor | | 62 | .endfor |
59 | | | 63 | |
60 | .if !target(do-build) | | 64 | .if !target(do-build) |
61 | do-build: ruby-extconf-build | | 65 | do-build: ruby-extconf-build |
62 | | | 66 | |
63 | ruby-extconf-build: | | 67 | ruby-extconf-build: |
64 | .for d in ${RUBY_EXTCONF_SUBDIRS} | | 68 | .for d in ${RUBY_EXTCONF_SUBDIRS} |
65 | @${ECHO_MSG} "===> Building ${d}" | | 69 | @${ECHO_MSG} "===> Building ${d}" |
66 | ${RUN}cd ${WRKSRC}/${d}; ${SETENV} ${MAKE_ENV} ${MAKE} ${BUILD_TARGET} | | 70 | ${RUN}cd ${WRKSRC}/${d}; ${SETENV} ${MAKE_ENV} ${MAKE} ${BUILD_TARGET} |
67 | .endfor | | 71 | .endfor |
68 | .endif | | 72 | .endif |
69 | | | 73 | |
70 | .if !target(do-install) | | 74 | .if !target(do-install) |
71 | do-install: ruby-extconf-install | | 75 | do-install: ruby-extconf-install |
72 | | | 76 | |
73 | ruby-extconf-install: | | 77 | ruby-extconf-install: |
74 | .for d in ${RUBY_EXTCONF_SUBDIRS} | | 78 | .for d in ${RUBY_EXTCONF_SUBDIRS} |
75 | @${ECHO_MSG} "===> Installing ${d}" | | 79 | @${ECHO_MSG} "===> Installing ${d}" |
76 | ${RUN}cd ${WRKSRC}/${d}; ${SETENV} ${INSTALL_ENV} ${MAKE_ENV} ${MAKE} ${INSTALL_TARGET} ${INSTALL_MAKE_FLAGS} | | 80 | ${RUN}cd ${WRKSRC}/${d}; ${SETENV} ${INSTALL_ENV} ${MAKE_ENV} ${MAKE} ${INSTALL_TARGET} ${INSTALL_MAKE_FLAGS} |
77 | .endfor | | 81 | .endfor |
78 | .endif | | 82 | .endif |
79 | | | 83 | |
80 | .else | | 84 | .else |
81 | ruby-extconf-configure: | | 85 | ruby-extconf-configure: |
82 | @${ECHO_MSG} "===> Running ${RUBY_EXTCONF} to configure"; \ | | 86 | @${ECHO_MSG} "===> Running ${RUBY_EXTCONF} to configure"; \ |
83 | ${ECHO_MSG} "${RUBY} ${RUBY_EXTCONF} ${CONFIGURE_ARGS}" | | 87 | ${ECHO_MSG} "${RUBY} ${RUBY_EXTCONF} ${CONFIGURE_ARGS}" |
84 | ${RUN}cd ${WRKSRC}; \ | | 88 | ${RUN}cd ${WRKSRC}; \ |
85 | ${SETENV} ${CONFIGURE_ENV} ${RUBY} ${RUBY_EXTCONF} ${CONFIGURE_ARGS} | | 89 | ${SETENV} ${CONFIGURE_ENV} ${RUBY} ${RUBY_EXTCONF} ${CONFIGURE_ARGS} |
86 | .if empty(RUBY_EXTCONF_CHECK:M[nN][oO]) | | 90 | .if empty(RUBY_EXTCONF_CHECK:M[nN][oO]) |
87 | ${RUN}cd ${WRKSRC}/${d}; \ | | 91 | ${RUN}cd ${WRKSRC}/${d}; \ |
88 | ${TEST} -f ${RUBY_EXTCONF_MAKEFILE} | | 92 | ${TEST} -f ${RUBY_EXTCONF_MAKEFILE} |
89 | .endif | | 93 | .endif |
90 | .endif | | 94 | .endif |
91 | | | 95 | |
92 | # | | 96 | # |
93 | # setup.rb support | | 97 | # setup.rb support |
94 | # | | 98 | # |
95 | # USE_RUBY_SETUP Uset setup script. | | 99 | # USE_RUBY_SETUP Uset setup script. |
96 | # USE_RUBY_SETUP_PKG Use pkgsrc's ruby-setup package. | | 100 | # USE_RUBY_SETUP_PKG Use pkgsrc's ruby-setup package. |
97 | # | | 101 | # |
98 | # RUBY_SETUP specify setup script name (default: setup.rb). | | 102 | # RUBY_SETUP specify setup script name (default: setup.rb). |
99 | # | | 103 | # |
100 | .elif defined(USE_RUBY_SETUP) && empty(USE_RUBY_SETUP:M[nN][oO]) | | 104 | .elif defined(USE_RUBY_SETUP) && empty(USE_RUBY_SETUP:M[nN][oO]) |
101 | | | 105 | |
102 | RUBY_SETUP?= setup.rb | | 106 | RUBY_SETUP?= setup.rb |
103 | RUBY_SETUP_SUBDIRS?= . | | 107 | RUBY_SETUP_SUBDIRS?= . |
104 | | | 108 | |
105 | .if defined(USE_RUBY_SETUP_PKG) && empty(USE_RUBY_SETUP_PKG:M[nN][oO]) | | 109 | .if defined(USE_RUBY_SETUP_PKG) && empty(USE_RUBY_SETUP_PKG:M[nN][oO]) |
106 | BUILD_DEPENDS+= ${RUBY_PKGPREFIX}-setup>=3.4.0:../../devel/ruby-setup | | 110 | BUILD_DEPENDS+= ${RUBY_PKGPREFIX}-setup>=3.4.0:../../devel/ruby-setup |
107 | .endif | | 111 | .endif |
108 | | | 112 | |
109 | .if !target(do-configure) | | 113 | .if !target(do-configure) |
110 | do-configure: ruby-setup-configure | | 114 | do-configure: ruby-setup-configure |
111 | | | 115 | |
112 | ruby-setup-configure: | | 116 | ruby-setup-configure: |
113 | .for d in ${RUBY_SETUP_SUBDIRS} | | 117 | .for d in ${RUBY_SETUP_SUBDIRS} |
114 | .if defined(USE_RUBY_SETUP_PKG) && empty(USE_RUBY_SETUP_PKG:M[nN][oO]) | | 118 | .if defined(USE_RUBY_SETUP_PKG) && empty(USE_RUBY_SETUP_PKG:M[nN][oO]) |
115 | @${ECHO_MSG} "===> Use pkgsrc's ruby-setup" | | 119 | @${ECHO_MSG} "===> Use pkgsrc's ruby-setup" |
116 | ${RUN}cd ${WRKSRC}/${d}; \ | | 120 | ${RUN}cd ${WRKSRC}/${d}; \ |
117 | ${CP} ${PREFIX}/${RUBY_VENDORLIB}/setup.rb ${RUBY_SETUP} | | 121 | ${CP} ${PREFIX}/${RUBY_VENDORLIB}/setup.rb ${RUBY_SETUP} |
118 | .endif | | 122 | .endif |
119 | @${ECHO_MSG} "===> Running ${RUBY_SETUP} to configure" | | 123 | @${ECHO_MSG} "===> Running ${RUBY_SETUP} to configure" |
120 | ${RUN}cd ${WRKSRC}/${d}; \ | | 124 | ${RUN}cd ${WRKSRC}/${d}; \ |
121 | ${SETENV} ${CONFIGURE_ENV} ${RUBY} ${RUBY_SETUP} config ${CONFIGURE_ARGS} | | 125 | ${SETENV} ${CONFIGURE_ENV} ${RUBY} ${RUBY_SETUP} config ${CONFIGURE_ARGS} |
122 | . endfor | | 126 | . endfor |
123 | .endif | | 127 | .endif |
124 | | | 128 | |
125 | .if !target(do-build) | | 129 | .if !target(do-build) |
126 | do-build: ruby-setup-build | | 130 | do-build: ruby-setup-build |
127 | | | 131 | |
128 | ruby-setup-build: | | 132 | ruby-setup-build: |
129 | @${ECHO_MSG} "===> Running ${RUBY_SETUP} to build" | | 133 | @${ECHO_MSG} "===> Running ${RUBY_SETUP} to build" |
130 | .for d in ${RUBY_SETUP_SUBDIRS} | | 134 | .for d in ${RUBY_SETUP_SUBDIRS} |
131 | ${RUN}cd ${WRKSRC}/${d}; \ | | 135 | ${RUN}cd ${WRKSRC}/${d}; \ |
132 | ${SETENV} ${MAKE_ENV} ${RUBY} ${RUBY_SETUP} setup | | 136 | ${SETENV} ${MAKE_ENV} ${RUBY} ${RUBY_SETUP} setup |
133 | .endfor | | 137 | .endfor |
134 | .endif | | 138 | .endif |
135 | | | 139 | |
136 | .if !target(do-install) | | 140 | .if !target(do-install) |
137 | do-install: ruby-setup-install | | 141 | do-install: ruby-setup-install |
138 | | | 142 | |
139 | _RUBY_SETUP_INSTALLARGS= ${INSTALL_TARGET} | | 143 | _RUBY_SETUP_INSTALLARGS= ${INSTALL_TARGET} |
140 | _RUBY_SETUP_INSTALLARGS+= --prefix=${DESTDIR:Q} | | 144 | _RUBY_SETUP_INSTALLARGS+= --prefix=${DESTDIR:Q} |
141 | | | 145 | |
142 | ruby-setup-install: | | 146 | ruby-setup-install: |
143 | @${ECHO_MSG} "===> Running ${RUBY_SETUP} to ${INSTALL_TARGET}" | | 147 | @${ECHO_MSG} "===> Running ${RUBY_SETUP} to ${INSTALL_TARGET}" |
144 | .for d in ${RUBY_SETUP_SUBDIRS} | | 148 | .for d in ${RUBY_SETUP_SUBDIRS} |
145 | ${RUN}cd ${WRKSRC}/${d}; \ | | 149 | ${RUN}cd ${WRKSRC}/${d}; \ |
146 | ${SETENV} ${INSTALL_ENV} ${MAKE_ENV} ${RUBY} ${RUBY_SETUP} ${_RUBY_SETUP_INSTALLARGS} | | 150 | ${SETENV} ${INSTALL_ENV} ${MAKE_ENV} ${RUBY} ${RUBY_SETUP} ${_RUBY_SETUP_INSTALLARGS} |
147 | .endfor | | 151 | .endfor |
148 | .endif | | 152 | .endif |
149 | | | 153 | |
150 | # | | 154 | # |
151 | # install.rb support | | 155 | # install.rb support |
152 | # | | 156 | # |
153 | # USE_RUBY_INSTALL use simple install.rb script to install | | 157 | # USE_RUBY_INSTALL use simple install.rb script to install |
154 | # (default: undefined) | | 158 | # (default: undefined) |
155 | # RUBY_SIMPLE_INSTALL name of simple install.rb script (default: install.rb) | | 159 | # RUBY_SIMPLE_INSTALL name of simple install.rb script (default: install.rb) |
156 | # | | 160 | # |
157 | .elif defined(USE_RUBY_INSTALL) && empty(USE_RUBY_INSTALL:M[nN][oO]) | | 161 | .elif defined(USE_RUBY_INSTALL) && empty(USE_RUBY_INSTALL:M[nN][oO]) |
158 | | | 162 | |
159 | RUBY_SIMPLE_INSTALL?= install.rb | | 163 | RUBY_SIMPLE_INSTALL?= install.rb |
160 | INSTALL_TARGET?= # empty | | 164 | INSTALL_TARGET?= # empty |
161 | | | 165 | |
162 | SUBST_CLASSES+= rinstall | | 166 | SUBST_CLASSES+= rinstall |
163 | SUBST_STAGE.rinstall= pre-install | | 167 | SUBST_STAGE.rinstall= pre-install |
164 | SUBST_FILES.rinstall= ${RUBY_SIMPLE_INSTALL} | | 168 | SUBST_FILES.rinstall= ${RUBY_SIMPLE_INSTALL} |
165 | SUBST_SED.rinstall= -e "s|'sitedir'|'vendordir'|g" | | 169 | SUBST_SED.rinstall= -e "s|'sitedir'|'vendordir'|g" |
166 | SUBST_SED.rinstall+= -e "s|'sitelibdir'|'vendorlibdir'|g" | | 170 | SUBST_SED.rinstall+= -e "s|'sitelibdir'|'vendorlibdir'|g" |
167 | SUBST_SED.rinstall+= -e 's|"sitelibdir"|"vendorlibdir"|g' | | 171 | SUBST_SED.rinstall+= -e 's|"sitelibdir"|"vendorlibdir"|g' |
168 | SUBST_SED.rinstall+= -e 's|/site_ruby/|/vendor_ruby/|g' | | 172 | SUBST_SED.rinstall+= -e 's|/site_ruby/|/vendor_ruby/|g' |
169 | SUBST_MESSAGE.rinstall= Fixing ${RUBY_SIMPLE_INSTALL} files. | | 173 | SUBST_MESSAGE.rinstall= Fixing ${RUBY_SIMPLE_INSTALL} files. |
170 | | | 174 | |
171 | .if !target(do-install) | | 175 | .if !target(do-install) |
172 | do-install: ruby-simple-install | | 176 | do-install: ruby-simple-install |
173 | | | 177 | |
174 | ruby-simple-install: | | 178 | ruby-simple-install: |
175 | @${ECHO_MSG} "===> Running ${RUBY_SIMPLE_INSTALL} to ${INSTALL_TARGET}" | | 179 | @${ECHO_MSG} "===> Running ${RUBY_SIMPLE_INSTALL} to ${INSTALL_TARGET}" |
176 | ${RUN}cd ${WRKSRC}; \ | | 180 | ${RUN}cd ${WRKSRC}; \ |
177 | ${SETENV} ${INSTALL_ENV} ${MAKE_ENV} ${RUBY} ${RUBY_SIMPLE_INSTALL} ${INSTALL_TARGET} | | 181 | ${SETENV} ${INSTALL_ENV} ${MAKE_ENV} ${RUBY} ${RUBY_SIMPLE_INSTALL} ${INSTALL_TARGET} |
178 | .endif | | 182 | .endif |
179 | .endif # USE_RUBY_INSTALL | | 183 | .endif # USE_RUBY_INSTALL |
180 | | | 184 | |
181 | .if defined(USE_RAKE) && empty(USE_RAKE:M[nN][oO]) | | 185 | .if defined(USE_RAKE) && empty(USE_RAKE:M[nN][oO]) |
182 | | | 186 | |
183 | # RAKE | | 187 | # RAKE |
184 | # The path to the ``rake'' binary. | | 188 | # The path to the ``rake'' binary. |
185 | # | | 189 | # |
186 | RAKE= ${LOCALBASE}/bin/${RAKE_NAME} | | 190 | RAKE= ${LOCALBASE}/bin/${RAKE_NAME} |
187 | MAKE_ENV+= RAKE=${RAKE:Q} | | 191 | MAKE_ENV+= RAKE=${RAKE:Q} |
188 | .endif | | 192 | .endif |
189 | | | 193 | |
190 | .include "replace.mk" | | 194 | .include "replace.mk" |
191 | .endif | | 195 | .endif |