From 7f99bcdfbcacc7d59854656f2f9f43c6c44529c6 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Sat, 24 Feb 2024 15:13:54 +0300 Subject: [PATCH] Feat: Install `watchdog` as dependency Install `watchdog` as a dependency into a virtual environment. This allows to use different versions of Python without relying on a particular commit of a submodule (the latest version of `watchdog` (4.0) requires Python 3.8). Run make PYTHON=python3.7 USER=1 native-install to set particular Python version. --- Makefile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 7c3dc80..dafcd4c 100644 --- a/Makefile +++ b/Makefile @@ -9,6 +9,7 @@ else endif LIBEXEC ?= $(PREFIX)/libexec +PYTHON ?= python3 .PHONY: all all: @@ -29,7 +30,11 @@ native-install: native/textern.json mkdir -p $(DESTDIR)$(MOZILLA_NATIVE) cp -f native/textern.json $(DESTDIR)$(MOZILLA_NATIVE) mkdir -p $(DESTDIR)$(LIBEXEC)/textern - cp -rf native/textern.py $(DESTDIR)$(LIBEXEC)/textern + $(PYTHON) -m venv $(DESTDIR)$(LIBEXEC)/textern/venv + $(DESTDIR)$(LIBEXEC)/textern/venv/bin/python -m pip install watchdog + sed "s@#!/usr/bin/env python3@#!$(DESTDIR)$(LIBEXEC)/textern/venv/bin/python@" \ + < native/textern.py > $(DESTDIR)$(LIBEXEC)/textern/textern.py + chmod a+x $(DESTDIR)$(LIBEXEC)/textern/textern.py .PHONY: native-uninstall native-uninstall: