Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include web interface sources in dist #1439

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
sudo apt-get update
sudo apt-get install -yq build-essential clang clang-tools git autotools-dev autoconf libtool gettext gawk gperf bison flex libconfuse-dev libunistring-dev libsqlite3-dev libavcodec-dev libavformat-dev libavfilter-dev libswscale-dev libavutil-dev libasound2-dev libmxml-dev libgcrypt20-dev libavahi-client-dev zlib1g-dev libevent-dev libplist-dev libsodium-dev libcurl4-openssl-dev libjson-c-dev libprotobuf-c-dev libpulse-dev libwebsockets-dev libgnutls28-dev
autoreconf -vi
./configure --enable-lastfm --enable-chromecast
./configure --enable-lastfm --enable-chromecast --disable-webinterface
scan-build --status-bugs -disable-checker deadcode.DeadStores --exclude src/parsers make

- name: Perform CodeQL Analysis
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
brew install ffmpeg

- name: Install other dependencies
run: brew install libunistring libmxml confuse libplist sqlite libwebsockets libevent libgcrypt json-c protobuf-c libsodium gnutls pulseaudio openssl
run: brew install libunistring libmxml confuse libplist sqlite libwebsockets libevent libgcrypt json-c protobuf-c libsodium gnutls pulseaudio openssl node

- name: Configure
run: |
Expand All @@ -72,6 +72,7 @@ jobs:
export LD_LIBRARY_PATH=$(brew --prefix openssl)/lib
export CPATH=$(brew --prefix openssl)/include
export PKG_CONFIG_PATH=$(brew --prefix openssl)/lib/pkgconfig
make web
make

- name: Install
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@ jobs:
- name: install dependencies
run: |
sudo apt-get update
sudo apt-get install -yq build-essential clang clang-tools git autotools-dev autoconf libtool gettext gawk gperf bison flex libconfuse-dev libunistring-dev libsqlite3-dev libavcodec-dev libavformat-dev libavfilter-dev libswscale-dev libavutil-dev libasound2-dev libmxml-dev libgcrypt20-dev libavahi-client-dev zlib1g-dev libevent-dev libplist-dev libsodium-dev libcurl4-openssl-dev libjson-c-dev libprotobuf-c-dev libpulse-dev libwebsockets-dev libgnutls28-dev
sudo apt-get install -yq build-essential clang clang-tools git autotools-dev autoconf libtool gettext gawk gperf bison flex libconfuse-dev libunistring-dev libsqlite3-dev libavcodec-dev libavformat-dev libavfilter-dev libswscale-dev libavutil-dev libasound2-dev libmxml-dev libgcrypt20-dev libavahi-client-dev zlib1g-dev libevent-dev libplist-dev libsodium-dev libcurl4-openssl-dev libjson-c-dev libprotobuf-c-dev libpulse-dev libwebsockets-dev libgnutls28-dev nodejs npm
- name: build and check
run: |
autoreconf -vi
./configure
make web
make
make check
make distcheck
Expand Down
29 changes: 28 additions & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,13 @@ endif

BUILT_SOURCES = $(CONF_FILE) $(SYSTEMD_SERVICE_FILE) $(SYSTEMD_TSERVICE_FILE)

SUBDIRS = $(LIBRESPOTC_SUBDIR) sqlext src htdocs
if COND_WEBINTERFACE
WEBINTERFACE_HTDOCS_SUBDIR = htdocs
WEBINTERFACE_SRC_SUBDIR = web-src
endif

SUBDIRS = $(LIBRESPOTC_SUBDIR) sqlext src $(WEBINTERFACE_HTDOCS_SUBDIR)
DIST_SUBDIRS = $(SUBDIRS) $(WEBINTERFACE_SRC_SUBDIR)

dist_man_MANS = owntone.8

Expand Down Expand Up @@ -100,3 +106,24 @@ $(CONF_FILE): $(srcdir)/$(CONF_FILE).in
$(SYSTEMD_SERVICE_FILE): $(srcdir)/$(SYSTEMD_SERVICE_FILE).in

$(SYSTEMD_TSERVICE_FILE): $(srcdir)/$(SYSTEMD_TSERVICE_FILE).in

web:
$(MAKE) web -C web-src

web-clean:
$(MAKE) web-clean -C web-src

web-serve:
$(MAKE) web-serve -C web-src

web-dist: web-build
tar -czf owntone-web-$(PACKAGE_VERSION).tar.gz htdocs

web-lint:
$(MAKE) web-lint -C web-src

web-format:
$(MAKE) web-format -C web-src

.PHONY: web web-clean web-serve web-dist web-lint web-format

12 changes: 12 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh

set -x

DEFAULT_AUTORECONF_FLAGS="-i"
DEFAULT_CONFIGURE_FLAGS="--prefix=/usr --sysconfdir=/etc --localstatedir=/var"
DEFAULT_MAKE_FLAGS=""

autoreconf ${AUTORECONF_FLAGS:-${DEFAULT_AUTORECONF_FLAGS}}
./configure ${CONFIGURE_FLAGS:-${DEFAULT_CONFIGURE_FLAGS}}
make web
make ${MAKE_FLAGS:-${DEFAULT_MAKE_FLAGS}}
21 changes: 18 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -318,11 +318,25 @@ dnl MPD support
OWNTONE_ARG_DISABLE([MPD client protocol support], [mpd], [MPD])
AM_CONDITIONAL([COND_MPD], [[test "x$enable_mpd" = "xyes"]])

AC_PATH_PROG([NPM], [[npm]])

dnl Include default webinterface
OWNTONE_ARG_DISABLE([include default web interface], [webinterface], [WEBINTERFACE],
[AS_IF([[test "x$with_libwebsockets" = "xno"]],
[AC_MSG_ERROR([[Web interface requires libwebsockets >= 2.0.2 (or use --disable-webinterface)]])])
])
[AS_IF(
[[test "x$with_libwebsockets" = "xno"]],
[AC_MSG_ERROR([[Web interface requires libwebsockets >= 2.0.2 (or use --disable-webinterface)]])],
[[test -z "$NPM"]],
[AS_IF([[test -f "$srcdir/htdocs/index.html"]],
[AM_MISSING_PROG([NPM], [[npm]])
AC_MSG_NOTICE([[

npm not found, but a prebuilt web interface seems to be present.
If you modify any web interface files, you will need to install it.

]])],
[AC_MSG_ERROR([[npm required, please install it.]])])
]
)])
AM_CONDITIONAL([COND_WEBINTERFACE], [[test "x$enable_webinterface" = "xyes"]])

dnl Creating and defining users and groups
Expand Down Expand Up @@ -378,6 +392,7 @@ AC_CONFIG_FILES([
src/Makefile
sqlext/Makefile
htdocs/Makefile
web-src/Makefile
Makefile
owntone.spec
])
Expand Down
13 changes: 13 additions & 0 deletions htdocs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/android-chrome-192x192.png
/android-chrome-512x512.png
/apple-touch-icon.png
/browserconfig.xml
/favicon-16x16.png
/favicon-32x32.png
/favicon.ico
/index.html
/logo.svg
/mstile-150x150.png
/safari-pinned-tab.svg
/site.webmanifest
/assets
11 changes: 6 additions & 5 deletions htdocs/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
if COND_WEBINTERFACE

WEBINTERFACE_SRC = \
index.html
endif


htdocsdir = $(datadir)/owntone/htdocs

Expand All @@ -19,10 +17,13 @@ dist_htdocs_DATA = \
safari-pinned-tab.svg \
site.webmanifest

if COND_WEBINTERFACE
htdocsassetsdir = $(datadir)/owntone/htdocs/assets

dist_htdocsassets_DATA = \
assets/index.css \
assets/index.js
endif

$(WEBINTERFACE_SRC):
if test ! -f "$(srcdir)/$(WEBINTERFACE_SRC)"; \
then $(error Web interface files are missing! Did you run "make web"?); \
fi;
Binary file removed htdocs/android-chrome-192x192.png
Binary file not shown.
Binary file removed htdocs/android-chrome-512x512.png
Binary file not shown.
Binary file removed htdocs/apple-touch-icon.png
Binary file not shown.
1 change: 0 additions & 1 deletion htdocs/assets/index.css

This file was deleted.

Loading