Fix mpv tile overlap portably; add make install/deploy
mpv 0.35 rejects --auto-window-resize, which crash-looped every player. Drop that flag and re-assert each tile geometry on a 1s timer in the daemon, overriding mpv auto-resize on any mpv version. Add make install (auto-sudo, native build + copy to /usr/local/bin) and make deploy (install + restart the kiosk getty unit). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
31
Makefile
31
Makefile
@@ -3,11 +3,22 @@ PKG := ./cmd/rtsp-streamer
|
||||
BINDIR := bin
|
||||
LDFLAGS := -s -w
|
||||
|
||||
.PHONY: all build pi pi32 test vet clean run-tui
|
||||
# Install location. Override with `make install PREFIX=/opt`.
|
||||
PREFIX ?= /usr/local
|
||||
DESTBIN := $(PREFIX)/bin/$(BINARY)
|
||||
|
||||
# Use sudo automatically when not already root, so `make install` /
|
||||
# `make deploy` work whether or not you prefix them with sudo.
|
||||
SUDO := $(shell [ "$$(id -u)" -eq 0 ] || echo sudo)
|
||||
|
||||
# The kiosk session unit restarted by `make deploy`.
|
||||
KIOSK_UNIT ?= getty@tty1
|
||||
|
||||
.PHONY: all build pi pi32 test vet clean run-tui install deploy uninstall
|
||||
|
||||
all: build
|
||||
|
||||
## build: compile for the host platform
|
||||
## build: compile for the host platform (native arch)
|
||||
build:
|
||||
go build -ldflags '$(LDFLAGS)' -o $(BINDIR)/$(BINARY) $(PKG)
|
||||
|
||||
@@ -19,6 +30,22 @@ pi:
|
||||
pi32:
|
||||
GOOS=linux GOARCH=arm GOARM=7 go build -ldflags '$(LDFLAGS)' -o $(BINDIR)/$(BINARY)-armv7 $(PKG)
|
||||
|
||||
## install: build for this machine and copy the binary to $(PREFIX)/bin
|
||||
## (auto-sudo). This is the location the running daemon uses.
|
||||
install: build
|
||||
$(SUDO) install -m 0755 $(BINDIR)/$(BINARY) $(DESTBIN)
|
||||
@echo "installed -> $(DESTBIN)"
|
||||
|
||||
## deploy: install, then restart the kiosk session so the wall picks it up
|
||||
deploy: install
|
||||
$(SUDO) systemctl restart $(KIOSK_UNIT)
|
||||
@echo "restarted $(KIOSK_UNIT); run 'rtsp-streamer status' to check"
|
||||
|
||||
## uninstall: remove the installed binary
|
||||
uninstall:
|
||||
$(SUDO) rm -f $(DESTBIN)
|
||||
@echo "removed $(DESTBIN)"
|
||||
|
||||
## test: run unit tests
|
||||
test:
|
||||
go test ./...
|
||||
|
||||
Reference in New Issue
Block a user