.PHONY: python_clean_online_fxreader_vpn

host_deps:
	./m host_deps

python_clean_online_fxreader_vpn:
	rm -fr \
		deps/com.github.aiortc.aiortc/src/online_fxreader/vpn/dist;

python_clean: python_clean_online_fxreader_vpn
	rm -fr \
		~/.local/bin/env3 \
		deps/com.github.aiortc.aiortc/dist \
		deps/com.github.aiortc.aiortc/src/online_fxreader/vpn/dist;

python_put:
	[[ -d ~/.local/bin/env3 ]] || (\
		uv venv --system-site-packages --seed ~/.local/bin/env3 && \
		~/.local/bin/env3/bin/python3 -m pip install uv \
	);
	for f in \
		deps/com.github.aiortc.aiortc/ \
		deps/com.github.aiortc.aiortc/src/online_fxreader/vpn; do \
		echo $$f; \
		[[ -d $$f/dist ]] && continue; \
		python3 -m build --installer uv $$f; \
		~/.local/bin/env3/bin/python3 -m uv pip install $$f/dist/*.whl; \
	done

dotfiles_put:
	mkdir -p ~/.local/bin
	cp dotfiles/.local/bin/commands ~/.local/bin/commands
	cp dotfiles/.local/bin/gnome-shortcuts-macbook-air ~/.local/bin/
	mkdir -p ~/.sway
	cp dotfiles/.sway/config ~/.sway/config
	cp dotfiles/.zshenv ~/.zshenv
	cp dotfiles/.zshrc ~/.zshrc
	cp dotfiles/.vimrc ~/.vimrc
	cp dotfiles/.tmux.conf ~/.tmux.conf
	cp dotfiles/.py3.vimrc ~/.py3.vimrc
	cp dotfiles/.py3.vimrc ~/.py3.vimrc
	cp dotfiles/.gitconfig ~/.gitconfig
	cp -rp \
		dotfiles/.ipython/profile_default/ipython_config.py \
		~/.ipython/profile_default/ipython_config.py
	D1=Code\ -\ OSS; \
	for p in \
		"dotfiles/.config/$$D1/User/keybindings.json" \
		"dotfiles/.config/$$D1/User/settings.json"; do \
		commands install -f -p "dotfiles/.config/$$D1"  -s "$$p" -t ~/.config/"$$D1"; \
	done
	#commands install -f -p dotfiles -s dotfiles/ -t ~/.config/

dotfiles_fetch:
	commands install -f -p ~ -s ~/.config/Code\ -\ OSS/User/keybindings.json -t dotfiles
	commands install -f -p ~ -s ~/.config/Code\ -\ OSS/User/settings.json -t dotfiles