Skip to content

Commit a94bf97

Browse files
committed
[build] Add "--with-prebuilt-webinterface" configure flag to force usage of prebuilt web UI
1 parent 1e56bbd commit a94bf97

File tree

2 files changed

+25
-8
lines changed

2 files changed

+25
-8
lines changed

configure.ac

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,14 +333,31 @@ OWNTONE_ARG_DISABLE([include default web interface], [webinterface], [WEBINTERFA
333333
[AS_IF([[test -f "$srcdir/web-src/htdocs/index.html"]],
334334
[AM_MISSING_PROG([NPM], [[npm]])
335335
AC_MSG_NOTICE([[
336-
npm not found, but a prebuilt web interface seems to be present.
337-
If you modify any web interface files, you will need to install it.
336+
npm not found, but a prebuilt web interface is present.
337+
If you modify any web interface source files, you will need to install npm.
338338
]])],
339339
[AC_MSG_ERROR([[npm required, please install it.]])])
340340
]
341341
)])
342342
AM_CONDITIONAL([COND_WEBINTERFACE], [[test "x$enable_webinterface" = "xyes"]])
343343

344+
dnl Use prebuilt webinterface even if npm is available
345+
AC_ARG_WITH([prebuilt-webinterface],
346+
[AS_HELP_STRING([--with-prebuilt-webinterface],
347+
[Use prebuilt webinterface even if npm is available (default=no)]
348+
)],
349+
[AS_IF([[test -f "$srcdir/web-src/htdocs/index.html"]],
350+
[[with_prebuilt_webinterface=yes]],
351+
[AC_MSG_ERROR([[No prebuilt web interface found.]])]
352+
)],
353+
[[with_prebuilt_webinterface=]])
354+
if test "x$with_prebuilt_webinterface" = "xyes"; then
355+
BUILD_WEBINTERFACE=
356+
else
357+
BUILD_WEBINTERFACE=true
358+
fi
359+
AC_SUBST([BUILD_WEBINTERFACE])
360+
344361
dnl Creating and defining users and groups
345362
OWNTONE_ARG_ENABLE([having 'make install' add user/group and 'make uninstall' delete], [install_user], [INSTALL_USER],
346363
[AC_PATH_PROG([GETENT], [[getent]], [], [$PATH$PATH_SEPARATOR/usr/sbin])

web-src/Makefile.am

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -177,19 +177,19 @@ node_modules: $(PACKAGE_JSON)
177177
cp "$$src_path" "$$dest_path"; \
178178
done; \
179179
fi
180-
$(if $(NPM),$(NPM) clean-install)
180+
$(if $(BUILD_WEBINTERFACE),$(NPM) clean-install)
181181

182182
# Build the Vue.js application
183183
htdocs: node_modules $(WEB_FILES)
184-
$(if $(NPM),$(NPM) run build)
184+
$(if $(BUILD_WEBINTERFACE),$(NPM) run build)
185185

186186
web: htdocs
187187

188188
web-serve: node_modules
189-
$(if $(NPM),$(NPM) run serve)
189+
$(if $(BUILD_WEBINTERFACE),$(NPM) run serve)
190190

191191
web-update:
192-
$(if $(NPM),$(NPM) update)
192+
$(if $(BUILD_WEBINTERFACE),$(NPM) update)
193193

194194
web-check:
195195
@echo "Verifying that all source files in 'src' and 'public' are listed in WEB_FILES ..."
@@ -208,10 +208,10 @@ web-check:
208208
fi
209209

210210
web-lint: node_modules
211-
$(if $(NPM),$(NPM) run lint --no-fix)
211+
$(if $(BUILD_WEBINTERFACE),$(NPM) run lint --no-fix)
212212

213213
web-format: node_modules
214-
$(if $(NPM),$(NPM) run format)
214+
$(if $(BUILD_WEBINTERFACE),$(NPM) run format)
215215

216216
all-local: htdocs
217217

0 commit comments

Comments
 (0)