fix: install app in user Applications for discovery

This commit is contained in:
2026-10-18 20:02:46 +02:00
parent 015da6a33e
commit 0e860b2ef6
3 changed files with 13 additions and 7 deletions
+7 -4
View File
@@ -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 "$@"