From 2f997342afa5524f8008cc61a705580aed45a9fc Mon Sep 17 00:00:00 2001 From: Giso Grimm Date: Sun, 27 Oct 2024 16:03:00 +0100 Subject: [PATCH] prepare for homebrew packaging --- .gitignore | 3 +++ Makefile | 39 +++++++++++++++++++++++++++++++++++-- packaging/homebrew/Makefile | 21 ++++++++++++++++++++ 3 files changed, 61 insertions(+), 2 deletions(-) create mode 100644 packaging/homebrew/Makefile diff --git a/.gitignore b/.gitignore index 12f0209..36637df 100644 --- a/.gitignore +++ b/.gitignore @@ -50,3 +50,6 @@ announce.flac *.firmwareupdate ds-config + +# homebrew build directory: +homebrew-build-dir diff --git a/Makefile b/Makefile index 59e7e68..6191089 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,25 @@ +PREFIX=/usr/local +LIBDIR=$(PREFIX)/lib +BINDIR=$(PREFIX)/bin +SHAREDIR=$(PREFIX)/share/ovclient +DESTDIR= + all: build lib binaries cli: build lib clibinaries gui: build lib guibinaries +UNAME_S := $(shell uname -s) +ifeq ($(UNAME_S),Linux) + CMD_INSTALL=install + LIB_EXT=so + CMD_LD=ldconfig -n $(DESTDIR)$(LIBDIR) +endif +ifeq ($(UNAME_S),Darwin) + CMD_INSTALL=ginstall + LIB_EXT=dylib + CMD_LD= +endif + BIN_OLD_CLI = ov-client BIN_CLI = ovbox_cli ov-client_hostname ov-client_listsounddevs \ ovrealpath ovbox_version @@ -211,5 +229,22 @@ gitupdate: git fetch --recurse-submodules ; git submodule update --init --recursive install: - cat packaging/deb/*.csv |sed -e 's/,usr/,$${PREFIX}/1' | PREFIX=$(PREFIX) envsubst |sed -e 's/.*,//1' | sort -u | xargs -L 1 -- mkdir -p && cat packaging/deb/*.csv |sed -e 's/,usr/ $${PREFIX}/1' | PREFIX=$(PREFIX) envsubst | xargs -L 1 -I % sh -c "cp --preserve=links -r %" - + $(CMD_INSTALL) -D libov/tascar/libtascar/build/lib*.$(LIB_EXT) -t $(DESTDIR)$(LIBDIR) + $(CMD_INSTALL) -D libov/tascar/plugins/build/*.$(LIB_EXT) -t $(DESTDIR)$(LIBDIR) + $(CMD_INSTALL) -D build/ovbox -t $(DESTDIR)$(BINDIR) + $(CMD_INSTALL) -D build/ovbox_cli -t $(DESTDIR)$(BINDIR) + $(CMD_INSTALL) -D build/ovzita* -t $(DESTDIR)$(BINDIR) + mkdir -p $(DESTDIR)$(SHAREDIR) && cp -r node_modules $(DESTDIR)$(SHAREDIR) + $(CMD_INSTALL) -D ovclient.css -t $(DESTDIR)$(SHAREDIR) + $(CMD_INSTALL) -D ovclient.js -t $(DESTDIR)$(SHAREDIR) + $(CMD_INSTALL) -D webmixer.js -t $(DESTDIR)$(SHAREDIR) + $(CMD_INSTALL) -D sounds/2138735723541465742.flac -t $(DESTDIR)$(SHAREDIR)/sounds + $(CMD_INSTALL) -D sounds/4180150583.flac -t $(DESTDIR)$(SHAREDIR)/sounds + $(CMD_LD) + + +#install: +# cat packaging/deb/*.csv |sed -e 's/,usr/,$${PREFIX}/1' | PREFIX=$(PREFIX) envsubst |sed -e 's/.*,//1' | sort -u | xargs -L 1 -- mkdir -p && cat packaging/deb/*.csv |sed -e 's/,usr/ $${PREFIX}/1' | PREFIX=$(PREFIX) envsubst | xargs -L 1 -I % sh -c "cp --preserve=links -r %" + +homebrew: + $(MAKE) -C packaging/homebrew install diff --git a/packaging/homebrew/Makefile b/packaging/homebrew/Makefile new file mode 100644 index 0000000..02bfe2c --- /dev/null +++ b/packaging/homebrew/Makefile @@ -0,0 +1,21 @@ +.PHONY: install build + +#ovbox project directory +REPO=../.. + +#include $(REPO)/config.mk + +install: copyfiles + +build: + rm -rf homebrew-build-dir + mkdir homebrew-build-dir + $(MAKE) -C "$(REPO)" "DESTDIR=$$(realpath homebrew-build-dir)" install + find "homebrew-build-dir/$(PREFIX)/" -type f -exec chmod 755 \{\} \; + +copyfiles: build + mkdir -p "$(DESTDIR)$(PREFIX)" + cp -r "homebrew-build-dir/$(PREFIX)/"* "$(DESTDIR)$(PREFIX)" + +clean: + @rm -rf homebrew-build-dir