Skip to content

Commit

Permalink
prepare for homebrew packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
gisogrimm committed Oct 27, 2024
1 parent 095e173 commit 2f99734
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,6 @@ announce.flac
*.firmwareupdate

ds-config

# homebrew build directory:
homebrew-build-dir
39 changes: 37 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
21 changes: 21 additions & 0 deletions packaging/homebrew/Makefile
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 2f99734

Please sign in to comment.