diff --git a/Makefile b/Makefile index ca9d5d0..4a78219 100644 --- a/Makefile +++ b/Makefile @@ -10,6 +10,7 @@ FF_LIBS = $(shell PKG_CONFIG_LIBDIR="$(DEPENDENCY_ROOT)/ffmpeg/lib/pkgconfig" pk BUILD_DIR ?= .build DEBUG_FLAGS ?= -g PREFIX ?= $(HOME)/.local +APPDIR ?= $(HOME)/Applications CXXFLAGS = -std=c++20 -mmacosx-version-min=15.0 -O2 $(DEBUG_FLAGS) -Wall -Wextra -Wno-unused-parameter $(FF_CFLAGS) FRAMEWORKS := -framework AppKit -framework AudioToolbox -framework CoreAudio -framework Metal -framework MetalKit -framework QuartzCore -framework MediaPlayer OBJECTS := $(BUILD_DIR)/player.o $(BUILD_DIR)/progress_reporter.o $(BUILD_DIR)/Output.o $(BUILD_DIR)/cast_media.o @@ -44,11 +45,13 @@ release: $(MAKE) BUILD_DIR=.build/release DEBUG_FLAGS= all install: release - mkdir -p "$(PREFIX)/lib/terebi" "$(PREFIX)/bin" + mkdir -p "$(APPDIR)" "$(PREFIX)/bin" rm -f "$(PREFIX)/lib/terebi/terebi" - rm -rf "$(PREFIX)/lib/terebi/terebi.app" - cp -R ".build/release/terebi.app" "$(PREFIX)/lib/terebi/terebi.app" - ln -sfn "$$(cd "$(PREFIX)" && pwd)/lib/terebi/terebi.app/Contents/MacOS/terebi-cli" "$(PREFIX)/bin/terebi" + rm -rf "$(PREFIX)/lib/terebi/terebi.app" "$(APPDIR)/terebi.app" + cp -R ".build/release/terebi.app" "$(APPDIR)/terebi.app" + ln -sfn "$$(cd "$(APPDIR)" && pwd)/terebi.app/Contents/MacOS/terebi-cli" "$(PREFIX)/bin/terebi" + /System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -f "$(APPDIR)/terebi.app" + mdimport "$(APPDIR)/terebi.app" $(BUILD_DIR): mkdir -p "$@" diff --git a/README.md b/README.md index 84bf9e9..67072bf 100644 --- a/README.md +++ b/README.md @@ -20,12 +20,14 @@ The resulting `.build/terebi.app` is self-contained: copy the whole app to a com ### Install ```sh -make install # builds a release and installs under ~/.local +make install # app: ~/Applications; CLI: ~/.local/bin export PATH="$HOME/.local/bin:$PATH" terebi --help ``` -Use `make install PREFIX="/custom/path"` to change the prefix, or `make release` for just `.build/release/terebi.app`. Installation places the app in `lib/terebi/terebi.app` and its CLI symlink in `bin/terebi`. Quit running players before updating. +Installation builds a release, places `terebi.app` in `~/Applications`, registers it with Launch Services, and requests Spotlight indexing. The CLI symlink is `~/.local/bin/terebi`; any old app under `~/.local/lib/terebi` is removed. Quit running players before updating. + +Use `make install APPDIR="/Applications"` to change the app directory (it must be writable), `PREFIX="/custom/path"` to change the CLI prefix (`bin/terebi`), or both. Use `make release` for just `.build/release/terebi.app`. Builds are ad-hoc signed for personal use, not notarized. Bundled licenses and source archives are in the app's Resources; public binary redistribution requires a separate dependency/license audit, including the GPLv3+ standalone yt-dlp bundle. diff --git a/TODO.md b/TODO.md index 181dc90..e2dab05 100644 --- a/TODO.md +++ b/TODO.md @@ -4,7 +4,8 @@ - native playback activity prevents idle system sleep; local video keeps the display awake, casting allows screensaver/display sleep; native assertion checks and loopback Cast transitions passed, physical idle-TV verification remains unverified - [x] add session-only local-file playlist support - multi-file Open/Finder/drop, natural filename order, editable queue sidebar, explicit append, previous/next and automatic advance; Cast navigation retains the receiver; UI/drag-drop and physical-Cast verification remain unverified -- [ ] make sure the `make install` command installs the application (i can't find it in spotlight) +- [x] make sure the `make install` command installs the application (i can't find it in spotlight) + - installs to ~/Applications, migrates the old hidden app, registers with Launch Services and requests Spotlight indexing; actual install, CLI, code signature, registration and Spotlight query passed; Spotlight UI remains unverified - [ ] takes an awfully long time seek in local videos which i find weird, since seeking in streamed youtube videos is pretty much instant - [ ] in the "choose what to play" screen, we should change the youtube button to general streaming - we can figure out the stream and how to handle it from the url (i.e. if youtube url, handle as youtube stream; if miruro url, handle accordingly) \ No newline at end of file